diff options
author | deva <deva> | 2008-07-21 12:11:02 +0000 |
---|---|---|
committer | deva <deva> | 2008-07-21 12:11:02 +0000 |
commit | 981cd50a83e67f5471ee1e1ad0c0575506f14da0 (patch) | |
tree | c206e93a6def02fec109190cc1c0b15c26f639c8 /src/drumgizmo.cc | |
parent | 9f07c02a19ee79906ad3f3ab8c9eed725def8b96 (diff) |
Wee multivoices and multiple wavs... all triggered by the midi test framework.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r-- | src/drumgizmo.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 737a197..f423bb0 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -31,20 +31,23 @@ static jack_port_t *test_midi_port = NULL; static size_t timer = 0; +static size_t next = 44100; int process(jack_nframes_t nframes, void *arg) { // if(jack_port_connected_to(test_midi_port, "DrumGizmo:midi_in")) { void* port_buf = jack_port_get_buffer(test_midi_port, nframes); - if(timer > 44100) { // activate every second (44100 samples) - printf("ding\n"); + if(timer > next) { // activate every second (44100 samples) + // printf("ding\n"); - jack_nframes_t time = 1; - size_t size = 3; - jack_midi_data_t all_notes_off[] = { 0xB0, 123, 0 }; + jack_nframes_t time = (jack_nframes_t)(((float)rand() / (float)RAND_MAX) * nframes); + size_t size = 1; + jack_midi_data_t all_notes_off[] = { rand() % 2 }; jack_midi_event_write(port_buf, time, all_notes_off, size); + timer = 0; + next = (size_t)(((float)rand() / (float)RAND_MAX) * 0.3 * 44100); } timer += nframes; |