[mimba] physical modelling synth
@jamcultur I am wondering if there is a quick way to search through the files using a text based search. I know you can open Pd files as text files and there is a syntax to them. I think you can edit them as well and produce working Pd patches.
So here are the results from a search on the MacOS cli:
mimba-092b % grep "sin" *
mba.pd:#X obj 1201 543 r $1-mmbsintkeybp;
mba.pd:#X obj 319 354 r $1-mnbsinidelall;
mba.pd:#X obj 347 454 r $1-$2-mnbsinidelalldd;
mba.pd:#X obj 348 493 r $1-$2-mnbsinidelallml;
mba.pd:#X obj 1704 4618 r $1-mmbsinidelsensi;
******************* MY ADDED TEXT TO HIGHLIGHT THE LINE*****************************
mba.pd:#X obj 595 437 expr sin(w$0)sinh(ln(2)/2$f1w$0/sin(w$0));
MY ADDED TEXT TO HIGHLIGHT THE LINE**********
mba.pd:#N canvas 0 83 1920 997 sineIm 0;
mba.pd:#X restore 160 538 pd sineIm;
mba.pd:#X obj 323 536 sin;
mba.pd:#X text 505 456 alpha = sin(w0)/(2Q);
mba.pd:, peak gain = Q) b0 = sin(w0)/2 = Qalpha b1 = 0 b2 = -sin(w0)/2 =
mba.pd:#X text 530 678 b0 = sin(w0)/2 = Qalpha;
mba.pd:#X text 530 759 b2 = -sin(w0)/2 = -Qalpha;
mba.pd:#X obj 125 383 sin;
mimba.pd:#X msg 59 488 ; $1-wtable-ramp3 sinesum 515 1 -1 0.5 -0.5 0.33 -0.33
mimba.pd:#X msg 51 296 ; $1-wtable-ramp2 sinesum 515 1 0 -0.111111 0 0.04
mimba.pd:#X msg 52 88 ; $1-wtable-ramp1 sinesum 515 1 0.5 0.33 0.25 0.2 0.16
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X msg 875 315 ; $1-wtable-z1b sinesum 515;
mimba.pd:#X obj 147 791 list prepend sinesum 1024;
mimba.pd:#X text 509 510 rising saw;
mimba.pd:#X text 35 274 soft sine 2;
mimba.pd:#X text 20 201 soft sine 1;
mimba.pd:#X msg 521 916 ; 1-addiwaves write sine-noisy1.txt;
mimba.pd:#X msg 522 853 ; $1-addiwaves read sine-noisy1.txt;
mimba.pd:#X text 165 339 (3) soft sine 3;
mimba.pd:#X text 1334 643 soft sine 1 with octave louder;
mimba.pd:#X obj 171 780 list prepend sinesum 1024;
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X obj 147 791 list prepend sinesum 1024;
mimba.pd:#X obj 679 864 list prepend sinesum 1024;
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X text 193 158 0 soft sine 4;
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X obj 42 374 s $1-mmbsintkeybp;
mimba.pd:en filders te 'clearen' in tien voices tegelijkertijd. Oplossing: tussen
mimba.pd:elke stem bv. 100ms steken , zie oplossing aan de rechterkant van
mimba.pd:#X msg 1041 471 ; 1-addiwaves write sine-noisy1.txt;
mimba.pd:per wavetable)(de langste sinesum messages -zoals 37- hebben nu 36
mimba.pd:#X text 36 318 alle lage tonen maximum 36 harmonieken in sinesum ,
mimba.pd:doen met global previous pitch (en toggle voor aanpassing van vorige
mimba.pd:#X msg 59 488 ; $1-wtable-ramp3 sinesum 515 1 -1 0.5 -0.5 0.33 -0.33
mimba.pd:#X msg 51 296 ; $1-wtable-ramp2 sinesum 515 1 0 -0.111111 0 0.04
mimba.pd:#X msg 52 88 ; $1-wtable-ramp1 sinesum 515 1 0.5 0.33 0.25 0.2 0.16
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X obj 147 791 list prepend sinesum 1024;
mimba.pd:#X text 509 510 rising saw;
mimba.pd:#X text 177 311 soft sine 2;
mimba.pd:#X text 162 238 soft sine 1;
mimba.pd:#X msg 521 916 ; 1-addiwaves write sine-noisy1.txt;
mimba.pd:#X msg 522 853 ; $1-addiwaves read sine-noisy1.txt;
mimba.pd:#X text 227 363 (3) soft sine 3;
mimba.pd:#X obj 171 780 list prepend sinesum 1024;
mimba.pd:#X obj 147 824 list prepend sinesum 1024;
mimba.pd:#X obj 147 791 list prepend sinesum 1024;
mimba.pd:#X obj 679 864 list prepend sinesum 1024;
mimba.pd:#X obj 100 1319 r $1-mnbsinidelall;
mimba.pd:#X obj 624 1290 r $1-mmbsinidelsensi;
mimba.pd:#X obj 11 591 hsl 128 15 0 508 0 0 $1-mnbsinidelall $1-mnbrinidelall
mimba.pd:#X obj 829 17 bng 15 250 50 0 $1-mmbsinfopifqin empty i 17 7 0 10
mimba.pd:(read) variations ; 31 = read once with small sine (read) variations
mimba.pd:; 32 = read once with bigger (read) sine variations ; 33 = normal
mimba.pd:#X obj 306 22 r $1-mmbsinfovelom;
mimba.pd:#X obj 555 28 r $1-mmbsinfopifqin;
mimba.pd:#X obj 29 231 r $1-mmbsinfodetails;
mimba.pd:#X obj 416 137 bng 15 250 50 0 $1-mmbsinfovelom empty i 17 7 0 10
mimba.pd:#X obj 907 94 hsl 121 10 -1 1 0 0 $1-mmbsinidelsensi $1-mmbrinidelsensi
mimba.pd:the pitch detuning caused by bypassing/crossfading APF delay., f 66
mimba.pd:#X obj 22 622 r $1-mmbsinfoafterfiltrin;
mimba.pd:#X obj 1016 539 bng 15 250 50 0 $1-mmbsinfodetails empty xtra_details
mimba.pd:#X obj 1650 601 bng 15 250 50 0 $1-mmbsinfoafterfiltrin empty i 17
mimba.pd:; mmbsimplvl ; mmbsxfadeapf ; mmbsxnoilop ; mnbsinidelall ; mmbsxnoistaval
mimba.pd:'drastische oplossing: default naar alle voicespecific send-receives
grep: presets: Is a directory
I am going to refine the search method to include the relationship/equation from the error message to see what happens.
Iannix, Open Sound Control, Arduino.
Hello everyone, I have a question, i want to start performing with my sound drawings live; my sound drawings are reproduced with sine waves, I use Iannix for composition and Pure Data reproduces the score. But for live performance it ocurred to me to reproduce them with police sirens. Iannix communicates with Pure Data through Open Sound Control. Arduino does not support open sound control directly, there must be a bridge that converts open sound control to serial data that arduino can understand, i researched and that bridge can be pure data, (i could make the police siren through arduino).
My question is if arduino can reproduce the iannix curves just like pure data does, that is, reproduce the iannix curves exactly like they are written, i use iannix curves mainly for composition, these curves can play separate notes or glissandi...
I use open sound control and sine waves because that is the only way to reproduce the iannix curves exactly the way they are written (midi does not follow the curve exactly, osc can, and i enjoy the sound). (the curves can be in any direction and last as long as i want with any kind of shape, acceleration or slowing down, and open sound control and the sine waves can follow them perfectly, but not midi)
So... I am willing to learn how to code for arduino if it can reproduce my scores the way they are written (just like pure data has done), i gotta feeling that it is possible, but before buying an arduino card i want to know for sure.
Here is an example of a iannix score:
So iannix would send open sound control to pure data, pure data would convert open sound control to serial data and arduino would receive the serial data and play the score through a speaker.
can this be done? thanks.
Zone Shift?
Hi, I am very new to pure data and have only messed around only with other users pd files.
I love using the zone shift on the ableton sampler when using multiple 88 samples in their individual zones/key. I was wondering if this has every been re created in pure data or if its even possible to recreate this?
I happy with the creating a 88 key sampler it is the zone shift I am clueless about.
Any help would be amazing
plugdata latency and REAPER's plugin delay compensation (PDC)
@ddw_music Oh OK, well I redid the test using a 1033.6 Hz sine wave (1.5 cycles/64 sample block) and the result is consistent with a 64 sample shift (i.e. 180 degrees out of phase), plus it goes away when I set plugdata's latency to 0. I'm gonna check on the REAPER forum to see what they say about PDC--maybe the issue is that REAPER assumes a base 64 sample latency for all plugins so plugdata doesn't need to report that portion.
It would still be interesting to see if other DAWs behave similarly. Maybe I have to dig out my old laptop and struggle with Cubase again. 1033.6 Hz sine.wav
BTW, is there a way to set plugdata's reported latency to the host programmatically? I have an FFT resynthesis patch that uses different block sizes. Camomile has that facility.
Update: I think I'm seeing the same behavior in Audacity, but my understanding of Audacity is weak. I also tested an FFT resynthesis patch in REAPER using a 16384 block size and set plugdata's latency to 16320 (16384 - 64) ; that produced the alignment I was expecting. So I'm provisionally declaring that you should set plugdata's latency to the latency of your patch as measured between adc~ and dac~. In retrospect that seems completely obvious, but I was thrown by plugdata's default of 64.
why saw and square 'sound' louder?
@brendanmac lets look at it.

from an electronics perspective it looks like a square wave represents a steady DC signal the closest (meaning if you were to flip the 0 to -1 part it would be a straight line) besides at the crossings and the others look filtered.
Its interesting how there's a subtle difference at the peak of a sine vs a triangle, the sine hits red a little. In vintage analog synths a "dirty" triangle wave could be mislabeled on the synth as tho it is a sine but it looks like it has the least energy. Also from vintage synths if you look at the waves in a scope they look different than you would think, especially something like a 303 (filtering out the DC maybe?). A function generator (which this basically is) is more like what you think of these basic waveforms in your head.
the live electronics tutorial included in [else] is top notch btw (as is the audio section in the help browser, thats supplemented with a free online book on miller's website). a saw has all the harmonics, a square odd, triangle even, and they can be separated or combined. a (co)sine wave is the only signal that can travel through electronics without change phase (which can mess up what you are seeing) one reason why its used to probe inside audio electronics
also to note, the oscope~ on the top was just to show that the [phasor~] normally comes out at 0-1 (normalized float which is easy to use as a looping function) so it has to be stretched out to be used like a sawtooth
testWaves.pd
why saw and square 'sound' louder?
@brendanmac If I remember correctly from school the power of a signal is the area under the curve.... which is why a compressed signal (then normalized) sounds louder and compression is often used when mastering a recording.
A square wave has a large area under the curve..... it is always at +- 1 ....... and will be 6db louder than a sine wave for the same peak values.
A saw contains all the higher harmonics (like the square wave) but the perceived loudness has more to do with the richness of the timbre than the actual power I think. The square wave of course also has that perceived increase in power from the harmonics.
A saw wave actually has less power than a sine wave, so the effect is purely psychoacoustic.
The harshness comes from the higher harmonics (especially the highest), so you cannot change that. A low pass filter will progressively return the waveform to a sine as the cut off frequency is reduced, because the higher harmonics are being reduced...... and it will introduce a phase shift (a slight lag in the waveform).
A wavetable will produce the same effects as your maths...... it is in the nature of the waveform and there is nothing wrong with your method.
You can use a [lop~] to reduce the effect though if you actually want a less harsh sound.
David.
Audio-rate round-robin impulse generator?
A few years ago I made a convoluted patch (no pun intended) that outputs a single sample 1-valued pulse on each of its [outlet~]s sequentially in round-robin fashion in response to a positive transition on its [input~]. It's pretty gruesome so I don't want to post it here, but for the morbidly curious suffice it to say it's based on cascaded shift registers with the last stage fed back to the first stage and requires [block~ 8 1 1] to work reliably at 2500 Hz. Anyway, it behaves like this:
- positive transition seen on [input~] -> pulse first [outlet~]
- positive transition seen on [input~] -> pulse second [outlet~]
- positive transition seen on [input~] -> pulse third [outlet~]
... - positive transition seen on [input~] -> pulse last [outlet~]
- positive transition seen on [input~] -> pulse first [outlet~]
...
Anytime I look at my code I gag. Does anyone in the esteemed readership of this forum have a suggestion on how to do this in a less offensive way? I don't care about the signal specifics of the inputs and outputs as long as they are at audio-rate and easily detectable within a constant number of samples. I would gladly accept consistent latency in exchange for efficiency and elegance. Extra respect if the number of outputs can be easily changed without dynamic patching.
Table is read -1/+1 while range is 0 +1
I wrote a sine into a table
Output of modulo / by table length , and mutltipled by 2pi radians .( complete sine )
Then I powered the sine exponent 13 , the table is set to range 0-1 , which is reflected in the table display .
So only the positive part of the cycle is shown (and should be read )°
Reading the table with tabread~ , The osciloscope clearly shows the signal is bipolar , iow the -1 part of the array is also read out .
How is this possible
SO even if the table is restitricted to range 0-1 , it will not cut off the negative portion of -1/+1 wave .
Is this expected behaviour or a bug
I aso noticed that the array in plugdata doesn't show the negative range but pure data vanilla does ,, both arrays are 0,+1 and both output -1,+1

instance specific dynamic patching documentation assistance
@whale-av @ben.wes @ddw_music
I am learning about dynamic patching. The documentation describes instance specific dynamic patching as being able to send messages to a specific instance of an abstraction, by renaming the abstraction using namecanvas. The renaming can be automated using $0 expansion.
I am not familiar with where to locate namecanvas and how to use it and I am not familiar with how to use $0 expansion. Can someone please show a complete visual example of how to use instance specific dynamic patching using the exact instructions given in the documentation link?
https://puredata.info/docs/tutorials/TipsAndTricks#instance-specific-dynamic-patching
And can someone show a visual example of how to use dynamic patching to dynamically create instances of an object in an abstraction? For example, if I create a patch with a sine oscillator that can be assigned a frequency, an amplitude, and has a dac object and then make that patch an abstraction how would I be able to use dynamic patching to allow my gui to let me assign a new sound source in place of the sine oscillator? Objects like the switch object have limitations. I would want to be able to assign/unassign any number of new sounds sources in place of the sine oscillator. For example a phasor object, a noise object, or even synthesizer patch abstraction. Suggestions for other ways to do this are good and I also want to be sure to have explanations for using dynamic patching since that is what I am learning. How could this be done using dynamic patching?
General Dynamic Patching
What is the difference between pd messages and patch messages? Are they both used for dynamic patching? And how are they different from instance specific dynamic patching?
https://puredata.info/docs/tutorials/TipsAndTricks#pd-messages
https://puredata.info/docs/tutorials/TipsAndTricks#patch-messages
90-second limit on audio buffers?
phasor~ way isn't sufficient for many use cases; perhaps a new object would be useful, or, the accumulator technique would be useful as a more prominent part of pd culture.
@ddw_music Just chiming in, to say thank you.
I am always interested in how to make Pd sound better: Not only looking for more Pd-double developement, but also for such basic insights.
Vanilla's oscillators use the "Höldrich method", of which I get an idea, but – like most of us? - do not understand fully in depth.
So don’t want to muddy the waters.
Just sharing some related links on the topic:
[phasor~]'s source:
https://github.com/pure-data/pure-data/blob/master/src/d_osc.c
Miller on the method:
http://lalists.stanford.edu/lad/2000/Sep/0188.html
@seb-harmonik.ar explaining:
https://forum.pdpatchrepo.info/topic/8691/generating-sines-in-plain-c-on-arm-understanding-osc-guts/3
Does Pd have a "sound"? (vs. SC)
https://lists.puredata.info/pipermail/pd-list/2016-02/113248.html
(...discussion containing partly false information, too I think...)
A stub, not explaining the method:
https://github.com/TonicAudio/Tonic/wiki/Fast-Phasor-ala-R.-Hoelderich
(The quoted paper appears to be the wrong one or missing:
1995 ICMC“An Accurate Signal Representation for Sound Resynthesis Utilizing a Time-Frequency Mapping of the DFT-Magnitude”
it is not. )



