Hi, I built a simple triangle-saw morphing oscillator but there's one problem with clicks that I would like some help for. I can morph between up/down saw and the triangle wave just fine, but that involves setting the phase of a phasor object, and as you can hear in the attached patch, this results in nasty clicks. Does anyone have an idea, how I could get rid of these? Thanks for any help in advance. ciao,
hi Frank,
have you tried sending _one_ phasor's output, x, through min~(x, a *~ (1 -~ x)), where a > 0? With one phasor you do not have to make phase adjustments... but scaling may be tricky (atan?)...
Krzysztof
Frank Barknecht wrote: ...
I built a simple triangle-saw morphing oscillator but there's one problem with clicks that I would like some help for. I can morph between up/down saw and the triangle wave just fine, but that involves setting the phase of a phasor object, and as you can hear in the attached patch, this results in nasty clicks. Does anyone have an
Krzysztof Czaja hat gesagt: // Krzysztof Czaja wrote:
have you tried sending _one_ phasor's output, x, through min~(x, a *~ (1 -~ x)), where a > 0? With one phasor you do not have to make phase adjustments... but scaling may be tricky (atan?)...
Last night I found another, similar but simpler solution shown in the attached patch. It adds something to the phasor to get a shifted signal and then uses [>~ 1] from zexy (I think) to check, if the shifted sig goes beyond 1. If it does, I substract 1, which is the result of [>~ 1] if it's true, otherwise I substract 0, which is the result of [>~ 1] if that's false. This works for a phasor~ but not for other oscillating objects like the osc~, but here it's okay.
So now, trisaw~ is a working triangle to up/down-saw morphing oscillator, that even should be bandlimited, if I understand the used algorithm (taken from a Istvan Varga Csound instrument) correctly.
Frank Barknecht _ _______footils__
hi Frank,
why do not you use wrap~ then?
Krzysztof
Frank Barknecht wrote: ...
Last night I found another, similar but simpler solution shown in the attached patch. It adds something to the phasor to get a shifted signal and then uses [>~ 1] from zexy (I think) to check, if the shifted sig goes beyond 1. If it does, I substract 1, which is the result of [>~ 1] if it's true, otherwise I substract 0, which is the result of [>~ 1] if that's false. This works for a phasor~ but not for other oscillating objects like the osc~, but here it's okay.
hi again,
finally found some time to look closer at the math (I am math-blind without a sheet of paper). The min~ solution is apparently cheaper than Varga's, and the output scaling is not tricky at all -- it is: ((a + 1) / a) * min~(x, a *~ (1 -~ x)). The input (`a' coeff) scaling is best done with an exp, in order to have symmetric control around zero.
Krzysztof
Frank Barknecht wrote:
Krzysztof Czaja hat gesagt: // Krzysztof Czaja wrote:
...
have you tried sending _one_ phasor's output, x, through min~(x, a *~ (1 -~ x)), where a > 0? With one phasor you do not have to make phase adjustments... but scaling may be tricky (atan?)...
...
Last night I found another, similar but simpler solution shown in the
#N canvas 186 64 602 532 12; #X obj 224 439 tabwrite~ osc; #X obj 224 395 metro 1000; #X obj 224 359 tgl 15 0 empty empty empty 0 -6 0 8 -260818 -1 -1 1 1; #X obj 39 305 min~; #N canvas 0 0 450 300 graph1 0; #X array osc 880 float 0; #X coords 0 1 879 -1 200 140 1; #X restore 324 225 graph; #X obj 70 218 -~; #X obj 70 172 sig~ 1; #X floatatom 39 22 5 0 0; #X obj 39 481 dac~; #X obj 39 433 *~ 0.25; #X obj 39 395 -~ 0.5; #X msg 39 60 $1 5; #X floatatom 222 22 5 0 0; #X obj 328 97 osc~ 5; #X obj 222 97 line~; #X msg 222 60 $1 5; #X obj 222 261 +~ 1; #X obj 222 305 /~; #X obj 222 172 expr~ exp($v1); #X obj 39 349 *~; #X obj 70 261 *~; #X obj 222 135 clip~ -88 88; #X obj 39 97 line~; #X obj 39 135 phasor~; #X obj 121 22 loadbang; #X msg 121 60 110; #X floatatom 328 60 5 0 0; #X connect 1 0 0 0; #X connect 2 0 1 0; #X connect 3 0 19 0; #X connect 5 0 20 0; #X connect 6 0 5 0; #X connect 7 0 11 0; #X connect 9 0 8 0; #X connect 9 0 8 1; #X connect 10 0 9 0; #X connect 11 0 22 0; #X connect 12 0 15 0; #X connect 14 0 21 0; #X connect 15 0 14 0; #X connect 16 0 17 0; #X connect 17 0 19 1; #X connect 18 0 16 0; #X connect 18 0 20 1; #X connect 18 0 17 1; #X connect 19 0 0 0; #X connect 19 0 10 0; #X connect 20 0 3 1; #X connect 21 0 18 0; #X connect 22 0 23 0; #X connect 23 0 3 0; #X connect 23 0 5 1; #X connect 24 0 25 0; #X connect 25 0 7 0; #X connect 26 0 13 0;
Krzysztof Czaja hat gesagt: // Krzysztof Czaja wrote:
finally found some time to look closer at the math (I am math-blind without a sheet of paper).
Me, too. And I should have used wrap~ indeed, that does the same [>~ 1] and substracting 1 or 0, I just didn't think of it. All those objects...
The min~ solution is apparently cheaper than Varga's, and the output scaling is not tricky at all -- it is: ((a + 1) / a) * min~(x, a *~ (1 -~ x)). The input (`a' coeff) scaling is best done with an exp, in order to have symmetric control around zero.
The important idea behind Varga's algorithm is "Bandlimiting". The standard phasor has harmonics beyond the Nyquist frequency because of the abrupt changes from 1->0 and unfortunatly now that I took a sheet of paper, the way I realised trisaw has the same problem. Duh. I looked closer at Varga's code and he uses a new Csound function table generator, GEN30. This does the following:
"GEN30 extracts a range of harmonic partials from an existing waveform"
The 4(x-x^2) expression is used in Varga's code to fill a table with such a waveform, that GEN30 then reads while limiting the upper border of the harmonics range.
Because these gen30-generated table later is used in an oscili (==tabosc~ in PD) with varying frequency, one cannot simply use one table for every trisaw~ frequency, because that would introduce aliased frequencies again. Varga's solution is to fill 128 tables, one for each midi note, with GEN30-functions from 4x(1-x) polynoms and limited upper harmonic borders of "nyquist_frequency/note_frequency"
All this I didn't do in my trisaw~ and so I alias the same amount as you.
Life's a dog.
Frank Barknecht _ _______footils__
On Thu, 16 May 2002, Frank Barknecht wrote:
All this I didn't do in my trisaw~ and so I alias the same amount as you.
Life's a dog.
This might help you: Alias-Free Digital Synthesis of Classic Analog Waveforms http://ccrma-www.stanford.edu/~stilti/papers/Welcome.html
or
http://www.musicdsp.org/archive.php?classid=1
Guenter
hi Frank,
aah... I have thought you are simply going to mimic [triangle~] (an msp object)...
I do not know Varga's algorithm, but I wonder if one can modulate (i.e. use an audio signal to control) the `slope' in a bandlimited version -- sort of a timbre vibrato or a sweep?
You should be able to do similar things with your buzz~, though...
Krzysztof
Frank Barknecht wrote: ...
The important idea behind Varga's algorithm is "Bandlimiting". The
Krzysztof Czaja hat gesagt: // Krzysztof Czaja wrote:
aah... I have thought you are simply going to mimic [triangle~] (an msp object)...
This was, what I did, unfortunatly... But now I discoverd Steve Harris new bandlimited Ladspa-oscillators from plugin.co.uk and have something to play with again.
Frank Barknecht _ _______footils__
I haven't been able to try those yet, but anyone think it would be a good idea to port them to pd (so signals can be used for control)? I'm thinking of doing that, and maybe the state-variable filter as well, if I can get pd working on this machine..
Ben
On Thu, May 16, 2002 at 01:36:09PM +0200, Frank Barknecht wrote:
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
But now I discoverd Steve Harris new bandlimited Ladspa-oscillators from plugin.co.uk and have something to play with again.
that's plugin.org.uk and they are really good. ciao, -- Frank Barknecht _ _______footils__
oops.. heh.. didn't notice that it already is signal-controlled :-} cool.
Ben
On Thu, May 16, 2002 at 04:16:05PM -0800, bsaylor@Macalester.edu wrote:
I haven't been able to try those yet, but anyone think it would be a good idea to port them to pd (so signals can be used for control)? I'm thinking of doing that, and maybe the state-variable filter as well, if I can get pd working on this machine..
Ben
On Thu, May 16, 2002 at 01:36:09PM +0200, Frank Barknecht wrote:
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
But now I discoverd Steve Harris new bandlimited Ladspa-oscillators from plugin.co.uk and have something to play with again.
that's plugin.org.uk and they are really good. ciao, -- Frank Barknecht _ _______footils__
bsaylor@macalester.edu hat gesagt: // bsaylor@macalester.edu wrote:
I haven't been able to try those yet, but anyone think it would be a good idea to port them to pd (so signals can be used for control)?
Steve is considering using frequency inputs for the controls himself, so you might wait a bit or get in contact with him.
I'm thinking of doing that, and maybe the state-variable filter as well, if I can get pd working on this machine..
There are some LADSPA plugins that whould make fine PD objects, I think. I don't know if it would be possible to compile LADSPA plugins natively on other architectures. Mac-OSX should be no problem, but I have no idea about W32 systems.