couldn't locate the Smeck.pd download on the link posted for Miller's page but here is the direct link in case you couldn't find it: http://crca.ucsd.edu/~msp/smeck/latest/smeck-01.zip
Ok, well, i didn't expect that many replies! I have tried Martin's patch, it sounds great. I have also tried the help patch with chebyshev polynomials, which sounds amazingly close to the old Roger Mayer Octavia (the one Jimi Hendrix used, as on Band of Gypsys). I mean, I was really surprised to hear how close the two sounds are. So that's a very cool thing for me to know!
Now please, could someone tell me how this works? Like this tan distortion, this table that switches from 0 to 1 with a variably soft transition, what is this supposed to model, and what does it do to the raw waveform? I'd like to try the sigmoid function but i don't really understand the way the whole thing works. Also, i'm assuming the size of the table matters. Miller's Chebyshev table in the help patch is 129 points wide, i guess the sound would improve if i made it larger, wouldn't it?
This is all very exciting for me right now! I always thought distortion could not be properly modelised, but the stuff i've tried today sounds pretty good to me.
Thanks!
Pierre
2010/9/12 Kim Cascone kim@anechoicmedia.com
couldn't locate the Smeck.pd download on the link posted for Miller's page but here is the direct link in case you couldn't find it: http://crca.ucsd.edu/~msp/smeck/latest/smeck-01.ziphttp://crca.ucsd.edu/%7Emsp/smeck/latest/smeck-01.zip
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
On Sun, Sep 12, 2010 at 10:04:23PM +0200, Pierre Massat wrote:
Now please, could someone tell me how this works? Like this tan distortion, this table that switches from 0 to 1 with a variably soft transition, what is this supposed to model, and what does it do to the raw waveform?
What is happening here is called waveshaping, which just means passing a signal through some kind of (lookup) function. This is waveshaping for example:
[osc~ 440] | [cos~] | [dac~]
Here you use the output of the [osc~] to look up the value of a cosine function at that point and play that to the [dac~]. You could use a different source wave instead of the [osc~], for example play a sample. But as all audio signals can be made up from adding sinewaves, the [osc~] is a good source to analyze the waveshaping and get predictable results.
Instead of the [cos~] you can use any kind of function, for example [exp~], [abs~], [pow~] etc. For functions, that do not have a directly equivalent Pd objectclass like [cos~], it is common to store the function into a [table] object and read through it with a [tabread4~]. This also allows you to draw your own waveshaping functions with the mouse.
An [osc~] object only produces values between -1 and 1, while [tabread4~] needs to have values from 0 up to the table size to be able to read through the whole table. In fact, because of the interpolation tabread4~ does, you should start reading out at 1 and only go to "tablesize - 2".
So you need to scale the osc~-range (-1,1) to e.g. a range of (1, 1025) for a table of size 1027 as the message box [; mysine sinesum 1024 1( would produce for a [table mysine].
Scaling is made simply by addition and multiplication of the osc~ signal. Example:
[osc~ 440] -1,1 | [*~ 512] -512,512 | [+~ 512] 0,1024 | [+~ 1] 1,1025 | [tabread4~ mysine] reads from: [table mysine 1027] | [dac~]
Now try to draw around in [table mysine] a bit. :)
Writing a tanh-function into the table is popular around here as matju and Martin Peach demonstrated, but it's by far not the only way to waveshape. Chebyshev functions are well analysed, too, and work great to create clarinets from sinewaves, and exponentials and powers and all that can be used, too.
I'd like to try the sigmoid function but i don't really understand the way the whole thing works.
Just look at the size of the table that's storing the sigmoid, then scale you [osc~] accordingl. Remeber to add [+~ 1] at last and only read up to the second to last point.
Also, i'm assuming the size of the table matters. Miller's Chebyshev table in the help patch is 129 points wide, i guess the sound would improve if i made it larger, wouldn't it?
Yes.
This is all very exciting for me right now! I always thought distortion could not be properly modelised, but the stuff i've tried today sounds pretty good to me.
At least it sounds dirty. :)
Frank Barknecht Do You RjDj.me? _ ______footils.org__
On Sun, 12 Sep 2010, Pierre Massat wrote:
Now please, could someone tell me how this works? Like this tan distortion, this table that switches from 0 to 1 with a variably soft transition, what is this supposed to model, and what does it do to the raw waveform?
The use of the table is just a shortcut so that tanh doesn't have to be used live, in which case it may take a good chunk of CPU (especially if you want to use many of them at once).
As I was trying to allude to in this thread, tanh doesn't directly model much, but is a good approximation to several patterns appearing when you are using analogue electronics close to its max capacity. The graph of tanh vs several forms of exp shows this. (see one of the mails).
I'd like to try the sigmoid function but i don't really understand the way the whole thing works. Also, i'm assuming the size of the table matters. Miller's Chebyshev table in the help patch is 129 points wide, i guess the sound would improve if i made it larger, wouldn't it?
The table is optional. If you use a table, more points will be more precise, but also, if you use [tabread4~], you will need many less points than [tabread~] to get a comparable level of precision, and with [tabread4c~] (external) you can get a bit better than that (though for the case of tanh the difference doesn't show as much as for steep or spiky functions)
This is all very exciting for me right now! I always thought distortion could not be properly modelised,
Just because the formulas don't normally show up in a book about the basics of dsp, doesn't mean it can't be done. You see, when mapping from the original theory of a [lop~] or [hip~], to analog electronics, the supposition was that 1-exp(-k*x) can be rounded to k*x. As long as you assume it is true, you can't see where the distorsion can be coming from.
It's like what I learnt about lenses and curved mirrors, in grade 11 and again in grade 13... it's all based on the supposition that tan(x) can be rounded to x, but then it only works well for viewing angles that are quite close to the centre...
| Mathieu Bouchard ------------------------------ Villeray, Montréal, QC