[chuck-users] Hid open by string [bug]

Kassen signal.automatique at gmail.com
Fri Dec 18 21:47:20 EST 2009


Now why would you ever want to open a device by name if it wasn't connected
> to your system? :)
hi.open("Crackin DJ Console");

It's not connected to my system, in fact I don't think there even is on in
the whole of the Netherlands, but I'd still really like to have one attached
and open it.

> Thanks for the bug report.  Should be an easy fix.
Looks like it, yes.

Some notes; It's not clear what we would do if we'd have multiple identical
devices attached, that we'd still like to open by name for readability and
because there might also be other devices of the same type. Let's say
(purely hypothetically, of course) two identical toy turntables and a
joystick. Could we overload this to .open(string name, int id) for such

I hadn't realised we had this until I went over VERSIONS just tonight and
realised I had been implementing this exact functionality for the MIDI
objects by incrementing id and repeatedly opening the device until the
.name() matched the string I was looking for. Could we also get this for the
MIDI abstractions?

I know that at least Windows will swap the device order around when I boot
without the external soundcard attached; it'll move it's internal GM synth
to the top of the list (to not default to a unavailable device) but it
doesn't move it back after I re-attach the card. Hence; I implemented
basically this for the MIDI devices (so Windows can swap stuff around if it
feels the need),  I think .name(string) would make sense there too.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20091219/d681734b/attachment.html>

More information about the chuck-users mailing list