algorithmic 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:

Views: 1710


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

Comment by Lasath S on March 31, 2015 at 11:35pm

Hey Andy,

Im having trouble with the syntax sending data back to Touch OSC. If I have an led (led4) in page 0 and I want it to turn on. What exactly do i need to type to achieve this?

Comment by Sean Morgan on December 1, 2013 at 11:21am


Thank you so much for the quick response! Setting the toggle to false did the trick.

Comment by Andy Payne on December 1, 2013 at 7:31am

Hi Sean,

I'm a little confused about your statement that each slider is combined into one set of data.  Why do you need to do this?  Whenever you change a slider's value it will emit a message with the name of the slider and its current value.  I think one thing I noticed about your definition is the toggle connected to the reset input is set to true.  This means it will essentially only 'remember' the last message sent to the receiver.  If you change this to false, it will build a data tree, adding a new branch each time a new message is received that contains a new header.  I think if you just change this to false, and then change your sliders one by one, you'll see a data tree build with all of your Touch OSC values.  Does this help?

Comment by Sean Morgan on November 30, 2013 at 3:35pm
Hello Andy, 
I am trying to set up a Firefly definition which uses a set of 5 different horizontal sliders from TouchOSC to control the heights of 5 separate points in Rhino. I have created my own layout in OSC Editor, named each slider, and changed the page from 1 to 0, but I can't get firefly to read the data list. Each slider is combined into one set of data, and it reads the values from the slider last changed. Attached are some images to better explain the situation. Do you know if there is anyway to remedy this issue? Any help is greatly appreciated. 
Thank You,
Comment by Joseph Darling on August 1, 2013 at 9:38pm


Thanks for the quick response. Works like a charm. I don't know why I didn't try that before...

Comment by Andy Payne on August 1, 2013 at 9:27pm
Hi Joe,
You don't need to do anything special to format the data being sent out of Grasshopper. The component will automatically attach the name of the component as part of the metadata. For example, if you connected a single slider whose nickname you had named as "myslider", then the nickname would precede the actual value of the slider as metadata. Try just coonecting your panel to the data input of the OSC sender. You may have to change the nickname of the panel to be the same as whatever UI element your trying to update in TouchOSC.
Comment by Joseph Darling on August 1, 2013 at 9:07pm


I am developing an interactive exhibit and I'd like to have information that I'm seeing in grasshopper be sent to my iPad / iPhone. I have "setup" the OSC sender with the correct IP and port (I see the red light blink on my iPad to show incoming data), though I fear that I am not using the correct syntax for the data input. I've attached an image here for you to take a look at to see how I'm setting up the data. Please let me know your thoughts or how I can get this working.

The exhibit I am working on is one of the six student exhibits to be held at the ACADIA conference in October, so you will see it in action then.




- Joe

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.


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







  • Add Photos
  • View All


  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service