[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] HID out as midi



Hi,

On Wednesday 03 December 2008 07:22:30 Cédric Dambrain wrote:
> Hi all,
>
> I want to output a midi CC from a HID I use to control SC. I tried
> this code but don't get any value:
>
> (
> var range, outcc;
> range = [ 0, 127 ].asSpec;
> outcc = range.map({ a.slots[3].at( 49 ).bus });
> m = MIDIOut(0, MIDIClient.destinations[0].uid);
> m.control(0, 80, outcc);
> )
>
> Can anyone help?

You are confusing server side things (buses) with language side things.

You can add an action to your HID slot, to send out the MIDI value:


(
var range;
range = [ 0, 127 ].asSpec;
m = MIDIOut(0, MIDIClient.destinations[0].uid);
a.slots[3].at( 49 ).action_( { |slot| m.control(0, 80, 
range.map(slot.value) ) } );
)

Then whenever HID data comes in, the value is mapped and sent out as MIDI.

sincerely,
Marije

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/