Hi, list.

At the moment I'm merrily ChucKing allong building a little "groovebox". My idea here is that it's easier to put knobs on a laptop then it is to put a comand line on a groovebox.

The plan is to have one shred backed by a few sporked functions that will allow me to manipulate data in arrays using a midi controler (toggeling steps for beats, so far). Eventually this will use events to trigger the sounds in other shreds so those sounds could be re-compiled without ruining the data in the arrays. This is working nicely and seems like a good idea, even if at the moment it's not quite up to the level of a rs7000 or Live (yet!).


For true groovebox functionality it would be nice to have some way of listening to a MIDI clock and this seems to be missing at the moment.
Of cource MIDI sync normally works quite differently from the typical structure of ChucK code but at least some way of relating to it would be nice.

I'd like to sugest some new function for this.
What if we had something that would for example be able to output those midi clock "sync" pulses (I think they are properly defined as repeat "play" messages or something along those lines?) as events as well as the duration (in time) between the last two clock ticks of a incoming clock. Practically speaking it might be more sensible to average the time of -say- the last four of those, considdering how inacurate MIDI is and how quickly multiplied jitter might add up if looped.

This would enable us to have chuck loops that would go something like;

//wait for next sync event
sync => now;
//main loop
while(true)
{
something_involving_realy_cool_beats;

//advance my sequencer
1 +=> steps;
(steps % 16) => steps;
//advance time by a quarter note
24::click => now;
}



Now; this example would probably start drifting unless the duration of "click" was updated frequently by some external loop (thus averaging out the jitter) and even then some more advanced form of syncing the whole loop up every once in while would be preferable, especially if the external master clock will be modulated in mid piece.... Still; I hope this demonstrates that Chuck programs could relate to a MIDI clock in a way that's at least somewhat similar to the way they normally relate to the internal ChucK "now".

Bad;
Keeps MIDI alive while it realy should have died long ago.

Good;
Allows one to jam with friends who haven't yet realised MIDI should have been left in the 80's.
Not all that complicated to implement, I imagine.

Alternatively it would also be welcome to point me at where it says we allready have something like this; I looked and couldn't find a thing.

Yours,
Kas.