Stop Stream of Bangs after threshold
HI All,
Thanks to all'y'all that responded so quickly with very good guidance. And especially thanks to 'whale-av' for that little bit of brilliant code: [once]. I was able to integrate it and it now works.
The pitch-harmonic content is specific to a dramatic song cycle I am composing, entitled NEUROTICA. In this song that I am composing currently, there is a guitar part that plays a melody on which the guitarist (me) is invited to improvise at times throughout the piece. The pitch content of the melody is: F, G, Ab, A, Bb, B, C, Db, Eb, and E.
This content surely has different pitch centers, under which the chords that I have constructed more/less 'land' when improvising - so cool! If you look inside the subpatches, you will find that there are randomized choices for chords to harmonize the same pitch. For input, I am using a basic University Guitar to MIDI converter, the G2M, made by SONUUS (monophonic, yet chromatic input), but you could plug in any controller and play monophonically. For output, I am routing the midi to an FM8 synth that comes with Kontakt.
NEUROTICA SONG SOLO HARMONIZER.pd
Once last question, Whale-av: In which PD folder do I put your object? You will notice that made a subpatch after copy-pasting the content of your object to make it work. (Please forgive me, as I do not use PD all that often except for very specific creative projects, and I forget the directories/paths.)
Thanks again for all the help! And for those curious, enjoy!
All best, and happy holidays,
D
Interactive pole-zero-diagram for basic filter design
I've been trying to understand some of the basic principles of filter design lately, and here is a result of my modest first attempts in that field. It's a patch demonstrating the effect of different pole and zero locations by (graphically) calculating the corresponding frequency responses.
To avoid confusion, I should probably say some things about how the patch actually works ...
Most importantly, I decided to only use complex filters and to arrange them in conjugate pairs to get real valued outputs at every stage within the cascade of elementary filters. Shortcuts as used in [vcf~] (a one-pole complex filter) aren't possible in this kind of implementation. To get the result corresponding to its left outlet (= real output), you would have to place a (real) zero right in the middle between the two (complex conjugate) poles etc.
The patch allows to use up to six (pairs of) poles or zeros, which may be either real or complex. If less poles or zeros are used, the coefficients of the unused filters are simply set to zero (just as the conjugate poles or zeros are set to zero for the real elementary filters).
By the way: In an earlier version of the patch, I also graphed the phase response of the filter, but I dropped that very soon because I thought this wouldn't be too helpful anyway.
Now for the use: The key control options are explained in the patch itself. Apart from that, you can click and drag the poles and zeros or specify each of its five parameters using the number boxes (values are rounded according to the graphic resolution of one hundredth).
The radii of all poles an zeros are clipped to guarantee stability.
Well, that's about it, I guess.
Bug reports or hints at unexpected behaviour are, as always, very welcome!
Looking for an object like cyclone/togedge but for signals
@jenkutler
The helpfile of [cyclone/togegde~] doesn't work here, but I replicated it's behavior in signalrate like this:

If you want strictly ints, you can add a signalrate [int] like this:

@bocanegra said:
The logical output is signal rate (which can be very useful). If you want bangs look into [threshold~]. You should be able to set that up as a zero crossing detector.
I don't know about [threshold~] never used it, but my example above is not suitable as zerocrossing detector, as the chance of a sample being actually 0 at zero-crossing is very small!
Detecting zero-'crossing' would be a transition from postive to negative or vice versa, or to zero. There is also [zerox~].
The DSP block size will affect the accuracy of the timing though so if you need a bang exactly when your signal crosses zero, you will need to do [block~ 1]
Much later edit: the following is actually wrong, - it is even more complicated (((Message-handling happens in 64-sample periods, only. You can't change that. Even if [threshold~] would go down to 1 sample (still one sample late), the following message-chain won't.))))
EDIT: edited
Improved [shuffle ] external
My friend asked for an enhancement to [shuffle ]. He wanted to be able to add numbers to the random series. I decided to create a new object named [purdie ] which behaves as follows:
- outputs a random series of integers, one for each bang
- the series is initially empty -- there is no initial series of consecutive integers as with the [shuffle ] object
- one or more integers can be added to the series between bangs
- integers already in the series can be removed
- the integers in the series need not be in a consecutive sequence
- the series can be reset to its initial empty state
For convenience, the [purdie ] object can be loaded with a series of consecutive integers provided by another new object named [seq ], optionally with only one bang.
Trying to reproduce a sound with Pd
@jameslo Analog components all have tolerances, +- 10% is not uncommon for pots, so any of the knobs between the two modules could be 20% off from each other given a worse case scenario, plus all those other components in the module could make it even further off, Generally circuits are designed to minimize the effects of component tolerances and high tolerance parts will be used in critical locations like frequency but amplitude and PW are not critical location, our ears will not notice small differences here. On top of that components age and their value changes, so two 30 year old modules can be very different despite once being identical. Things like phase and frequency are not constants in the analog world, things drift and oscillators which share a power source tend to sync when they get close. Most have to be very close in frequency to sync this way, the beat frequency will be well under 1hz but under certain situations you can hear it if you listen close. When trying to copy a patch from the analog world in the digital, knobs can only be used as a rough guide, need to use your ears.
When you distorted the wave you added harmonics and changed the strengths of the old harmonics, only harmonics of equal strength but opposite phase will cancel fully. You most likely did have cancellation just not full cancellation (depends on how you distorted it). Put both oscillators to the same frequency and opposite phase, listen to the distorted one and then add in the undistorted oscillator, you should hear a decrease in harmonic content from the cancellation. This will be most apparent with low to moderate levels of distortion, the more distortion, the more harmonics you are adding, the less the two waves have in common, and as a result less gets canceled.
Edit: didn't quite finish that last sentence.
Is absolute phase audible?
My friend who is a much more experienced synthesist than I was telling me how important it was to consider whether the oscillators were synchronized with the gate (and if so, at what phase angle) because it affects the time-domain shape of the attack. He also said that his FFT-based spectrum analyzer showed no change even as the attack shape changed, but that you could still hear the difference.
I was doubtful because my understanding has always been that the ear can’t hear absolute phase and so that’s why, in additive synthesis, even if you randomize the phase of the harmonics, things should still sound the same. It’s particularly striking with squares and ramps; get the phase of even one harmonic wrong, and it looks like something completely different on a scope.
So I wrote a test in Pd, and while I don’t hear any differences in attack, I do hear differences in tone as the phases of the harmonics change. If you’re interested, try my test for yourself. I’m approximating a ramp using 50 harmonics, and you can control the phase of each harmonic using the phaseTable. Trigger the AR envelope with and without sync and see if you can hear a difference. Next, open up the gate so you get a steady tone and play with the phaseTable. You’ll hear the timbre change subtly, especially when changing the lower harmonics. Now I’m not sure I could tell you what phase I’m hearing in a double-blind test, but I do hear a difference. So am I wrong that the ear can’t hear absolute phase? And if I’m not wrong, why do I hear a difference? It sounds different on different speakers/headphones/earbuds so I’m guessing it has to do with asymmetries between the positive and negative excursions of the diaphragm?

additiveSaw~.pd
harmonic~.pd
NoxSiren - Modular synthesizer system <- [v15]
NoxSiren is a modular synthesizer system where the punishment of failure is the beginning of a new invention.
--DOWNLOAD-- NoxSiren for :
-
Pure Data :
NoxSiren v15.rar
NoxSiren v14.rar -
Purr Data :
NoxSiren v15.rar
NoxSiren v14.rar
--DOWNLOAD-- ORCA for :
- x64, OSX, Linux :
https://hundredrabbits.itch.io/orca
In order to connect NoxSiren system to ORCA system you also need a virtual loopback MIDI-ports:
--DOWNLOAD-- loopMIDI for :
- Windows 7 up to Windows 10, 32 and 64 bit :
https://www.tobias-erichsen.de/software/loopmidi.html
#-= Cyber Notes [v15] =-#
- added BORG-IMPLANT module.
- introduction to special modules.
- more system testing.
#-= Special Modules [v15] =-#
- BORG-IMPLANT (connects ORCA MIDI system to NoxSiren system)
#-= Current Modules [v15] =-#
- VCO (voltage-controlled-oscillator)
- VCO2 (advance voltage-controlled-oscillator)
- WAVEBANK (additive synthesis oscillator)
- ADSR (Attack-Decay-Sustain-Release envelope)
- C-ADSR (Curved Attack-Decay-Sustain-Release envelope)
- CICADAS (128 steps-Euclidean rhythm generator)
- CICADAS-2 (advance 128-steps polymorphic-Euclidean rhythm generator)
- COMPRESSOR (lookahead mono compressor unit)
- DUAL-COMPRESSOR (2-channel lookahead mono compressor unit)
- STEREO-COMPRESSOR (lookahead stereo compressor unit)
- MONO-KEYS (virtual 1-voice monophonic MIDI keyboard)
- POLY-KEYS-2 (virtual 2-voice polyphonic MIDI keyboard)
- POLY-KEYS-3 (virtual 3-voice polyphonic MIDI keyboard)
- POLY-KEYS-4 (virtual 4-voice polyphonic MIDI keyboard)
- POLY-KEYS-5 (virtual 5-voice polyphonic MIDI keyboard)
- POLY-KEYS-6 (virtual 6-voice polyphonic MIDI keyboard)
- BATTERY (simple manual triggered machine for drumming.)
- REVERB (reverb unit with lowpass control)
- STEREO-REVERB (stereo reverb unit with lowpass control)
- RESIN (advanced rain effect/texture generator)
- NOISE (generates black,brown,red and orange noise)
- NOISE2 (generates yellow,blue,pink and white noise)
- COBALT (6-stage polyrhythm generator)
- SHAPER (basic shaper unit)
- FOLDER (basic wave folding unit)
- STEREO-FOLDER (stereo wave folding unit)
- DUAL-FOLDER (advance wave folding unit)
- POLARIZER (transform a signal into bi-polar, uni-polar, inverted or inverted uni-polar form)
- CLOCK (generates a BPM clock signal for sequencing other modules)
- CLOCKDIVIDER (a clock divider with even division of clock signal)
- CLOCKDIVIDER2 (a clock divider with odd division of clock signal)
- DELAY-UNIT (delay unit)
- STEREO-DELAY (stereo delay unit)
- CHORUS (chorus unit)
- STEREO-CHORUS (stereo chorus unit)
- SEQ (advance 16-step/trigger sequencer)
- KICK (synthesize kick unit)
- KICK2 (synthesize flavor of KICK module)
- KICK3 (synthesize flavor of KICK module)
- SNARE (synthesize snare unit)
- CLAP (synthesize clap unit)
- CYMBAL (synthesize cymbal unit)
- RAND (RNG generator for other modules parameters)
- FMOD (feedback modulation unit)
- AM (amplitude modulation unit)
- RM (ring modulation unit)
- LFO (low-frequency-oscillator)
- LFO2 (advance low-frequency-oscillator)
- COMBINATOR (combine two waves)
- COMBINATOR2 (combine three waves)
- COMBINATOR3 (combine four waves)
- STRING (Karplus-Strong string synthesis unit)
- STRING2 (advance Karplus-Strong string synthesis unit)
- DETUNER (parametric 4-channel detuner unit)
- CRUSHER (basic audio resolution unit)
- STEREO-CRUSHER (basic stereo audio resolution unit)
- DUAL-CRUSHER (advance audio resolution unit)
- FILTER (basic filter)
- VCF (voltage-controlled-filter)
- MAR (Moog-analog-resonant filter)
- VCA (voltage-controlled-amplifier)
- DUAL-VCA (advance voltage-controlled-amplifier)
- FMUX (multiplexer with fast A/D internal envelope)
- MMUX (multiplexer with medium A/D internal envelope)
- SMUX (multiplexer with slow A/D internal envelope)
- FDMX (demultiplexer with fast A/D internal envelope)
- MDMX (demultiplexer with medium A/D internal envelope)
- SDMX (demultiplexer with slow A/D internal envelope)
- MIXER (mix 1-4 possible waves)
- SCOPE (oscilloscope analyzer)
- MASTER (fancy DAC~)
- BOX (useless decorative module)
NoxSiren integrated modules menu system.

Smooth frequency transition
you should use a logarithmic line~ object to adjust the curve as smooth as you want.
On top of that you should apply a Nyquist correction to the output of your oscillator abstraction.
So here you have some imagines how to do that. The Nyquist abstraction is used in the output of the triangle oscillator abstraction as an example. Then the final output can be controlled with a logarithmic line~ object.
OBS : If you need more then one oscillator you can apply this for each oscillator and then use a mixer and then the output of the mixer you use again the same idea. In this way you have an oscillator smooth stage control and a final mixer stage control for extra smoothness.
This is just the simple mono smooth control (no curve adjustment)

The same idea but as a stereo version

Here is with logarithmic smooth control (with curve adjustment)

Here you have a Nyquist correction abstraction

Here you have a triangle oscillator with Nyquist correction

You can also download xline~ which is an object that is doing just that :
https://forum.pdpatchrepo.info/topic/13084/xline-logarithmic-line-object
is there an "if" object? or "if then"?
HI,
I have a problem I've dealt with in max, using an "if" object. I always assumed there was one in Pd, but I can't find one.
I'm trying to resolve this with regular vanilla type objects, but the solution is escaping me.
I have 5 number boxes, each one is sending mostly 0. When a non-zero number comes from one of the number boxes I want that to be output, and all the zeros be ignored.
In Max, in my "if" object I have this:
[if ($i1 == 0) && ($i2 == 0) && ($i3 == 0) && ($i4 == 0) && ($i5 == 0) then zero else out2 $i1 $i2 $i3 $i4 $i5]
The object has 5 inlets and two outlets, one for zeros and one for all the other values.
I guess I could do this with a [sel 0] object and take the right outlet, to filter out all the zeros. But just curious if there is a more elegant way someone can think of.
Thanks, nick
Converting audio signals to binary with no externals ?
@seb-harmonik.ar , @whale-av Many thanks for help. So what i want to do is this :
i want to have 2 oscillators (both sine waves. one a carry oscillator and the other one a modulator) with different frequency. And i want their audio signal to be processed in [expr~ ] using bitwise XOR modulation. This is different from [+~] , [-~] , [*~] , [/~]. This paper describes this in detail.
Here is a plot of the waveform result using bitwise XOR (from the paper above) :

Here is a schematic view of the oscillator structure :
So to control both oscillators i need to control the theta (phase) , f (frequency) and A (linear amplitude). Also S1 is unipolar. So the idea is that i can use the basic operations on the audio signals like (addition,multiplication,bitwise OR,bitwise AND) or i can use something different (bitwise XOR). So i tried to make somehow the bitwise XOR using a formula : bitwise XOR equivalent <- (S1 | S2) - (S1 & S2) (not working). The bitwise operations like "&" and "|" works for [expr] not [expr~].

Also i just found this about [expr~ ] object so maybe i am missing something or i am wrong
What is this operator "^" it is bitwise XOR ? or exponential ? or something else ?

Thanks to all a lot for the help. I also tried what @alexandros was talking about and it is almost working. But the waveform is really off so i need to learn more about this idea.


