has anyone done any work on emulating (nautical) breaking waves?
Waves observed in liquid, in a string, in a drum head etc (material waves) are functions of time and space while audio are only time-dependant. As a result you can derive audio signals from a material wave for by fixing a position and observing a property of the material wave at this dertermined position over time. For example, let's imagine a little fishing float maintained that would "freely" slide on a vertical rod maintained in a fixed position in water (in order to get rid of the space variables). The float would go up and down over time as the waves come and go, and the vertical position signal obtained would be a an audio signal (provided it's mean over time is zero), also all the derivatives of this signal accompanied by frequency multiplication and amplitude modifications, but also pressure or desity measurements or whatever you want. This is a way of thinking the link between material waves (the ones you draw, with the horizontal axis representing space, with a freezed time) and strictly time-dependent signals (very near to audio signal, just a matter of being "centered" on the x axis).
This proximity allows for "sonification" of intrinsically non-audio phenomena, like "hearing a black hole squeaking" etc.
Sorry, now that I'm reading back what I've written I feel like all this is probably obvious to you, or simply useless.
Nau
has anyone done any work on emulating (nautical) breaking waves?
As to an audio wave not being able to curl back, it can if the wave form is looked at as the sum of 3 wave forms where the value between t(or x)=a,b,c, or d are flattened to 0. So the audio signal is not one osc~ but rather 3 truncated ones then summed [+~].
At least that would represent (visually) what a nautical wave does.
Which is why I am so intrigued. Nautical waves "do" it. But have not seen nor heard audio waves do so.
sample counter
@gusgus Generating square waves can bedone with [sgn~], it turns positive signals into 1 and negatives into -1. Now, combining this with [osc~] will get you square waves with a consistent pulse (also, [block~] can change the size of samples in your canvas, so it might be worth having a look at that]. In addition, some pretty easy maths can be done to get the square waves between 0 and 1. This is a screenshot of pd code to create a said square wave.
I know this is not exactly what you're looking for, but hopefully it's a starting point and you will be able to figure out the maths you need for the rest of it. Also, code was uploaded in the link here. square_waves.pd
oscinv~: osc~ but with the concavity inverted
(First, thanks, @seb-harmonik.ar for the tip. Really appreciate it.)
Originally I thought of doing this just as sort of challenge, to see if I could get it worked out and thought given the current pantheon of wave generators perhaps we could use another one.
What it does is invert the curvature of the osc~ wave form so in a quadrant of the wavelength where it normally curves down, here it curves up, and vice versa for the other two quadrants of the wave.
(more pics below)
It's accomplished by aligning the original osc~ with two square (phasor~) waves: the first to get the shape right (one wavelength for each quadrant of the original wave (so 4x the freq) and a second square wave to shift the wave up and down in the quadrants that need it.
The help file is setup to allow you to hear the difference between the osc~ and the oscinv~. (Note: if you change on the fly, the table does not write properly (i think (unless someone can tell me otherwise) because of the discrepancy/lag between changing the frequency value and the writing of the table).
The resulting tone is Very different than the original pure osc~ tone and it seems to me it has some sort of resonance(?).
If not usable, I hope you enjoy the thinking that went into it.
(It was a helluva of a lot of fun to work on. *Once I got the sucker! ).
Peace, happy pd-ing to one and all.
Sincerely,
Scott
p.s. oh, it has one inlet (frequency) and one creation argument (also frequency) and sends out a ~ signal.
p.p.s my thinking is those who make and/or use synths (esp.) might have some use for it.
Pduino + Arduino Output to Pins
Unfortunately, snapshot~ doesn't seem to send data at a rate which enables clean signaling of arduino pins. When it comes to audio anything, I find that outputting signal is necessary, as outputting control values just cannot keep up with audio. If you are looking to make a square wave generator that is controllable from puredata, the best way that I have found to do this is by using a combination of arduino, a DAC chip and an op-amp chip. Also, you'll want to use at least a 12 bit DAC, such as mcp4921 or mcp4725, as 8 bit DAC lacks the ability to tune the output fine enough to stay in tune with standard tuning. For opamp choices, you can pretty much take your pick. They all do pretty much the same thing, though you will find that every opamp has it's own unique sound quality. I really love the gritty sound of the CA313. A very good and popular sound for opamp VCO is the tl072 or tl075. There are tons of schematics out there for how to configure a square wave vco with opamps. You would just modify the components to fit the output of your DAC.
Next, you would send your controller values from PD to the arduino and have some code in the ar'dweener to handle communicating with the DAC. You can then add all sorts of fun stuff to your board like digipots, opamp buffers, VCAs and so on to make envelopes, LFOs etc.
If you don't want to track down additional chips (usually ordered from china being the only way to find them, cheap though they tend to be,) but want to have square waves being output directly from the arduino, then you would still be better off having pd send control values to the arduino and then let the arduino handle the signal generation to it's pins. For this purpose, you may want to look at the tone library or the mozzi library. Teensy boards have some expanded audio capabilities as well, but teensy boards are a bit expensive for my taste, as you can get a freakin raspberry pi with a full linux operating system on it for a fraction of what it costs. Still, teensies are great and extremely handy for these types of applications if you dont mind dropping some extra money. I try to build everything to work on cheap arduino clones just for financial and practicality sake.
I have code and patches that I have written to control these types of circuits for many DACs and digipots with SPI and I2C protocalls... let me know if you'd like to check them out for some guidance.
Pduino + Arduino Output to Pins
Dear Forum,
Experienced PD user, intermediate Arduino user here.
My goal is to send several different frequency square waves (to be used as "on" and "off" signals for a circuit) to various output pins on an Arduino.
I am up and running using the Pduino library, and have PD and Arduino talking to each other.
However, I am not able to output audio-rate signals to any Arduino pins. For example, sending a square~ into an appropriately timed snapshot~ to output 0's and 1's to Arduino pins yields random clicking/sputtering Arduino output, rather than the expected steady square wave tone at any freq.
My arduinos play a square wave out through the pins just fine when using the Arduino IDE...so, what am I missing in the communication between Arduino and PD/Pduino? A speed issue?
Thanks in advance for any advice!
Permutations, second part, can anybody get this patch to work?
@whale-av oh and another thing, there would have to be a lot more sine waves, because morphing timbre cannot occur with one sine wave, otherwise you´re just manipulating that sine waves´s volume, what I mean is that there are 16 sine waves or oscillators PER curve, so the morphing occurs by manipulating the volumes of the set of 16 sine waves per curve,. Lets have mercy on my computer and for now use 5 sine waves as a set for morphing timbre per curve. is it going to take to put a set of 5 graphs and oscillators per curve? (there are 31 curves for timbre), i wish but i think it cannot be done, to use the five graphs for all the curves? that´s impossible right? would there need to be 155 graphs and oscillators? because the set of 5 sine waves is there just to make and fuse into ONE sound, the one that will go to one curve and morph by manipulating it´s volumes.
Permutations, second part, can anybody get this patch to work?
@whale-av Hello David!, I dont understand, if there are 8 curves in pd already manipulating the sine waves´s volumes, then why a curve in iannix? with my last teacher he told me to draw in iannix a curve for each volume of an oscillator, and i didn't like the idea because i want only one curve per parameter, and the more curves the less space i have in the score(I want a lot of voices in my scores and have written down 16 parameters for each, so imagine having only one voice having 16 parameters), plus with [combinations] you only need one curve because all the possible combinations are already set, and with time i would try or intuitively memorize some of the combinations and i would know where to go vertically on the score for a sound that I like. In my lifetime i want work and reach 64 sine waves´s volumes, that is way more(way more, way more) than enough, with eleven volume percentages: 0, 10, 20,30,40,50,60,70,80,90,100, isn't there a way to load the list only once and work from there? maybe right now the 64 sine waves will not occur, but gradually getting there.
here is the hypermorph ( https://www.ableton.com/en/blog/hypermorph-sonic-faction/) at 1:13 you could perceive the morphing, what we are doing is hopefully a lot more radical, they only use 4 sound sources for morphing, the combinations we are doing are a lot more...
openpanel to open
@whale-av said:
@Liquidyzer This contains all of the patches below and a sample..... open sample.zip
The first example...... open_sample.pd
Basically "open" is just dropped..... you could put "list" instead, or "woof"....... or any symbol (try it if you don't believe me).
The "open" or "woof" says to Pd "this is a list" The message then sends a list of one atom....... "track1.wav" which replaces $1.
Without the "list" tag the next message box complains..... the $1 expects an atom from a list.
Yes, it's not obvious, but it is documented in many help files in the Pd installation.
A series of symbols and floats that starts with a float is automatically a "list".
So [1 woof 3( is a list and all the atoms are passed onwards and can be translated by $1 $2 and $3.
But [track1.wav( is a symbol........ not a list. By putting more than one symbol it becomes a list as with [open track1.wav(........ but "open" is translated as a "tag" that says...... this is a list....... and so is not passed onwards. "track1.wav" is passed onwards as the list.You can do the same thing with [pack s]...... packing the symbol "track1.wav" into a list.
open_sample2.pdYou don't need to include $1 (track1.wav) in the array name, but it helps if you want to write many samples to many arrays, and know which one is which....... or using [pack s $0] you can get $0 into the array name as you wished...... open_sample3.pd
David.
Thanks David, super detailed response, what I was looking for! I'll crack on with this and see how I get on
openpanel to open
@Liquidyzer This contains all of the patches below and a sample..... open sample.zip
The first example...... open_sample.pd
Basically "open" is just dropped..... you could put "list" instead, or "woof"....... or any symbol (try it if you don't believe me).
The "open" or "woof" says to Pd "this is a list" The message then sends a list of one atom....... "track1.wav" which replaces $1.
Without the "list" tag the next message box complains..... the $1 expects an atom from a list.
Yes, it's not obvious, but it is documented in many help files in the Pd installation.
A series of symbols and floats that starts with a float is automatically a "list".
So [1 woof 3( is a list and all the atoms are passed onwards and can be translated by $1 $2 and $3.
But [track1.wav( is a symbol........ not a list. By putting more than one symbol it becomes a list as with [open track1.wav(........ but "open" is translated as a "tag" that says...... this is a list....... and so is not passed onwards. "track1.wav" is passed onwards as the list.
You can do the same thing with [pack s]...... packing the symbol "track1.wav" into a list.
open_sample2.pd
You don't need to include $1 (track1.wav) in the array name, but it helps if you want to write many samples to many arrays, and know which one is which....... or using [pack s $0] you can get $0 into the array name as you wished...... open_sample3.pd
David.