« Return to Thread: WiiMote example code request
On Sunday 01 June 2008 10:50:16 Tomer Harari wrote:It should work, as far as I remember.
> Hi Marije
>
> Maybe I spoke too soon about it all being clear, but the nunchuk expansion
> is not working for me.
> It may be the fact the i am working on a mac?
You have to enable it by executing:
w.enableExpansion( 1 );
and then it should work.
sincerely,
Marije
> If you have a way to check it out i would appreciate it very much.
> thanks
> Tomer
>
> nescivi wrote:
> > WiiMote.start; // start the eventloop
> > WiiMote.discover; // discover a new device (wait for post about
> > connected) WiiMote.all; // post an array of all devices
> > w = WiiMote.all[0];
> > x = WiiMoteGUI.new( w ); // create a GUI (only covers the WiiMote and
> > NunChuk currently)
> >
> > w.enableMotionSensor( 1 );
> > w.enableExpansion( 1 );
> >
> > // create bus on the server
> > b = Bus.control( s, 1 );
> >
> > w.setAction( \ax, { |v| b.set( v ) } ); // write the value to the bus.
> >
> > SynthDef( \wii_example, { |out=0,amp=0|
> > Out.ar( out, SinOsc.ar( 300, 0, 0.01*amp.abs ) );
> > }).load( s );
> > )
> >
> > x = Synth.new( \wii_example );
> > x.map( \amp, b );
> > x.free;
> >
> > // same but using In.kr to read from bus
> > SynthDef( \wii_example2, { |out=0,controlbus=0|
> > var amp;
> > amp = In.kr( controlbus, 1 );
> > Out.ar( out, SinOsc.ar( 300, 0, 0.01*amp.abs ) );
> > }).load( s );
> > )
> >
> > x = Synth.new( \wii_example2, [\controlbus, b] );
> > x.free;
> >
> > On 5/16/08, Tomer Harari <hatanin@...> wrote:
> >> I guess the code is not clear enough for me.
> >> Is it rude to ask you to spell it out for me?
> >> How does this action look like?
> >> Thanks for your patience
> >> Tomer
> >>
> >> nescivi wrote:
> >>> Is the example code in the helpfile not clear enough?
> >>>
> >>> You can just set the action to put the value on a control bus for the
> >>> sensors that you are interested in. Then you can use the values
> >>> directly inside a SynthDef by reading from the control bus.
> >>>
> >>> sincerely,
> >>> Marije
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users
« Return to Thread: WiiMote example code request
| Free Forum Powered by Nabble | Forum Help |