// Instead of having only 4 buttons on your BlueBoard, have 4 sets (or "spaces") of 4 buttons each - which makes 16 in total! // // Just press-and-hold a button to activate its set of 4 buttons. For example, by pressing A for a while, you'll activate space A. Now just use the BlueBoard's buttons, and you will see that they're sending different MIDI codes now than in space B, C, or D. // // Make sure to start the BlueBoard while pressing the B button! @OnLoad SetShortName {Spacer} EMPTY = -1 // BlueBoard (bb) buttons. Each button (A, B, C, D) offers one space which is activated by very-long-tapping. bbNotes = [60, 62, 64, 65] gtlChannel = 15 // Channel on which GTL should listen => should not be 0! bbChannel = 0 // BlueBoard's channel => do not change this! longTapTime = 250 // Time needed to execute a long-tap (in ms) veryLongTapTime = 750 // Time needed to activate a space onOffDelay = 50 // Delay between on/off note send, see https://forum.audiob.us/discussion/comment/829929/#Comment_829929 baseNote = EMPTY noteToSend = EMPTY timerInterval = 5 SetTimerInterval timerInterval Call @IlluminateAllButtons activeSpace = bbNotes[0] Call @ActivateSpace @End @OnMidiNoteOn buttonPressedStartTime = SystemTime // Time at which button was pressed down timerCounter = veryLongTapTime StartTimer @End @OnMidiNoteOff buttonPressedTime = SystemTime - buttonPressedStartTime if buttonPressedTime >= veryLongTapTime // Do nothing, the timer took care of activating the space already elseif buttonPressedTime >= longTapTime Call @LongTap Else Call @ShortTap Endif StopTimer @End @OnTimer if timerCounter > 0 timerCounter = timerCounter - timerInterval else activeSpace = MidiNote Call @ActivateSpace StopTimer endif @End @ShortTap // Log {Short Tap: }, MidiNote for i = 0 to 3 if MIDINote = bbNotes[i] noteToSend = baseNote + i + 1 endif endfor Call @SendNoteFromCurrentSpace @End @LongTap // Log {Long Tap: }, MidiNote for i = 0 to 3 if MIDINote = bbNotes[i] noteToSend = baseNote + i + 5 endif endfor Call @SendNoteFromCurrentSpace @End @ActivateSpace Log {Activated space: }, activeSpace for i = 0 to 3 if activeSpace = bbNotes[i] // 128 / 4 buttons = 32 baseNote = i * 32 endif endfor noteToSend = baseNote Call @SendNoteFromCurrentSpace @End @IlluminateAllButtons // It would have been nice to be able to illuminate specific buttons depending on the interaction with the BB. // But this seems to be buggy, see https://forum.audiob.us/discussion/comment/832104/#Comment_832104. // So we just keep all of them illuminated (for visibility purposes when using the BB in the dark). for i = 0 to 3 SendMidiNoteOn bbChannel, bbNotes[i], 100 endfor @End @SendNoteFromCurrentSpace SendMidiNoteOn gtlChannel, noteToSend, 100 SendMidiNoteOff gtlChannel, noteToSend, 0, onOffDelay Log {Sent Midi: }, noteToSend @End