add MIDI example
s-ol
5 months ago
0 | ([1]import midi) | |
1 | ([2]import* time struct-) | |
2 | ||
3 | ([3]def port ([4]midi/port 'system:midi_capture_2' 'system:midi_playback_2')) | |
4 | ||
5 | #(send a C4 note every 0.7s, | |
6 | the velocity is set using CC 31) | |
7 | ([5]midi/send-notes ([9]get port "out") ([7]every 0.7 | |
8 | ([6]struct | |
9 | 'pitch' 36 | |
10 | 'vel' ([8]midi/cc ([10]get port "in") 31 'raw') | |
11 | 'dur' 0.5))) |