• dada

    hello all.

    I'm a total newcomer here, and I have more or less 2 days working experience with Pd :-)

    so please bear with me for the "bad coding" or naivety or whatever. anyway, this is my first Pd patch, and I thought it deserves to be shared.

    it is a morphing oscillator with controllable fatness, thus called "fatosc~". it has 2 inlets (frequency and fatness) and one outlet (the noise!).

    the "fatosc~demo" patch features an oscilloscope and can be eventually played via MIDI. (no envelope or fancy stuff, monophonic and note on/off sensing seems to be a bit flakey).

    I originally coded the oscillator for a completely different project of mine, but wanted to do some quick soundcheck with a realtime system, and Pd fitted just perfectly.

    the original C code looks like this:

    if(phase > 0.75) {
        output = -1.0 + pow((phase-0.75)*4.0, fatness);
    } else if(phase > 0.50) {
        output = -1.0 + pow(1.0-(phase-0.50)*4.0, fatness);
    } else if(t > 0.25) {
        output = 1.0 - pow((phase-0.25)*4.0, fatness);
    } else {
        output = 1.0 - pow(1.0-phase*4.0, fatness);
    }
    

    I had a hardtime figuring out a Pd equivalent for if/else. and I'm still not sure I got it right :-)

    anyway: with fatness=1 the oscillator generates a triangle wave. with fatness=PI, it generates a sine wave (don't know if it's a mathematically pure sine, but it looks pretty similar). going up with the fatness, it approximates a square wave.

    on the other hand, with fatness < 1 it generates a nice looking curved triangle waveform, which I've called "jawtooth". I was really thinking "shark tooth", but my fingers are faster than thought :-)

    with very small fatness values, it "degenerates" to almost silence.

    should be interesting to do some FM or other modulation with it. that's what I'm going to try next.

    hope you find it useful and/or entertaining.

    PS. of course, the algorithm is "pat.pend.", so if you're going to use it in a commercial product, my horde of lawyers will knock at your door and haunt you in your dreams.

    ok, just jocking, feel free to do whatever you like with it.

    critics welcome!

    cheers,
    Aldo

    http://www.pdpatchrepo.info/hurleur/fatosc~.zip

    posted in patch~ read more
  • dada

    @domien said:

    i tought synthmaker was also very powerfull, and i would be surprised that there wasn't a possibility to directly manipulate the signal data. I know for sure that there is a quite complete scripting engine (you can have a look at how some of the filters are mathematicaly implemented). and you can even do assembler if you want/need it.

    aww, you may be right. I meant of course arbitrarily complex math as in pd (of course the basic math is there). for example, I didn't find the equivalent of a pow~ builtin, which is what I needed... and I completely overlooked the programmability options!

    another issue, anyway, was pricing: 40€ versus 95€ (or 185€ for the "standard" edition) made the difference :-)

    cheers,
    Aldo

    posted in patch~ read more
  • dada

    @domien said:

    Haven't you tried synthmaker, which seems very nice also?

    yep, saw it, the user interface is lightyears better than synthedit, but I could not find a way to directly manipulate signal data (no math primitives for this), and AFAIK can't be extended with C modules.

    my conclusion is: synthmaker looks really nice and is a pleasure to play with, but synthedit has _the_ power.

    cheers,
    Aldo

    posted in patch~ read more
  • dada

    sad, but... in the end, I betrayed pd for the fancier Synthedit. the promised synth implementing the fatosc is here, for all you VST freaks: http://dada.perl.it/fatmoo

    I hope you will not be upset with me :-)

    puredata has been a very precious tool for me in experimenting with stuff and getting the math right, and I really enjoyed using it. I will probably enjoy it again in the future too.

    by the way, I can still post here the (unfinished) prototype for the now-VST synth, if there is some interest in it.

    cheers,
    Aldo

    posted in patch~ read more
  • dada

    aying to myself... as soon as I tried to use that oscillator in something like a synth, I realized that it is a real CPU hog. a single instance seems to take ~ 10% of my 1.83GHz dual core T2400 :-)

    I suspect this has something to do with the 4 pow~ objects. so I banged my head on it for almost a whole weekend and I came up with a totally different approach, more puredata-friendly, which uses a single pow~.

    basically, I use 3 phasors (freq, freq*2 and freq*4), get a square ware from the first two, then do some math to coerce them to various -1/0/+1 combinations, then use the results to do some other math on the main phase.

    the code in C now would look something like this:

    // sq1_zm: square at base freq (0>-1)
    // sq1_pz: square at base freq (1>0)
    // sq1_pm: square at base freq (1>-1)
    // sq2_pz: square at freq*2 (1>0)
    // sq2_pm: square at freq*2 (1>-1)
    // phase4: phase at freq*4
    output = sq1_zm+(sq1_pz-pow((sq2_pz-phase4)*sq2_pm, fatness))*sq1_pm;
    

    pretty nasty stuff (I don't expect you to say "ahhh, yes, it's clear as light" :-), but it was a very challenging exercise. also very rewarding.

    I was able to build a very basic 8-notes polyphonic 2-oscillator synth with it, that does frequency AND fatness modulation. the sound is interesting, but I still need to explore parameters tweaking and stuff.

    please find attached the revised fatosc~ patch. feedback is really welcome.

    I will post the synth as soon as I've cleared up the wiring mess and built a decent UI for it. (and if there's some interest in it, of which I don't see much... please show hands :-).

    cheers,
    Aldo

    http://www.pdpatchrepo.info/hurleur/fatosc~.pd

    posted in patch~ read more
Internal error.

Oops! Looks like something went wrong!