Skip to content

Instantly share code, notes, and snippets.

@hsitz
Last active April 24, 2020 00:20
Show Gist options
  • Select an option

  • Save hsitz/c33f0d9dbac93f87507ea2e8095f3407 to your computer and use it in GitHub Desktop.

Select an option

Save hsitz/c33f0d9dbac93f87507ea2e8095f3407 to your computer and use it in GitHub Desktop.
@OnLoad
FillArray seq, 0, 128
seq = [1,3, 5, 7, 9, 11, 10, 8, 6, 4, 2]
seqndx = 0
call SetUpScale
delay = 100
ShowLayout 2
@End
@SetUpScale
PreSetScale = {Aeolian}
setrootnote = 0
// fill scalenotes with scale notenums
fillarray scalenotes, 0, 128
fillarray scalendx, 0, 128
count = 0
for i = 0 to 127
if i = scalequantize i
scalenotes[count] = i
scalendx[i] = count
inc count
endif
endfor
basenote=60
basendx = scalendx[basenote]
@END
@OnMidiNoteOn
call @PlayNote
@END
@PlayNote
if seq[seqndx] = 0
seqndx = 0
endif
note_to_play = seq[basendx + seq[seqndx]]
SendMIDINoteOn MidiChannel, note_to_play, MIDIVelocity
SendMIDINoteOff MidiChannel, note_to_play, 0, delay
@End€
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment