|
View:
New views
16 Messages
—
Rating Filter:
Alert me
|
|
|
WiiMote example code requestHi,
I am looking for some example code for using the wiimote and nunchuk. I had luck with Pete Moss's WiimoteLib, but it does not support the nunchuk. so, I would like to get some examples of how to tap in to the accelerometers, and map them to a control bus or use them inside a SynthDef with the WiiMote class that comes with SC. Thanks a lot Tomer |
|
|
Re: WiiMote example code requestIs 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 On 5/14/08, Tomer Harari <hatanin@...> wrote: > > Hi, > I am looking for some example code for using the wiimote and nunchuk. > I had luck with Pete Moss's WiimoteLib, but it does not support the nunchuk. > so, I would like to get some examples of how to tap in to the > accelerometers, and map them to a control bus or use them inside a SynthDef > with the WiiMote class that comes with SC. > Thanks a lot > Tomer > > > -- > View this message in context: > http://www.nabble.com/WiiMote-example-code-request-tp17240482p17240482.html > Sent from the Supercollider - User mailing list archive at Nabble.com. > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users > sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestI 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
|
|
|
Re: WiiMote example code requestWiiMote.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 >> >> On 5/14/08, Tomer Harari <hatanin@...> wrote: >>> >>> Hi, >>> I am looking for some example code for using the wiimote and nunchuk. >>> I had luck with Pete Moss's WiimoteLib, but it does not support the >>> nunchuk. >>> so, I would like to get some examples of how to tap in to the >>> accelerometers, and map them to a control bus or use them inside a >>> SynthDef >>> with the WiiMote class that comes with SC. >>> Thanks a lot >>> Tomer >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/WiiMote-example-code-request-tp17240482p17240482.html >>> Sent from the Supercollider - User mailing list archive at Nabble.com. >>> >>> _______________________________________________ >>> sc-users mailing list >>> sc-users@... >>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >> >> > > -- > View this message in context: > http://www.nabble.com/WiiMote-example-code-request-tp17240482p17270252.html > Sent from the Supercollider - User mailing list archive at Nabble.com. > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users > sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestI Think it is very clear for me now.
Thanks, Tomer
|
|
|
Re: WiiMote example code requestAm 16.05.2008 um 11:03 schrieb nescivi: > WiiMote.start; // start the eventloop > WiiMote.discover; // discover a new device (wait for post about > connected) I tried this several times, with no luck (Dual G5 Mac, 10.5.2). Post window says: /// WII: searching wiimote 1 device added [ a WiiMote ] WARNING: WiiMote disconnected! /// This non-functional instance of WiiMote is in WiiMote.all now. If one tries WiiMote.discover again, without doing closeAll before, it's possible to populate the array with many more instances, all of them pointing to the same hardware device. Why? Pete Moss's WiimoteLib UGens are working fine here, as are DarwiinRemote.app and OSCulator.app (glad they exist since I have the WiiMote device only since yesterday and first thought it was broken). May I ask this question: Is WiiMote from SCClassLibray working at all for anybody (on a Mac) ? Regards Stephan > > 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 >>> >>> On 5/14/08, Tomer Harari <hatanin@...> wrote: >>>> >>>> Hi, >>>> I am looking for some example code for using the wiimote and >>>> nunchuk. >>>> I had luck with Pete Moss's WiimoteLib, but it does not support the >>>> nunchuk. >>>> so, I would like to get some examples of how to tap in to the >>>> accelerometers, and map them to a control bus or use them inside a >>>> SynthDef >>>> with the WiiMote class that comes with SC. >>>> Thanks a lot >>>> Tomer >>>> >>>> sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestOn Saturday 17 May 2008 09:27:33 Stephan Wittwer wrote:
> Am 16.05.2008 um 11:03 schrieb nescivi: > > WiiMote.start; // start the eventloop > > WiiMote.discover; // discover a new device (wait for post about > > connected) > > I tried this several times, with no luck (Dual G5 Mac, 10.5.2). > > Post window says: > > /// > WII: searching wiimote 1 > device added > [ a WiiMote ] > WARNING: > WiiMote disconnected! > /// > > This non-functional instance of WiiMote is in WiiMote.all now. however, if you wait a bit longer, the WiiMote may still get connected. Bluetooth connection setup takes some time, and it is an asynchronous process, so it is possible that setup is still running, while the device is being checked whether or not it is connected and gets disconnected. > If one tries WiiMote.discover again, without doing closeAll before, > it's possible to populate the array with many more instances, all of > them pointing to the same hardware device. Why? the underlying code doesn't seem able to detect correctly that a device wasn't opened properly. It's been a while since I wrote the code, so I don't recall exactly without delving into it again. > Pete Moss's WiimoteLib UGens are working fine here, as are > DarwiinRemote.app and OSCulator.app > (glad they exist since I have the WiiMote device only since yesterday > and first thought it was broken). > > May I ask this question: > Is WiiMote from SCClassLibray working at all for anybody (on a Mac) ? It works somewhat, but not perfect. There is still a known bug that it crashes after a while (at least on one Mac I tried), and it is a known issue as stated in the helpfile that sometimes the connection is not set up correctly. I haven't had any time to look (if anyone has an idea on how to make days longer...) into fixing these problems, though I recall that Pete offered to help iron it out, using the lib he is using instead of the adapted aka.wiiremote code that is used now. BTW, on Linux it is working flawlessly, thanks to there being available a lib with a clean callback api, which was much more easy to interface with. Unfortunately, crossplatform libs are still in early stages, AFAIK... sincerely, Marije _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestHi 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? If you have a way to check it out i would appreciate it very much. thanks Tomer
|
|
|
Re: WiiMote example code requestOn Sunday 01 June 2008 10:50:16 Tomer Harari wrote:
> 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? It should work, as far as I remember. 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 |
|
|
Re: WiiMote example code requesthi marije,
if remember correctly, currently the implementation works perfectly on linux, but not on a mac right? on a mac, i was wondering what causes the lang text editor to become very slow whenever i have a Wiimote attached to the WiiMote class.. any insight would be very appreciated! tom On Fri, Jun 13, 2008 at 6:31 PM, nescivi <nescivi@...> wrote:
_______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestHiho,
On Friday 13 June 2008 14:47:47 tom tlalim wrote: > hi marije, > if remember correctly, currently the implementation works perfectly on > linux, but not on a mac right? yes. > on a mac, i was wondering what causes the lang text editor to become very > slow whenever i have a Wiimote attached to the WiiMote class.. You could try changing the rate of the update loop, i.e. pass an update time interval to WiiMote.start( updtime ); Main difference in the underlying code between linux and mac is that on Linux a library is used which has a callback API, whereas on Mac there isn't such a thing, so an update rate needs to be set to figure out how often to look for data. sincerely, Marije > > any insight would be very appreciated! > tom > > On Fri, Jun 13, 2008 at 6:31 PM, nescivi <nescivi@...> wrote: > > On Sunday 01 June 2008 10:50:16 Tomer Harari wrote: > > > 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? > > > > It should work, as far as I remember. > > 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 _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestHi,
i fiddled around with the update rate and the code, but for some reason that didn't help. perhaps we need to start it within a separate thread? J On Jun 13, 2008, at 9:50 PM, nescivi wrote: > Hiho, > > On Friday 13 June 2008 14:47:47 tom tlalim wrote: >> hi marije, >> if remember correctly, currently the implementation works >> perfectly on >> linux, but not on a mac right? > > yes. > >> on a mac, i was wondering what causes the lang text editor to >> become very >> slow whenever i have a Wiimote attached to the WiiMote class.. > > You could try changing the rate of the update loop, i.e. pass an > update time > interval to > WiiMote.start( updtime ); > > Main difference in the underlying code between linux and mac is > that on Linux > a library is used which has a callback API, whereas on Mac there > isn't such a > thing, so an update rate needs to be set to figure out how often to > look for > data. > > sincerely, > Marije > >> >> any insight would be very appreciated! >> tom >> >> On Fri, Jun 13, 2008 at 6:31 PM, nescivi <nescivi@...> wrote: >>> On Sunday 01 June 2008 10:50:16 Tomer Harari wrote: >>>> 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? >>> >>> It should work, as far as I remember. >>> 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 > > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code requestthanks marije, jan,
i get the same behavior as jan. the system becomes slow as soon as i connect the Wiimote all the best, tom On Fri, Jun 13, 2008 at 10:59 PM, Jan Trutzschler <sc3@...> wrote: Hi, _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: WiiMote example code request |