Commits

Jody McAdams committed 4a36432

music maker update

Comments (0)

Files changed (1)

Experimental/MusicMachine/MusicMachine.ino

   
   // read the state of the pushbutton value:
   int buttonState2 = digitalRead(g_buttonPin2);
-
-  int potBasedNote = potFrac*(g_numNotes-1) + 0.5f;
   
   //If you have released either of these buttons, you
   //can switch modes again
      //for(int i=0; i<g_numNotesRecorded; ++i)
      //{
         //Display current note
-        //sevenSegWriteNote(potBasedNote);
-        tone(g_buzzerPin,g_notes[g_recordedNotes[g_playBackIndex]+g_noteOffset],200);
+        int theNote = g_recordedNotes[g_playBackIndex];
+        sevenSegWriteNote(theNote);
+        tone(g_buzzerPin,g_notes[theNote+g_noteOffset],200);
         
         delay(500*(1.0f-potFrac));
         noTone(g_buzzerPin);
    //Record mode
    else
    {
+       int potBasedNote = potFrac*(g_numNotes-1) + 0.5f;
+       
        //End song early
        if( g_allowModeSwitch
          && ((buttonState1 == HIGH && buttonState2 == HIGH)