Import a wav file into Grasshopper

Is it possible, and how, to import a wave file, or mp3 in Grasshopper?
I know that in Firefly there is the component “Sound Capture”, but it seems it is only from an input like a microphone. What i would like to do, is import my wave file. Is it possible?
Thanks so much! :slight_smile:

See attached (122.8 KB)

1 Like

Thanks so much, i don’t really know how to use the definition, i just come to put the toogle “get wav file” to “true”, then, it proposes to import a wave file, i chose a wavefile, and then, my compueter crashes.
Is it the good way? I don’t know if i have a problem with my Rhino 7, licence commercial, because i tried this morning to download Firefly and since then , each time i try to use Firefly, my Rhino crashes.
I have a very good computer, and Windows 10, so i don’t know what happens…

In general reading a big wav is a bit slow (or very slow). Try a small one for a start (around 300-400 kb) and see what happens. Shown a 500 kb test (a ring sound, that is).

or a 700 kb one:

BTW: I don’t use R7 (for the very limited usage that R/GH have in practice R5 is all what I need).

BTW: The attached is waaaaay faster (and way less accurate - but who cares?). (117.2 KB)

Using the above read the Pink Panther wav (Note: no R channel on that one)
PinkPanther30.rar (877.6 KB)

The PP thingy looks like:


Mosquito plugin can read audio files I believe. Food4Rhino currently down for maintenance though.

1 Like

Hi Peter, thanks so much! :slight_smile: Yes, it works, i have the message that “missing the right Channel”. :slight_smile:
But, what i would like to do, is that in Grasshopper, my wav file is playing, and, due to this, i can see various shapes, evoluting in real time.
It seems we can do this in Firefly, but i don’t know why, everytimes i use it, my Rhino crashes.
I would like to do something in this idea:

But, instead of having the music by the mic input of the computer, i would like to import my wav file.
I don’t know if we can do this in Grasshopper?
Thanks so much! :slight_smile:

Hi Martyn, thanks so much! :slight_smile:
Yes, since this morning, it seems that Food4Rhino is in maintenance.
I will look at what is Mosquito.

Well … in the first C# posted checks for both L/R channels are MIA. Use the Read_WAV_Simple instead.

For the other thing … indeed you can do it (but why? I can hardly imagine any rational reason - unless you are after some freaky kinetic installation [elastic membrane + push/pull actuators] and the likes). I’ll see what code changes are required for that (but I can’t estimate/promise any ETA).

1 Like

Hi again, Martyn, thanks so much.
I downloaded Mosquito in another website, but, in the folder, it is written that we have to put all the folder “Install ALL of these in components folder” in the folder in Grasshopper that is called “Components”.
As you can see in the screenshots hee, this is what i have done, and i closed my rhino after, and i opened Rhino and Grasshopper, but, Mosquito plug in does not appear.
Do you please know, why? :slight_smile:
Thanks so much! :slight_smile:

Hi Peter, thanks so much! Yes, i would like to do this, in order to try some kind of experimentations in strange shapes! :slight_smile:
Thanks so much! :slight_smile:

You mean to do it in real-life? If so the components for that are NOT simple things NOR the whole installation could be a cheapo thingy.

And … well … assume that you do it > who could tell if the vibrating membrane actually follows the song/sound? Not even HAL9000 (in his good/sane days).

1 Like

Hi Peter, i understand!
Well, i would like to use the same workflow, but, with easier components in Grasshopper, like Freeform for example. But what i would like, is to be able to show that as the sound comes from the computer as a wav file, it can generate interactive shape, i give you below another example in youtube, the tutorial with the sound begins at 16 minutes 43, before, it is about animation:

Thanks so much :slight_smile:

Did you unblock all the files before you copied them into the Components folder? Right click the .zip file and select Properties then look for the “Unblock” checkbox. You can either do this once on the .zip file or on every file if you have already extracted them and copied them.

I have mosquito working and it has an example file that can change the radius of a sphere according to a .wav file but it just takes the peaks of the sound and doesn’t respond to every part of the soundwave. (presumably because that would be too slow)

Another example let’s you use a slider to move through the .wav file to effect the sphere radius so you could then animate the slider but this method is not for real time animation.

Another example draws a polyline that represents the .wav file.

You might be able to use it to do what you want

1 Like

Well … not my game I’m afraid: I don’t use components nor add-ons of any kind [except K2]. Anyway … just for the record … I have added a 3rd C# that does the preparation for some Graphs (play with the pos/range sliders and animate something): (123.1 KB)

So far only a quite “basic” Mesh result is added.

But … if we engage K2 using a “similar” Mesh (and add suitable anchors, fixed and/or elastic cables et al) … a far more challenging result could be on hand. See K2 in action for an increasing N of random anchors on a random mesh (not related with your case - but you can get the gist I do hope) :

BTW: If you are after “challenging” Topologies (like Graphs, Meshes, Trusses, Particles, Kinematics, cats, dogs etc etc) you don’t need a wav file.

1 Like

Hi Peter, thanks so much! I am interested in all kind of shapes, so, it is very interesting! Thanks so much! :slight_smile:

Hi Martyn
Thanks so much, i unblocked azll, and now it is ok! :slight_smile:
Just that sometimes, even if i have a good computer, the sound has interruptions with little noises, but it is not very important for what i want to do.
Thanks a lot! :slight_smile:

1 Like

Found a couple of minutes more for that one: get the trad update (added a thing, fixed another blah, blah). (122.1 KB)

BTW: Are you an artist or you are in the AEC sector?


Hi Peter, thanks so much! :slight_smile:
What is the “AEC sector”?
Yes, i am an artist :slight_smile:
Thanks a lot! :slight_smile:

Architecture, Engineering and Construction (my trade).

Some minutes more spend on that one: (129.2 KB)

Next update (V1C) would implement K2 for a vibrating membrane result.

I.e. using the option for a Mesh + perimetric vertices as anchors (on fixed cables ends) + “mid” Mesh vertices as anchors (on variable strength cables ends) => some sort of a freaky LOL installation.

1 Like

Hi Peter
Thanks so much :slight_smile: