[chuck-users] MIDI channel / Interfaces / Machine.Remove / Functors (!)

Kassen signal.automatique at gmail.com
Sun Jun 17 09:01:59 EDT 2007


Hello, Mies!

> Hello - this is my first post here but I've been experimenting with ChucK
> for quite a while, and have a few questions I can't manage to find the
> answers to by myself...
> I'm more familiar with the likes of OpenMusic or MaxMSP but enjoy the power
> of the ChucK language as well as the fact that all it requires is
> chuck.exe!!! (and the manual ;)

And /examples/! I think many people underestimate exactly how usefull
the examples directory is.

>
> 1. Is there a way to retrieve from MidiIn/MidiOut objects the channel
> originally passed to open or do I need to encapsulate open in a method of my
> own in a derived class?

Looks like you found a bug (well, a missing feature)!

According to the manual MidiIn.open() is both read and write but I
just tried and -like you- I can't read from it so that might be a
issue.

...This is asuming you meant "device" above, not "channel", the  MIDI
chanel would be in the message.

> 3. Machine.remove(shred.id()) terminates a shred (great feature!) but could
> someone clarifies what happens behind the scene? In particular, is there a
> callback method automatically called when a shred exits that users could
> hijack to perform some cleanup?
>

If successfull, machine.remove( int ) returns the id of the removed
shred so yes, depending on what exactly you'd like to clean up. The
real cleanup should be done by ChucK but other shreds might contain
some sort of comunication device to talk to the removed shred that you
might like to clean up. In that case it would be wisest to send the
remove comand fromt he same shred that send the comunications because
if you have a shred terminate itself everything it "knows" is of
cource lost.

It would be better if we'd have some way of getting the contents of
the VM from within ChucK and know things like what shred has which
childeren and the name of the function those are based on and so on,
somewhere in the future.... :¬)

Hope that helps at least a little, not sure what you are after here, exactly.

Kas.


More information about the chuck-users mailing list