Grasshopper

algorithmic modeling for Rhino

hello everybody!

im new to firefly and i want to get into this interessting field of grasshopper.

in the beginning i want to link my iphone to grasshopper to control a slider.

how can i do this? im sorry, but i couldnt find a tutorial dealing with this topic...

what do i need? how can i connect? is there a tutorial? are there example files?

please help me out!

thank you so much!!!

max

Views: 1936

Replies to This Discussion

To expand a little bit.  There are a lot of different apps you can use that can communicate with Grasshopper over UDP (http://en.wikipedia.org/wiki/User_Datagram_Protocol).  One that is very flexible is called TouchOSC (http://www.hexler.net/software/touchosc).  

Basically, what TouchOSC does is sends a message over UDP, but it's formatted according to the OSC specification (http://opensoundcontrol.org/spec-1_0).  Firefly (and Ghowl) both have UDP/OSC receivers (although they work slightly differently).  Basically, you have a sender (your phone) and a receiver (your computer) and the sender has to know the IP address of the receiver and they both have to know which port they want to communicate on.  The port can really be any number you want.  So, when launching the TouchOSC app, you need to go into the settings and specify the IP address of your computer and the port you want to use.  Then, just pick a layout and start moving sliders to send the data.  On the Firefly side, just drop a OSC listener component onto the canvas and specify the same port number you put into the app.  Then, connect a Timer component to the OSC listener to get it automatically refresh at a given interval.  The data should come over as a data tree, and you can extract the header of the message, or the actual value using the standard Data Tree components.

The one thing you may want to know is that some networks will restrict communications over UDP (particularly those at schools, or other institutions).  I would recommend starting out using your home router, which hopefully doesn't have these restrictions.  If you do want to use it at a school, you may need to create an ad-hoc network and make sure your phone and computer are both on that same network.  Other than that, it should be pretty straight forward.  Hopefully this gets you started.

Cheers,

Andy

thank you very much! it works great!!! is there something like osc channels, similar to ghowl? how do you extract the channels? is the firefly osc reciever faster than ghowl?

No, there's no OSC channels component (that's only in Ghowl).  I don' think Firefly is any faster than Ghowl (in theory they should be the same... as the Firefly component updates based on the threaded GH Timer, which theoretically is trying to fire as fast as GH can run).  I think the Ghowl version has a built in timer, and I'm not sure how it compares to the GH Timer... but they're probably close (if not the same).  When you say extracting the OSC channel... are you talking about the metadata attached to each incoming value?  Because the Firefly OSC listener works slightly differently than the Ghowl version in that it stores the incoming data in a dictionary, where the metadata tag is stored as the Key, and the Numeric value is stored as the Value of the Dictionary.  Basically, it just outputs a datatree structure where each branch has a unique channel (a new branch is only added if the incoming metadata doesn't already match one of the keys stored in the dictionary).  So, you can easily just use the standard data tree components to retrieve either the metadata tag or the value from the datatree.  Does this make sense?  

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service