diff --git a/tests.ts b/tests.ts index 0592ba7..ca90472 100644 --- a/tests.ts +++ b/tests.ts @@ -6,9 +6,10 @@ bluetooth.onBluetoothDisconnected(() => { }) bluetooth.startMidiService(); basic.showString("S") +let channel = 1; input.onButtonPressed(Button.A, () => { basic.clearScreen(); - let piano = midi.inputChannel(0); + let piano = midi.inputChannel(channel); for (let note = 0x0; note < 0x5A; note++) { led.toggle(0, 0); piano.noteOn(note); @@ -16,4 +17,15 @@ input.onButtonPressed(Button.A, () => { piano.noteOff(note); basic.pause(100); } -}) \ No newline at end of file +}) +input.onButtonPressed(Button.B, () => { + channel += 1; + basic.showNumber(channel); +}) +input.onButtonPressed(Button.AB, () => { + basic.clearScreen(); + for (let note = 0; note < 127; note++) { + led.toggle(1, 1); + midi.playDrum(note); + } +})