test code to let sing eVocaloid eVY1 shield

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ytsuboi
Date:
Wed Oct 30 11:18:08 2013 +0000
Parent:
0:bc5433b55c5c
Commit message:
tested with FRDM-KL25Z, added some comments

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r bc5433b55c5c -r ffd1fb78a02f main.cpp
--- a/main.cpp	Wed Oct 30 08:38:33 2013 +0000
+++ b/main.cpp	Wed Oct 30 11:18:08 2013 +0000
@@ -1,6 +1,7 @@
 #include "mbed.h"
 
 Serial evy1(P0_4, P0_0); // tx, rx configured for LPC800-MAX
+//Serial evy1(PTA2, PTA1); // tx, rx configured for FRDM-KL25Z
 
 // DO NOT EDIT!!
 const char* phoneticSymbols[] = {
@@ -44,28 +45,27 @@
   evy1.putc(0x10);
   
   for(int i=0;i<num;i++){
-    if(i != 0) evy1.putc(0x2c);
+    if(i != 0) evy1.putc(0x2c); // 0x2c is separator
     evy1.printf(phoneticSymbols[lylics[i]]);
   }
   //footer
-  evy1.putc(0x00);
-  evy1.putc(0xF7);
+  evy1.putc(0x00);  // footer for NSX-1
+  evy1.putc(0xF7);  // footer of MIDI sys-ex
 }
 
 
 int main() {
   int key = 0x3c; //C
-//  float wait =0.5;
-//  int oct = 0;
 
   evy1.baud(31250); // MIDI speed
   wait(5); // waiting for eVY1 module boot up
 
   //send lylics
   int lylic_len = sizeof(lylics) / sizeof(lylics[0]);
-  lylic_send(lylic_len);
+  lylic_send(lylic_len);    // sending lylics first
  
   int mml_len = sizeof(mml) / sizeof(mml[0]);
+  
   for(int i = 0;i< mml_len ;i++){
     char c = mml[i];
     if(c >= 'a' && c <='z') c-= 0x20;
@@ -89,6 +89,6 @@
         }
     }
   }
-  Short_Message(0x90,key,0x7f);   
+  Short_Message(0x90,key,0x7f);   // note on message. 0x90=1ch, 0x7f=Velocity
   wait(0.5);
 }