Page 1 of 1
Plugin to create sounds using mathematical
Posted: Sun Apr 12, 2015 7:10 pm
by Maryirita
Hello users flowstone, I am writing because I need your help!
I'm programming a plugin to emulate sounds of splashing and rain sounds based on a mathematical model that exists on the bubbles.
I have the mathematical model written in ruby but I have problems handling real time because this multiply several equations including the amplitude of the oscillator. For now I got my output waveform decay exponentially but does not sound like a sound drop

Les attached the program and would appreciate very much any advice, post or page related to this topic. Also if someone know how put a button for start the sound output (DS out) from the GUI. This project is very imporat for me! I'll be waiting any questions. Thanks
Re: Plugin to create sounds using mathematical
Posted: Sun Apr 12, 2015 7:38 pm
by KG_is_back
the problem you have is obvious. the counter "n" is reset every frame. it should continue counting in next frame.
put following code on top of your ruby code:
and replace any "n" with "@n". And delete the "n=0" line, which resets the n at every new frame.
You will hear the bobble quite clearly.
Even better solution would be to move some parts of the code from ruby to DSP code and use streams. Namely the part that fills the buffer.
Re: Plugin to create sounds using mathematical
Posted: Sun Apr 12, 2015 11:22 pm
by martinvicanek
Hi Maryirita, and welcome to the forum! Your droplet sound model seems to be based on physics. Do you have a reference?
As KG pointed out, much of the calculation would actually be better performed in DSP code. You could even enable keyboard control as a trigger and use pitch and velocity parameters to manipulate the sound.
Re: Plugin to create sounds using mathematical
Posted: Tue Apr 14, 2015 12:42 am
by Maryirita
Thank you guys, I did what KG said and it works well the problem now is that I must think of a way to restart the time and sound several drops and at different times, any ideas? .
martinvicanek I am relying on a study of Kees van den doel called PHYSICALLY-BASED MODELS FOR LIQUID SOUNDS, you can find it on the internet and in addition he programmed in Java, I send the link of the application to see it, I hope you do not have problems with java updates. I wanted to say that I tried to pass DSP but as I am new to the software not know how to handle real time and as I said before I have to multiply the time variable in the equations. I appreciate any help!
the link of the previous study :
https://www.cs.ubc.ca/~kvdoel/icad2004/simulator/
Re: Plugin to create sounds using mathematical
Posted: Tue Apr 14, 2015 1:30 am
by KG_is_back
Hi, I ported some parts of the ruby code to streams. Ruby now only calculates the "constants", and the sound is actually created in streams. I hooked it up to poly streams, which can be played using midi. Basically every time you hit a key, the bubble pops (Flowstone has build in "midi keyboard" which when is on, you can use your computer keyboard as if it was midi input).
To make many bubbles drop, you may use ruby to create randomly timed midi events.
Also in your algorithm I was a little puzzled how "n" is scaled. You your original schematic "n" increments in 1/buffersize and I saw no code, that would scale other parameters according to a time. Sample Rate should dominate somewhere in the code!
I hooked up the schematic that "n" is incremented by 100/SampleRate, because that sounded about right, but I was basically guessing.
Re: Plugin to create sounds using mathematical
Posted: Wed Apr 15, 2015 6:59 am
by Maryirita
KG_ Thank you very much !,
I just switched to "n" steps were 1 / samplerate and within "x" multiplied by 2 * pi * f. Now to generate several bubbles I added a slider that allows me to select the number of bubbles that want to create and according to that generate that amount of midi events with "for", within that "for" are generated radius and heights randomly for each bubble is being created, but do not know how to send the data to the dSP for bubbles at different times are triggered. this is what I tried. KG really appreciate your help.

Re: Plugin to create sounds using mathematical
Posted: Mon Jun 01, 2015 4:12 am
by Maryirita
Hello guys ! Here me again
I really need help to complete this plugin. There is a mathematical model based on the physics of bubbles in the water and what I need is to apply for:
1. Create sound of small objects falling water (like a stone and a coin )
2. Create sound of rain
3. Select an audio, spectrally analyze and process through physical model for achieving change those specific characteristics of the selected file.
The main problem is that the sound does not sound real. I really need your help, Any ideas, collaboration, suggestion is welcome, I'll be careful. Attach the current file. Thanks a lot !
Margarita.