kohacraft Lab
/
kc_YMZ294player
YMZ294 Player. modified from "Yamaguchi's YMZ294 Library" for LPC1114.
Diff: main.cpp
- Revision:
- 0:7a56bf0441ea
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Dec 09 01:38:08 2015 +0000 @@ -0,0 +1,28 @@ +#include "Player.h" + +// pin asign D0,D1,D2,D3,D4,D5,D6,D7,CS,WR,A0 +YMZ294 soundGen(dp13, dp14, dp15, dp16, dp17, dp18, dp24, dp25, dp26, dp27, dp28); + + +char *choucho = + "G4q E4q E4h | F4q D4q D4h | C4q D4q E4q F4q | G4q G4q G4h |\ + G4q E4q E4q E4q | F4q D4q D4q D4q | C4q E4q G4q G4q | E4q E4q E4h |\ + D4q D4q D4q D4q | D4q E4q F4h | E4q E4q E4q E4q | E4q F4q G4h |\ + G4q E4q E4q E4q | F4q D4q D4q D4q | C4q E4q G4q G4q | E4q E4q E4h"; + +enum {PIANO = 0, UWA = 14, SANBA = 14, ORGAN = 13}; +enum {PIANO_FREQ = 16384, UWA_FREQ = 5120, SANBA_FREQ = 1000, ORGAN_FREQ = 128}; + +Player player(choucho); + +int main() { + player.rewind(); + player.play(soundGen, UWA_FREQ, UWA, 120); + wait(1); + player.rewind(); + player.play(soundGen, PIANO_FREQ, PIANO, 120); + wait(1); + player.rewind(); + player.play(soundGen, SANBA_FREQ, SANBA, 120); + wait(1); +}