On 6/21/05, Olivier Guilyardi <ml(a)xung.org> wrote:
Is there any piece of code I could reuse out there,
for such continuous midi
controllers support ? Any clean code, whatever app it comes from, would be helpful.
Answered in your other thread.
Btw, I thought gtk widgets extending SpinButtons or
Sliders would be a great
idea. One would simply drop the widgets in, and these would be adjustable with a
midi continous controller, just like they are with a mouse or keyboard...
I think a better approach is something like Model-View-Controller,
where the Model is your synth code, the View is your Gtk GUI, and the
Controller is a piece of code that has (or is called by) your Gtk
event handling functions and MIDI handling code. Incoming MIDI CC
changes are then reflected by your SpinButtons and Sliders (by calling
a function to set their values/move their sliders to the current CC
value).
I would guess that is how most GUI softsynths are implemented. I
wouldn't want to mix Gtk and MIDI handling code, unless maybe by
integrating it into the GLib main loop.