Grasshopper

algorithmic modeling for Rhino

HELP!!! Using sound in GH..Can trade fabrication for code/definitions!

Okay, so I'm just really starting to learn GH but I had a pretty specific reason for learning it. I want to import sound data and generate 2D & 3D form from sound. I've seen a couple tests using live input but I have no clue how to begin doing this. I've read about using Processing and have even tried something with Processing but it didn't work for me. 

I haven't had any luck finding step by step tutorials on inputing data with the 'read file' tool either. I have a feeling that just knowing how to import data would help a lot but the only examples I've found didn't work for me.

I'll be honest though, when it comes to programming and code, I'm an idiot and at a very beginner level. However, once I have working code to study and play around with, I pick up pretty quickly. I've done this with some of the GH definitions I've found and had some good results. 

Basically, it's been very difficult and frustrating since I've spend literally 4 weeks trying to figure this out. Like I said, I'm not good with code! Fortunately I've had a little bit of help from the GH community and am very thankful. With any luck, maybe some other people on here would be willing to help out a couple students working on a thesis project? We don't have money but could exchange fabrication services for your help with code or definitions. We have access to a 3 axis CNC mill, Laser Cutter and FDM printer.

Thanks for your time (and hopefully your help),
Matt.

Views: 1175

Replies to This Discussion

Hi Matt,

you have basically two options:

1) Write your sound data to a text-file, then use a File Watcher in Grasshopper to import the data. Whenever the file changes, Grasshopper will detect this and update the imported text. How you then use that text to generate your shapes is your business.

2) Use a VB or C# script that 'listens' to a port or USB apparatus or..., then take appropriate action. This will require a lot of coding.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David,
Thank you for your reply.
Unfortunately I have no clue how to do either of the things you're suggesting. I can get sound into a deliminated text file but do not know how to use that in GH. I have not heard of 'file watcher' for GH. Probably the closest thing I've seen is 'read file' but have had no luck on finding out how to actually use that. Plus, it doesn't help that trying to add a string to something like 'read file' just crashes GH & Rhino.

It seems like Processing is the best way to port in live sound data or to create more complex data sets but I have had no luck with running any Processing scripts I've found and read about.

Matt
Matt,

if you have a deliminated text file (use a .txt or .csv extension) just drag+drop it into Grasshopper. A new File Watcher should be created that points at the file.

You now have your file contents in Grasshopper, but where you go from here is up to you. You'll probably want to convert your file contents from text into numbers. And you'l probably want to split the data with the delimiter character (space? semi-colon? comma?) first.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David,
When I drop a file into GH it just crashes the program. Again, I have no idea how to use the data file to do anything in GH or how to split the data. It seems that it is common knowledge in this community because I have not seen a single tutorial on how to do this. Do you know where I could find such information?
Thanks again,
Matt
It crashes? How big is the file? How does it crash? If it's a small file, can you upload it so I can try here?

Splitting a textual string of characters (a bit of text is called a String by programmers) into component parts requires custom programming as there are very few String modification components.

So this will require you to either write some VB or C# code, or make sure every single data entry in the original file is on its own line, then you can just read individual lines and convert them into numbers using inbuild functionality.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
yeah, GH & Rhino crash every time I try to add a 'string'...I was going through some tutorials recently and couldn't get through them because it kept crashing when I tried to edit the string list.

the file I was trying earlier was 156mb...I guess too big for GH. I tried again with a small file under and it did import fine. I wouldn't even know where to start with writing code for Rhino. I did see in the back section of one of the tutorials has some info on VB and .Net coding in GH. I doubt I'll be able to make any sense of it though ;/ haha...

attached is the file I am loading. it has 3 fields- time (in ms), left & right channels (stereo sound).
Attachments:
Have you tried to use VVVV to analize audio in real time?

HI David , I am looking to do something the same , as of now I have a formula of the harmonograph working in grasshopper but I like to have real time change as the sound is pickup from a midi player or similar. How is it possible to use VB or c# script to'listens' to a port ? Thanks!

I guess you should check a FIREFLY plugin, it has some options to work with sound data

Hi Victor, do you know how I could link sound capture into my grasshopper files?

On the file i input manually the formula for 2:1 halftone . I have 2 questions

1) Can I do an animate shape change from one note to another? eg. C to G note

2) How can I pick up sound from a microphone with firefly and in put inside this file?

Thanks!

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service