Created
July 8, 2020 23:13
-
-
Save manualbashing/86b86aa583fad270f202040b25f2ccaa to your computer and use it in GitHub Desktop.
Explore available samples and synths using your midi controller #SonicPi
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
explore = "synths" | |
available_keys = 108 | |
set_sched_ahead_time! -0.4 | |
shift = 0 | |
live_loop :midi_player do | |
note, amp = sync "/midi:digital_piano:0:1/note_on" | |
if amp != 0 # ignore key released events | |
if note == 108 # next page | |
shift = shift + 106 | |
synth :beep, note: 88 | |
elsif note == 107 # prev page | |
shift = shift - 106 | |
synth :beep, note: 68 | |
else | |
if explore == "samples" | |
sample all_sample_names[note + shift] | |
elsif explore == "synths" | |
synth synth_names[note + shift], note: 60 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment