[LAD] patterns, GUI, JACK midi interactions..

james at jwm-art.net james at jwm-art.net
Sat Feb 20 17:02:10 UTC 2010


The sequencer/arpeggiator/WYWTCI I'm working on, (eventually) will
partially generate MIDI events (primarily NOTE-ON/OFF) from a pattern. The
pattern consists of equi-distant intervals (ie 1/8th or 1/16th etc), where
each interval has the potential to play a note or not.

The note pitch and velocity is generated by something akin to window
placement. Given a grid: pitch @ X, velocity @ Y, place a box within the
grid using an algorithm to prevent overlapping other boxes* etc, but only
when the pattern says to do so.

Initially I thought I'd have this generative stuff within the JACK process
callback, but soon decided not too...

Here is how I think this will work:

1) The 'pattern processor' processes 1 quarter note at a time (I guess)...
looking ahead, processing notes which will be playing shortly, adding the
generated note data to a main event list for the sequencer (??)

2) The sequencer processes the main event list, creating the MIDI events
and adding them to a jack_ringbuffer.

3) the JACK process thread/callback reads the jack_ringbuffer and outputs
the MIDI events it finds there to the JACK MIDI port.

Now, somewhere along the line, the GUI has to provide visual feedback at
exactly (or as exactly as possible) the time any note on/off occurs.

Perhaps then:

4) the JACK process thread/callback upon sending a midi event, adds to a
2nd ring buffer which is read by the GUI thread, and displays the visual
feedback (ie a coloured box).

Also, the 'pattern processor' will need to be notified of note off events
so it can remove the box from the grid (such that new notes might replace
the old). So..

5) the Jack process thread cb upon sending a note off adds to a 3rd
ringbuffer which is read by the pattern processor to notify it of the
removal of a note/box.

Does this sound about right?


* see also: http://jwm-art.net/art/text/xwinmidiarptoy

More information about the Linux-audio-dev mailing list