I rarely ask questions on this majestic vvvvorum since most questions can be answered by searching ;) Im a lurker.
Im trying to translate FFT Values from 4 Pianos to 4 Electromagnets.
The magnets are triggered with a mosfet via Arduino. The magnet strengh can be controller via Pulse Modulation. The faster the Pulse ( or a constant 1 ) the stronger the magnetic field. So i need loud sounds in any frequency to be translated into a fast Pulse, lower volume = slower pulsing
The music is a piece by john cage, so theres really many random notes. Very high, very low sounds that slowly descent into silence.
I used the Meannode to get an average value for all tonal frequencies.
I have had no possibility to test this with the magnet yet, but will be able to test it later today.
The main Problem is the fact that the “period” on the LFO im triggering to creat the pulse is constantly changing. I have added another LFO with a queue node to keep it from changing all the time.
Im not sure if a LFO is the right choice to create a Pulse fast enough for a magnet, but im not aware of alternatives and would welcome help on this :)
Hey tonfilm. Thanks for you reply ive been butchering you 4Channel FFT Nodes already. The decay and Multiplier values will give me a good chance of adjusting the FFT analysing to each piano input. RMS Seems to work very well too.
Atm im at a 0.0001 LFO Pulse. With this Interval it will not pulse but turn the magnets completly on. Im not sure if this is caused by the framerate limit or if this is how the magnets usually react.
If I change the Background FPS on the Mainloop node, will this effect the pulse speed i can send into the Arduino board?
What would be the maximum Background FPS I could set up?
the Background fps only takes effect when vvvv is not the application in the foreground, means another application (for example notepad) is selected in the taskbar. i think this is not what you are looking for.
use the timing node to check how fast vvvv runs at the moment. as soon as you open a DX9 renderer it will drop to 60fps unless you set the presentation interval of the renderer to immediately.
i think you have to program the arduino to generate the pulse wave and then just send a value from vvvv to tell it how fast it should do that.
Be sure to use AnalogOuts on the Arduino, if you don’t need too many of them and if you want to have an easy job doing this. Emulating PWM in vvvv can be done with Kalle’s PWM module but, at least in my experience it’s not the way to go with an Arduino and its DigitalOuts (the resulting PWM on the Arduino just isn’t fast enough to be of real use), the PWM part must be running on the Arduino.
Failing to provide as many built-in PWM Outputs as needed, you could go for either a bigger board (the Mega offers more), a Wiring board, or employ your own custom sketch for turning DigitalOuts to PWM (tricky), or use some smart shift register solution (http://www.elcojacobs.com/shiftpwm/) or, even better, hook up a PWM chip like TLC5940 (Google Code Archive - Long-term storage for Google Code Project Hosting.). The latter is recommended. See also karistouf’s ArtNet arduino set v2 in the contributions section.
For starters (and maybe solutions), check BasicMata Arduino Interface or ArduinoFirmata to make vvvv talk to the Arduino. Thanks to the folks behind these modules, btw.! A future project of mine needs some 100 PWM Outs, 12V @ 1A load each. So far, quite demanding, at least for me. So, post your results here.
hey, thanks for the input, ive been able to get it running yesterday evening :)
Tonfilm:
Sadly i have no idea how to programm anything on Arduino.
What i would need to do is programm something like an LFO onto the arduino for each input and let it send PWM Out by only giving it the LFO Period speed via VVVVirmata.
If i have 60FPS on VVVV would i get a max Pulsespeed of 1Second/60Frames = 0.0166~ ? I will try if this pulsespeed is fast enough to do the job and then reconsider programming/sketching the Arduino for it.
Patrick:
i have got it running by sending Analog pulses to the pwm outputs of the Arduino with VVVVirmata.
Basically, you want high RMS to generate high voltages (0 - 5V). The AnalogOuts on the Arduino provide (PWM’ed) voltages between 0 - 5V (in theory), that’s what you need for your magnets or a circuit/network driving them. When your Arduino features as many factory analogue Ins & Outs as you need for your project, what do you need additional PWMs for? Send your mapped values to a vvvv-Arduino setup of your choice (see my post), that’s all.
Maybe I am just terribly misunderstanding you.
I helped building an early prototype of http://dreipuls.de/product/rima/ for a trade fair and streamed pure on-or-off-bits for some 120 individual leds. That meant calculating 8 packets or more each vvvv frame and sending it to a custom programmed atmega.
wasn’t the smoothest blending naturally, but not totally punk either.
it was basically dreipuls’ prototype lamp:
atmega on a custom board and a whole bunch of ics in modules to address and decode the LEDs status. connection was by usb, which proved to be a pain.
If you don’t mind, please be more specific about the Atmega, the ICs and the PWM part (if done inside of vvvv).
If smooth dimming, latency and scalability are paramount, my research (so far) boils down to a chain of a microcontroller board of your choice, be it Wiring/Arduino/whatever interfaces well with vvvv, one or more TI TLC5940 (they can be daisy-chained and provide 16 outputs each) and maybe some circuitry to drive higher loads (the latter may be ignored for now).
Our great @karistouf developed the ArtNet Arduino Set (see contributions), allowing an ArtNet connection/communication between vvvv and an Arduino equipped with a standard Ethernet shield. The TLC5940 can be driven this way. Pretty much the way to go on a large scale approach.
Any detailed thoughts and hints appreciated on that matter (and generally, of course). Given an affordable solution for a multi PWM controller, that can be directly accessed in vvvv, we might as well fuggedaboutthat completely. Alas, there’s no such thing (yet).
So for now im able to trigger all 4 magnets with Vvvvirmata. Im not able to dimm their power with my pulses properly but this has to do for now.
Ive never programmed anything for arduino and so i wont be able to program something quick to send a frequency value to arduino and let it do the pwm for me. Should have opened this thread much earlier since my deadline is next week. ;) Maybe i will try to get it to work properly after the concert…
The 4 magnets are all working, being triggered and all, and Kalle LFO (pwm) is doing some nice pulsing to the ferofluids. I will post some pictures of my results.
Just an idea: Use the output of multichannel soundcard instead of arduino, generate waveform inside simple software synth VSTi. For amplification maybe just two large audio amplifiers? How strong are your magnets?