[chuck-users] A few random ChucK questions

Ken Restivo ken at restivo.org
Fri Apr 6 00:10:30 EDT 2007

Hash: SHA1

A couple random ChucK questions:

1) Is there a tutorial or example code recipe somewhere specifically showing how to sync ChucK with JACK Transport? I want to use ChucK to supplement other tools that are sync'ed together using JACK (i.e. Hydrogen, Ardour, Rosegarden). I saw a thread that said, basically "use OSC", but I don't see any ChucK sample code that shows how to use OSC for syncing ChucK's clock with an external OSC-based source, i.e. like JACK transport.

2) A related but possibly off-topic question is: how do I translate JACK transport into OSC so that it can be sent to ChucK? Ardour and Rosegarden can send timestamps via MIDI, so that's one possible solution. Perhaps ChucK can accept MIDI sync, eliminating the OSC middleman?

3) The polyfony and gomidi examples are great, but they seem to want to initiate a connection. That doesn't work too well: I start up synths (ChucK being used as a synth) and then connect my keyboard or sequencer to them using aconnect or qjackctl. So I guess what I'm looking for is a code snippet of a loop that'll have ChucK sit around waiting for an incoming MIDI connection, rather than trying to initiate one. Likewise, better if the shred doesn't die or become unresponsive to MIDI if the connection is closed and then opened again, i.e. from a different keyboard or sequencer.

4) I'm really new to ChucK, but I didn't see any way to release a note. The sample code sounds like it stops the note hard at receipt of a note off message, or after 100ms, but reading the code, it doesn't seem to deal with note off at all! Most instruments need a release time, so I'd need a way to receive a note off, then start the note's release envelope, and I'm too new to ChucK yet to see how to do that.

Questions #1 and #2 are related to using ChucK as a sequencer or beatbox. Questions #3 and #4 are related to using ChucK as a softsynth. The latter is a higher priority for me than the former, though I'm intrigued by both possibilities.

If there's a ChucK script somewhere that expands on the midi examples, to provide something that behaves like any ordinary JACK softsynth (connect/disconnect via ALSA MIDI), then I would probably use that a lot. I could then change the code of the handler() function to experiment with different instruments, or add code to switch instruments based on MIDI program change events, etc. The built-in Ugens have lots of interesting parameters that seem to be already hard-coded to MIDI controller events, which I'd love to play with using real knobs on my keyboard controller. It seems like ChucK could be a very expressive softsynth, with parameters controlled not through a software GUI, but through real rotary controllers and buttons on a MIDI keyboard-- nice for performance purposes.

The "plumbing" code I'd need (or need a lot of help writing), is the skeleton to handle waiting for incoming MIDI connnections instead of trying to open() them, and to handle note off events with some kind of decay envelope. From there, I think I can figure out the program change and controller change stuff myself.

My apologies if I'm the only person out there trying to use ChucK as basically a GUI-less softsynth controlled by MIDI.

- -ken
Version: GnuPG v1.4.1 (GNU/Linux)


More information about the chuck-users mailing list