[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.
Automating vline~ envelope from a waveform (envelope as wavetable
Hi everyone,
I'm working on a system to automatically generate a vline~ message list starting from a custom envelope shape stored in an array, originally extracted from a .wav file.
I want to build a dynamic vline~ list like this: 0, 1 93.753, 1 0 187.506
But instead of typing values manually, I'd like to generate it automatically based on the shape of an envelope loaded from a waveform (array).
I already convert the array index to milliseconds using: [expr ($f1 / 44100) * 1000]
And I can manually draw or extract the envelope into an array — but I’m struggling to automate the construction of the vline~ list so it correctly represents:
- attacks
- holds
- releases
- plateaus (ecc)
at the moment i Load a .wav file containing an envelope shape, Store it into an array. Detect meaningful breakpoints (e.g. slope changes, thresholds) and Use those to automatically create a proper vline~ sequence.
here the patch and one env wav file
impose-envelope-wavetable-analog.pd
strike-1_6.wav
Is there a way to extract breakpoints or slope changes from an array to build a proper vline~ message?
Has anyone implemented something similar (using an envelope from a .wav as a wavetable)?
Would “wavetable envelope” be a good term for this? Is there a better one in Pd terminology?
Thanks in advance if anyone has ideas or guidance.
Even partial thoughts or pointers would help a lot!
I almost forgot: At the moment, I’m using GPT to convert the vline~ list into the format 0, 1 93.753, 1 0 187.506 (just an example), starting from a total duration in milliseconds — in this case, 2176 ms. This naturally results in very complex lists, like something along these lines:
0, 1 100, 0.6 400 100, 0.3 2000 500, 0.15 3000 2500, 0 10491 5500
I’d really like to find a way to resolve this and automate the process, but since I’m still a beginner, I wonder if I’m just making things unnecessarily complicated?
Emiliano
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.
Coarse-grained noise?
@manuels I was not prev aware of these other kinds of white noise but they are all smooth and so don't produce the kind of texture I want. To give you a sense of what I'm looking for, here is the sound of a drip into an empty tin can: tinCanDrip1.wav. Convolved with binary white noise, you get this: tin can conv binary noise.wav. Now here is my nasty-sounding whitening of bubbling water and it's convolution with the tin can: whitened bubbling.wav & tin can conv whitened bubbling.wav. See how the result sounds a little like a small stone being rolled around the bottom of the can?
Also, that's interesting about [noise~] in overlapped windows, I'll go back and modify my version of that patch to see if the lo-fi mp3 quality goes away.
@whale-av "randomly modulated in its amplitude"--yes, that's what I tried with the 64 band 1/5 oct graphic. It's not bad, but it's not natural sounding either. Could be useful anyway, depending on the effect you want.
@ddw_music My problem isn't the convolution (I'm using REAPER's ReaVerb for that), I'm just wondering how to make the kind of IR that produces the effect I want. Your rifft strategy is what I speculated about in my original post and what I first tried using [array random] to generate freq domain moduli with a similar distribution as [noise~]. FYI Pd's real inverse FFT automatically fills in the complex conjugates for the bins above Nyquist, so you don't have to write them--leaving them as all 0 is fine. Also note that your [lop~] is filtering the change between successive bin moduli in a single window, not the change of each bin from window to window. I'm speculating that the latter (maybe using asymmetric slewing rather than low pass filtering) would make frequency peaks hang around longer (and hence more audible) whereas I'm not sure what the former does. That said I think the strategy of modifying natural sound is paying off faster than these more technical methods.
Is it possible to group different soundfiles in only one message?
Hi all,
I'm creating a project with lots (literally hundredths) of samples I want to play kind of randomly. I'm new on PD, and right now I'm working on my prototype with the classic message [open soundfile.wav, 1] to play each one of them. But I need to scale it more efficiently and I'm not finding a solution. Does anyone know if there is a method to group different files in a message and select one of them randomly?
I was wondering if it is possible to build something like this:
[O]
|
[random 858]
|
[sel $1]
|
[O]
|
[file_0.wav, file_1.wav, file_2.wav, file_3.wav, file_4.wav, file_5.wav (...) file_857.wav]
|
[readsf~]
|
[dac~]
Thanks in advance, I'm learning a lot in this community.
Cheers!
Phase of sine
I have created a kind of pulse width sine thingie where I can define the nr of sine waves in one period by use of a comparitor
Works great , more or less
Obviously the sine needs to be stationary (0hz° ) and the phase input is modulated by a phasor .
The issue is settting the starting phase of the sine because when it's a cosine there are discontinuties ( becasue it starts from 1) , the starting phase sometimes works with the nr. 1.429 ,but most of the time not (blue rectangle on picture )
Max msp obviously suffers from the same issues with cycle~ but it has a sinx~ object which takes 2*pi as input.
Here's the stuff


narrow sine.pd
Why does the same program have different output?
In order to transition from a sine wave to a triangular wave, I combinined the two sound waves by adjusting the gain of the two waves to each other, i.e. the triangular wave gain (a) drops uniformly from 1.0 on the left to 0.0 on the right, while the sine wave gain increases accordingly (always 1-a).
It worked well at first. However, when I ran it again, the volume changed. The exact same procedure, which I can only explain in metaphysical terms 
Maybe someone can answer it for me? Thanks so much 
Here is the picture view of my problem:
Broken Square Waves?
Hi, I'm looking for someone with a deeper understanding of PD and audio synthesis to help me understand why my patch sounds the way it sounds. I don't know why the audio is generated this way. I don't know if it is because of some expected behavior of square waves and the math behind it, or if it is because of some quirk of PD and the way I'm generating the square wave. If you think you can help, please stay with me, I don't know who to go to or what to study to help me understand this.
I was attempting to make a square wave from scratch, I saw some tutorials and I know there are more "proper" ways of doing this, but the simplest I could think of was -1 and 1 alternating. The osc I built is a metronome with a route alternating between -1 and 1 at a given hertz. But the result doesn't sound like a single square wave, there are some harmonics, almost like having senoidal waves mixed with the square wave.
Experimenting, I noticed a cycle of the resonances going from 1hz to 1378.125hz where it completely stops, like zero hz, or one tick in several, several minutes. Other cycles multiples of this frequency exist, like this:
n=1378.125hz
Cycle0 = 1 to n* 2^0
Cycle1 = n*(2^0) to n*(2^1)
Cycle2 = n*(2^1) to n*(2^2)
Cycle3 = n*(2^2) to n*(2^2)
? Cyclen= n2^(n-1) to n(2^n) ?
C0 and C1 are very similar, with subtle differences, but inside of C2 it seems like 2 times C0 or C1 (I didn't check it, but it sounds like this). Inside C3 there are 3 times, and next, C4, 4 times, and so on, the same cycle but more times and faster in each power of two.
I have made a patch that makes it easy to clone the osc to generate each Cycle. For example, clone 10 times to get audio files from C0 through C9.
Where do the resonances come from? Why these cycles exist? Are they some kind of harmonic series? Why 1378.125hz? Is this expected from the math, or is it a quirk result of some PD object (like inputing very low numbers to the metronome)? Does someone understand why this is happening?
main_oscs_cycles.pd
square-from-scratch-osc.pd used in main
square-from-scratch-osc-lineramp.pd used in main



