[Fluxus] fluxus-midi, controllers and program values

Hugo van Galen hugovangalen at gmail.com
Thu Jul 8 11:10:32 PDT 2010


    Hello again list,

Today I hacked a little in the fluxus-midi module. I "needed" to get the
MIDI controller change 'as it happened' so to speak.. As usual, various ways
to accomplish this... I looked down upon maintaining a local vector of
controller values in the (fluxus) program, and checking out which have
changed (every channel, all controllers = most probably very slow to do
every-frame). I also looked at (midi-peek), but that returns a string value,
and as the function description includes "for debugging purposes", I'm not
too sure if that would be most optimal, as it's a single string returning
only the last of a sequence of events, so I could loose values there.

The quickest way to get me results, I thought would be to solve my problem
in the fluxus-midi module itself. My version will also 'queue' the event
like the MIDINotes are queued. I kept this list only 16 items large, as
there could be a lot of controller values being sent and for my purpose of
animation only the most recent are interesting...

So I went on to implement (midi-cc-event) which returns #f is there was no
event and otherwise controller information: number and value, similar to
(midi-note).

Now my question is, was implementing that a wise thing to do? Or did I
re-invent the wheel there because I am unaware of something? Or there is a
slight possibility that change may be useful upstream?


Also, when going through that code (specifically, that enum in
MIDIListener), I get the impression that "Program Change" and "Pitch Bend"
are planned features?

If so, perhaps interesting to know that I have already done "Program
Change"; implementing (midi-program ch), to get the current program value
for the requested channel.


I have attached the patch that implements the (midi-program) and
(midi-cc-event), might anyone be interested...

Cheers,
Hugo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20100708/5b2062c3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fluxus-midi-cc-event-and-midi-program.diff
Type: text/x-diff
Size: 7793 bytes
Desc: not available
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20100708/5b2062c3/attachment-0002.diff>


More information about the Fluxus mailing list