Grasshopper

generative modeling for Rhino

Demo using TouchOSC (mobile phone app) and Firefly (a free plugin for Grasshopper) to control LED's and motors.

More information at: http://www.liftarchitects.com

Comment

You need to be a member of Grasshopper to add comments!

Join Grasshopper

Comment by Andy Payne on March 8, 2012 at 4:04pm

In the video above, I have sliders with different names.  The way the OSC Listener component works is that it receives a message and it parses out the name.  It then creates a data tree using a dictionary structure.  If the dictionary contains a name, then it just updates the value associated with that key.  Else, it adds a new entry into the dictionary, using the name as the key and then the value.  So, in the video above, I just created a data tree by sliding (or toggling) each of the elements.  Then, I can go into the tree and extract each value.  Since, it has the name associated with it, it's easy to know which should control what.  Then, I just send the values out to the Arduino using the Uno Write component.  Pretty simple actually.  In my post below, I also tried to explain how to send Grasshopper data back to the phone.  It works well with lables, faders, toggles, LED's (which is like a little toggle in the Touch OSC interface) etc.  I haven't tried all of them, but the communication can definitely work both ways.

-Andy

Comment by Mårten Nettelbladt on March 8, 2012 at 3:56pm

Thanks Andy! This sounds like fun. What elements on the phone can you control? Is it just LEDs and labels in TouchOSC or can you go deeper into the phone itself? (!) I got the TouchOSC set up today and it works just fine. http://www.grasshopper3d.com/video/touchosc-firefly-grasshopper-my-...  It's a lot more responsive than the nunchuk. What are you using to sort between the different inputs in your test above?

Thanks for adding this stuff in FirFly! TouchOSC is a great "hardware" slider.

Best /Mårten

Comment by Andy Payne on March 6, 2012 at 7:20pm

Hey Marten,

Good to hear from you.  Your absolutely right... in this example, I'm only using the arduino for actuation (which means I'm only sending data from the phone over to Grasshopper).  However, it's definitely possible to reverse the communication flow and send slider data back over to the phone.  I just tested this out and it works pretty well.  You just need to make sure that the OSC Sender component uses the local IP address of your phone and that they're on the same network.  In order to control one of the elements on the phone, you need two things.  One is the name (eg. fader1).  The other thing is the page number that the element is on.  Most of the default layouts on the TouchOSC interface have the first page as page number 1... however, the OSC Sender component formats the data so that the number 0 comes first (before the name)... so if you connect a slider named fader1 to the OSC Sender, the output message would come across as 0/fader1.  Thus, it's probably a good idea to create your own layout using the Touch OSC software (available at www.hexler.net) and make sure the element you want to control is on page 0 (not page 1).  Other than that... it works really well.  It probably sounds somewhat complicated, but I had it up and running in just a matter of minutes.  Let me know if you need any more help.

Cheers,

Andy

Comment by Mårten Nettelbladt on March 5, 2012 at 4:19pm

Great test Andy! The Arduino is just for output here, right? If I just wanted to hook up the TouchOSC with some sliders in GH, does FireFly take care of that directly or would I need some extra software like OSCulator? Thanks!

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service