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

Spencer Salazar ssalazar at CS.Princeton.EDU
Fri Dec 18 23:16:50 EST 2009


Howdy,

On Dec 18, 2009, at 6:47 PM, Kassen wrote:

> 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 cases?

Yeah, that makes sense.  I guess it wouldn't be bad to have .countNamed(string name) or something liked that to tell you the number of devices with "name", so you know the range of id in .open(string name, int id).  Right now open(string name) just opens the "first" one it finds, which I would expect to be pretty arbitrary and inconsistent.  

> 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?

Yup, this is in the works for MIDI also.  

spencer

> 
> 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.
> 
> Thanks,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list