Creating a harmonic tree
The f(xn) and f(xn+1) part is just saying to use the output of the previous iteration and feed it into the current iteration. To me, it makes more sense to look at it like this:
f(xn) = f(xn-1) * d / r
f(xn-1) is the frequency output of the previous pass, and will give you f(xn). f(xn) then becomes f(xn-1) in the next pass.
An easy way to do this would be to make a subpatch with the equation and feed the output back into it. I made an example to illustrate this. In mine, I actually made two copies of the same patch; the output of 1 feeds into 2 and vice versa. Doing it this way allows you to have different destinations and relatives for each one, and you can chain as many as you like. I also set up a randomization option with min and max boundaries for the destination and relative.
Edit: by the way, thanks for bring this to concept to our attention. It's quite a musical approach to random intervals.
Creating a harmonic tree
Hey, I'm just starting out in Pd and I'm confused on how I would replicate a mathematical function. What I'm trying to do is generate a harmonic tree which is defined by the function...
x = value
d = destination harmonic
r = relative harmonic
f(xn+1) = f(xn) * d / r
The description of the site is here http://www.csounds.com/ezine/trees/
So what I have kind of does that but my question is, Can i create a patch that will do this can call itself again? (The f(xn) within the f(xn+1) part kind of confuses me)
Here is what I have so far..

Thanks.
Soundscape patches with pd?
Hi Gloomy, let me point out my "OuterSpace" PD patch: http://alberto.zin.googlepages.com/puredata
Similar to Boonier "tuned band-pass filter noise" approach, with 128 filters.
Some sounds/presets from it: https://puredata.info/Members/AlbertoZ/OS/OS_sample/
A pure 10 minute trip in the outerspace: http://alberto.zin.googlepages.com/Voices_from_OuterSpace.mp3

Enjoy,
AlbertoZ
Newbie: generating sound using an equation
@khaki said:
For example: the equation for calculating the amplitude of a sample might be something like this:
a = sin(x) / sin (y)
i think you guys missed the fact that he(?) is creating an amplitude. I'm assuming this would be an envelope for another signal?
Try this:
Using [HID] or [gemmouse] for your mouse input.
[mouseX] [mouseY]
| |
[expr sin($f1)/sin($f2)]
|
| [yoursample~]
| /
[*~]
|
[dac~]
This will be "jumpy" though, the result is calculated in control time. For a signal try;
[yoursig~] [mouseX] [mouseY]
| | /
[expr~ (sin($f2)/sin($f3)*$v1)]
|
|
|
[dac~]
It might work?
Newbie: generating sound using an equation
>a = sin(x) / sin (y)
where x and y are the mouse coordinates. <
you'd have to move your mouse up and down at least 40 times per second to even make that audible. (frequencies lower than about 40hz are generally not picked up by human ears)
>i want to be able to change several parameters of the equation by mouse - in realtime.<
unless you have a 3d mouse, you're only going to be able to change 2 variables at any one time.
>I know there are objects like sin~ or cos~ in pd for creating oscilators<
there is no sin~ , it's called osc~
>but i need to calculate the amplitude using more complicated expresions.<
fm synthesis, at it's simplest looks like this:
[a (
|
[osc~]
|
[*~ b]
|
[osc~]
one oscillator oscillates the frequency of another, a = modulator frequency, b = carrier frequency
Timbre conversion
@daisy said:
I have read some where that "if a voice is at same pitch and same loudness and still if one recognize that two voices are different , it is becuase of TIMBRE (tone quality)". (I agree there are other features as well who need to consider).
Timbre is another word for spectrum. The spectrum of a sound is the combination of basic sine waves that are mixed together to make it. Every sound (except a sine wave) is a mixture of sine waves. You can make any sound by adding the right sine waves together. This is called synthesis.
@daisy said:
First Question:
So how we can calculate the TIMBRE of voice? as fiddle~ object is used to determine the pitch of voice? what object is used for TIMBRE calculation?.
[fft~] object splits up the spectrum of a sound. Think of it like a prism acting on a ray of light. Sound which is a mixture of sines, like white light, goes in. A rainbow of different colours comes out. Now you can see how much red, blue, yellow or green light was in the input. That's called analysis.
So the calculation that gives the spectrum doesn't return a single number. Timbre is a vector, or list of numbers which give the frequencies and amplitudes of the sine waves in the mixture. We sometimes call these "partials".
If you use sine wave oscillators to make a bunch of new sine waves and add them together according to this recipe you get the original sound back! That's called resynthesis.
@daisy said:
Second Question:
And how one can change TIMBRE? as pitch shifting technique is used for pitch? what about timbre change?Thanks.
Many things change timbre. The simplest is a filter. A high pass filter removes all the low bits of the spectrum, a bandpass only lets through some of the sine waves in the middle, and so on...
Another way to change timbre is to do analysis with [fft~] and then shift some of the partials or remove some, and then resynthesise the sound.
@daisy said:
I have a kind of general idea (vcoder). but how to implement it? and how to change formant?.
A vocoder is a bank of filters and an analysis unit. Each partial that appears in the analysis affects the amplitude of a filter. The filter itself operates on another sound (often in real time). We can take the timbre of one sound by analysing it and get it to shape another sound that is fed through the filters. The second sound takes on some of the character of the first sound. This is called cross-synthesis.
/doc/4.fft.examples/05.sheepgoat.pd
Help -> 7.Stuff -> Sound file tools -> 6.Vocoder
PureData's patchfile format
@from said:
Color: Some graphical elements have color attributes. Per color only one signed integer value is stored that contains the three 8-bit color // components (RGB). Formula to calculate color attribute values:
color = ( * -65536) + ( [green] * -256) + ( [blue] * -1)
Where [red], [green], [blue] obviously represent the three color components, their values range from 0 to 255. They apply to the attributes [background color], [front color], [label color] of various elements.
my notes on the matter:
I discovered that this formula did not produce the same values that were being in produced in the file. After a frustrating investigation into the discrepency, I realized that Pd color component values are not stored as 8-bit values. For some reason Pd scales these values down to 6-bit values. I am not sure why 6-bit values instead of 8-bit; it does not make much sense to me. The following formula produces accurate results to +/- 1 tolerance:
color = (([red]/-4 * 2^12) +([green]/-4 * 2^6) +([blue]*-1)
I am not sure why the result of this ends up one number off. I think it has to do with integer numbers being rounded when divided by four.
If you convert the decimal representation of the the RGB triplet to hexadecimal, and take the 5 least significant nibbles of that hexadecimal number, and convert each of those nibbles to binary, you can extract the 6-bit values. A binary representation looks like this:
xxrr rrrr gggg ggbb bbbb,
where each letter represents one bit. The six r's, six g's, and six b's obviously refer to the 6-bit red, green and blue values.[/blue][/green][/red][/blue][/green][/red][/blue][/green]
