rev: 3827f53bae88e48a594610914ba74b9512ead6dd tukan/testing/test_midi.sc -rw-r--r-- 573 bytes View raw Log this file
3827f53bae88 — Leonard Ritter * more work on module system 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using import ..tukan.midi
using import ..tukan.sdl

SDL_Init SDL_INIT_AUDIO
midi-init;
local event = (nullof SDL_Event)
while true
    if ((SDL_PollEvent (& event)) != 0)
        if (event.type == MIDIEvent)
            let timestamp channel command param1 param2 =
                midi-unpack-message event
            if
                or
                    command == MIDICommand.NoteOn
                    command == MIDICommand.NoteOff
                print timestamp channel command param1 param2
        if (event.type == SDL_QUIT)
            break;
midi-exit;