While Statement issue with Uno2 #UnO2


Jack Fenton
 

Hi this segment works but I had to add the if statement otherwise the "SendMidi Nord 0 0" still executes even if $Device = "Hammond"

TRIGGER_CLICK AllNotesOffPanic =
{
   switch($Device)
   {
   case "Hammond":
      SendMidi Hammond CtrlChange $HammondAllSoundsOff 127
      break
   case "Nord":
      // Nord does not recognize all notes off so we need to send them manually
      $currentnote=127
      while ($currentnote > 0)
      {
         SendMidi Nord NoteOff $currentnote 0
         $currentnote--
        //Wait 1
      }
      // I had to add this. I think it is a bug with while statement 
      if ($Device == "Nord")
      SendMidi Nord NoteOff 0 0 // This line always executes if the above line is not there
      break
   default:
      break
   }
}


Join uno@fcb1010.groups.io to automatically receive all group messages.