// ElementaryExtensions API: using ElementaryExtensions; namespace MiscellaneousDemo { //************************************************************************************************** /// /// Helper class for melody playback (through class). /// static class Marseillaise { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static readonly int[,] Tonality= { { ЄBeeper.Do , +1 }, { ЄBeeper.Fa , +1 }, { ЄBeeper.Sol, +1 } }; static readonly int[,] Notes= { { 1,ЄBeeper.Re, 1,16, 0 }, { 1,ЄBeeper.Re, 1, 8, 1 }, { 1,ЄBeeper.Re, 1,16, 0 }, { 1,ЄBeeper.La, 1, 4, 0 }, { 1,ЄBeeper.La, 1, 4, 0 }, { 1,ЄBeeper.Si, 1, 4, 0 }, { 1,ЄBeeper.Si, 1, 4, 0 }, { 2,ЄBeeper.Mi, 1, 4, 1 }, { 2,ЄBeeper.Do, 1, 8, 0 }, { 1,ЄBeeper.La, 1, 8, 1 }, { 1,ЄBeeper.La, 1,16, 0 }, { 2,ЄBeeper.Do, 1, 8, 1 }, { 1,ЄBeeper.La, 1,16, 0 }, { 1,ЄBeeper.Fa, 1, 4, 0 }, { 2,ЄBeeper.Re, 1, 2, 0 }, { 1,ЄBeeper.Si, 1, 8, 1 }, { 1,ЄBeeper.Sol, 1,16, 0 }, { 1,ЄBeeper.La, 1, 2, 0 } }; //-------------------------------------------------------------------------------------------------- public static void Play() { Play(false); } public static void Play(bool bIgnoreMuteFlag) { ЄBeeper.PlayEx ( false, bIgnoreMuteFlag, null, // origin note frequency -- "Do-1" (by default: 262Hz) 2000, // tact duration (in milliseconds) 4, // tact numerator 4, // tact denominator Tonality, // tonality (array of tone corrections) Notes // notes array ( octave-no,note, multiplier,divider, points ) ); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } // Marseillaise //************************************************************************************************** } // MiscellaneousDemo