Created
October 11, 2021 14:07
-
-
Save lunandd/a5a1f2c77dbfb87729fef0a23717bb50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const E2 = 82.41; | |
const A2 = 110.00; | |
const D3 = 146.83; | |
const G3 = 196.00; | |
const B3 = 246.94; | |
const E4 = 329.63; | |
input.onButtonPressed(Button.A, () => { | |
midi.playTone(E2, music.beat(BeatFraction.Whole)) | |
}) | |
input.onButtonPressed(Button.B, () => { | |
midi.playTone(A2, music.beat(BeatFraction.Whole)) | |
}) | |
input.onButtonPressed(Button.AB, () => { | |
midi.playTone(D3, music.beat(BeatFraction.Whole)) | |
}) | |
input.onPinPressed(TouchPin.P0, () => { | |
midi.playTone(G3, music.beat(BeatFraction.Whole)) | |
}) | |
input.onPinPressed(TouchPin.P1, () => { | |
midi.playTone(B3, music.beat(BeatFraction.Whole)) | |
}) | |
input.onPinPressed(TouchPin.P2, () => { | |
midi.playTone(E4, music.beat(BeatFraction.Whole)) | |
}) | |
midi.useRawSerial() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment