Grasshopper

algorithmic modeling for Rhino


Hello everyone,

I'm new to grasshopper and I'm trying to hook up a midi controler in order to be able to control some sliders.

I've seen some posts about this topic but due to my lack of programming skills, I haven't been able to connect my controller to GH... Where should I start?

Best regards.

 

Camilo

Views: 5801

Replies to This Discussion

I managed my MIDI by now, I'm not sure how quickly I'd do it but in general, yes.

I just got my CME Bitstream 3x (similar to a BCR 2000) midi controller working smoothly through Pure data, gHowl, and into Grasshopper. It's a bit messy looking but I can tweak all 40+ physical input and transmit simultaneously without losing values. If you still need help, I can post my files. It should be easy enough to modify them for any controller.

Well done Mark.

I'd love to have a go at it, if you could post the files / instructions please,

as I still have not got round to sorting my lpd8... (distracted with massive kites as ever)

http://www.grasshopper3d.com/forum/topics/midi-and-grasshopper-wind...

Check out this link to my discussion. My process and files are at the end of the thread.

Congrats! Sorry I was a bit slow,...   got me interested in pD even if it's just to see the difference ;)

Marks PD work looks like it should be quite easy to manipulate ... however I still haven't figured how to read my lpd8 with it yet... ( I think that's close to the terminology... just started 20 mins ago)

your processing sketch can see my lpd8 and I have installed midibus promidi and (was UDP there already?) libraries... but I'm not sure yet... quite what the output file is doing or how to read it in grasshopper... tried to change the ip send address and ports but.. I'm not sure of the correct configuration there... 

Am I right in thinking UDP is meant to be broadcast data on a certain port and fixed ip address?

Roderick, I not sure I follow you exactly, but here is what need to try:

1. Make sure your device is on, and physically connected (mine was through USB).  Open Pure Data, the PD file I attached, Grasshopper and the GH file.

2. There is a drop down menu at the top of Pure Data that reads "Media".  Click on "Midi".  If your device connection is working, you should see it show up as an option.  Set the device to MIDI in.  You don't really need to set a MIDI out unless you are planning to send messages back to the device (not sure why you would want to).

3. The boxes labeled "ctlin" with a number are the Control Change in's.  In Pure Data go to the "Edit" menu and click on "Edit Mode". Click on one of the "ctlin #" boxes and change the number to match the Control Change number of your physical controller.  Mine starts with 5 in the upper right and goes to 65.  Each control change number shows up on the display window of my device when I use it which made it easy.

4. Continue this process for all your controls. Delete the unneccesary "ctlin #" boxes by selecting them with a fence and clicking "delete".  When you hover over one of the wires you should see and "x".  Press the "backspace" key to delete it.

5.  Now go down to the "pack f f f ..." box.  There should be as many "f" or "floats" in that box as there are you number of controllers.  Delete the remaining "f".

6.  Next look at the box below that reads "send /0...".  Make sure to keep the "/0".  If you delete the "/" it will crash Grasshopper.  Change the number "5" to match your first control change number.  Leave the $numbers alone.  You'll want to keep them sequential.  Continue change the control change numbers to match all of yours.  The $numbers should match the order in which you wired each controller to the "pack f f f..." box.

7.  For testing purposes hover over the input on the upper let of the "print" box and connect it to the out of the "send" box.  If everything is mapped correctly, working properly, and you go back to the "main" PD window you should see a list of all controllers will a value (0 to 127) next to it.  As you turn a knob, the value next to the control change number will increase from 0 to 127.  This will give you a good indication of whether or not everything is working and if you mapped it correctly.

8.  Click on the "connect OSC" box.  You might need to exit out of "edit mode" and back to "performance" mode in the PD canvas.

9. Go To Grasshopper.  If everything is working you should see the Panel read "new message" when you turn a knob.  At this point it should be pretty obvious how to modify the Grasshopper components.  I've tried to keep everything as consistent as possible.  Since I filtered out the "/0", the "explode data treat" component starts at 0, the numbers are shifted down by 1.

I just left the IP address, etc. alone on the gHowl UDP component.  Just make sure the "port number" matches the OSC port number on the send in Pure Data. If you crash, you may need to choose a new number.

Hope that helps.  Let me know if you have any questions.  If your computer is not recognizing your midi controller, you may need to install "Midiyoke".  I did at first, but it turns out I didn't need it after all.

Best of luck.

Mark you wonderful wonderful man you !!!

yeeeee haaa 32 knobs mapped for the LPD8.

Christian, In order to get the LPD8 program shifting to work for 32 (4x8) cc channels, you need to start the LPD8 editor software , connect to the LPD8, you now have to save and upload 4 presets. Select the preset number you want to edit, start with 1, for each knob k1 to k8 click the red arrow beside the cc value and assign the cc channel you want, I started 1 - 8 for preset 1, set the max and min values for each cc number.

Save the preset and upload preset 1 to the LPD8.

repeat for preset 2, 3 and 4

or use the files I'll upload in my next post... the first LPD8 editor file is attached to this post.

Delighted thanks dudes

Attachments:

Thanks Roderick.  I was afraid of coming off as a lunatic for posting such a long winded reply.  Just wanted to save some people some time and trouble with the process.  For all the help I've received, it's nice to be able to give back something.  Glad you were able to get it to work.  Let me know if you have any ideas on simplifying the process.

I'd love to learn to program but don't have an eternity to learn it.  It would be awesome if gHowl or Grasshopper could just read MIDI directly.  I could see having a component that you click on, set your midi channel, control change number, and even how the 0-127 values would be mapped.  Then the wire could be attached to an "input" on the slider and override the controls if you turn a knob, etc, but still have the slider available in case someone doesn't have midi.

Anyways, post some work once you get it up and running.  Love to see what you do with it.

Thanks again Mark,

more good ideas, yeah I've asked (think it was Ghowl) directly about possibly developing a midi component. Glad I managed to get a work round though.

Thanks for your ideas also on using an LFO or (HoopSnake LFO simulator in GH) for wind simulation on the kites... I'll look into that.

Attached are the three remaining presets for anyone else wanting to use an LPD8 (great wee solution) These presets need uploaded to the LPD8 with its editor software.

One thing I have noticed using this method... If I turn the knob rapidly to 0 or 127 the value read in grasshopper often stops reading short of the final number.. e.g. at 3 and 124

Turning the knob slowly gets you the 0 and 127. It may be that there is no final refresh / new data being seen from pure data due to GH PD handshake timing?...

I wonder if there is a way to delay or add an extra packet send after ~0.2 sec quiet in PD? It could be sent after a last data packet leaves PD? hmmm, will investigate if this is a nuisance in use.

Thanks again Mark, really helpful

Attachments:

I just bought a midi to usb cable and was able to connect Grasshopper with my digital piano realtime through a simple VB.NET component, no need for any other intermediate software. I used this library http://midiservices.codeplex.com/ (but there are several others).

If there is any interest I can post the definition.

would be cool.  Seems a lot of people would appreciate being able to go straight into GH with this.  Unfortunately I have no such hardware, so I don't spend too much time on this topic...

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