Understanding ELSE's envgen~
@mjmogo said:
My only issue now is that I need an envelope that doesn't assume you are starting at zero on the envelopes...
Do you, though?
Typically, if you gate-on an ADSR before the release phase has reached 0, it will ramp up from its current output level. Maybe you think that's undesirable, but: jumping to 0 at gate-on may produce a discontinuity in the output. This is generally bad. For this reason, I would almost never force an envelope to jump to 0, unless I was sure it's already silent (but if it's already silent, then the jump wouldn't be necessary ๐ค ).
Consider very carefully whether you really need to force an onset volume.
Looks like using else/function as an editor for what I need won't work, because it always has the initial value at the start of the list.
You can use pd list manipulation objects to refashion the list as you like, before passing it to envgen~. There's absolutely no reason why function's output should be considered untouchable.
hjh
Understanding ELSE's envgen~
I've recently been looking into the ELSE library, and specifically the envgen~ object. In creating a simple ADSR-like envelope, I was trying to set the 'suspoint', and found some curious behavior.
In using the following list for the breakpoints, and setting the suspoint to 3,
[0 100 1 300 .7 1000 .2 3000 0 (
when I execute this it starts the envelope and it stops when it gets to the .7 value, and when it is released, it immediately goes to the last stage, bypassing the .2 value.
But when I set the suspoint to 4, the envelope operates properly and stops at the .2 value. Then when I release the envelope, it just stays at the .2 value, and does not execute the last stage.
Next I tried to add one more stage and run using the same suspoints of 3 and 4... when I run it with stage 3, upon release it uses the time from the following stage (segment 4), not the last.
Am I missing something here? It seems to me that the first one (set to stage 3) is operating correctly, but when the stage is set to 4, it ignores the last stage upon release.
Help with audio patch on off based on some condition
@KMETE said:
One reason I needed to use the loop 1 message is that the track was always paused for some reason before it ends when no in loop mode.
Ohhhhhh... now I see what it is.
When you ask sf-play(2)~ to play a timed region, it also runs a timed envelope. When you pause / resume, the playback timing doesn't match the envelope timing, so the envelope closes before the end of the source audio.
I'd rather not complicate sf-play(2)~ to allow the envelope to be disabled. But you can back out of one layer of abstraction and use play~ directly.

play~ doesn't take "start end rate" lists like sf-play~ does -- but I have a translator object for that. Since there's already a [pd] subpatch to translate "start/resume" messages, I'd just stick the play translator in there:

Now there's no timed envelope and you should get the play~ native pause/resume behavior without interference (I hope
).
hjh
Vline~
@ddw_music said:
@gentleclockdivider said:
So when I have two separate messages 1 0 1000 , and 0 0 1000 , both messages will wait for 1000 ms and have the exact same behaviour as when clicking the toggles ( see screenshot )
Do you want the envelope segments to run at the same time?
No. You want one after the other.
Therefore the two times should not be the same.
Making them both 1000 means it will of course not work.
Putting two messages into one message is afaik separated by a comma , this just does not work
It absolutely does work. Here, there's one message box with two messages in it, and you clearly see two envelope segments being drawn.
hjh
Now change that delay time time for the attack stage to 1000 , it won't work anymore
Vline~
@gentleclockdivider said:
So when I have two separate messages 1 0 1000 , and 0 0 1000 , both messages will wait for 1000 ms and have the exact same behaviour as when clicking the toggles ( see screenshot )
Do you want the envelope segments to run at the same time?
No. You want one after the other.
Therefore the two times should not be the same.
Making them both 1000 means it will of course not work.
Putting two messages into one message is afaik separated by a comma , this just does not work
It absolutely does work. Here, there's one message box with two messages in it, and you clearly see two envelope segments being drawn.

hjh
Best way to avoid clicks (tabread4~)
Amplitude modulation of any sort, including envelopes, always distorts the spectrum to some extent.
Normally we don't notice because typical sounds have a complex spectrum, which masks the distortion.
But here, you are applying it to an artificially simple spectrum, containing only DC offset. DC offset is silent, and the spectral distortion is not, so there is nothing to cover it.
I generated an audio file with a 30 ms ramp up and 50 ms ramp down. For comparison, I applied this envelope to a sine wave in the right channel. Then I opened this file in Audacity and looked at the spectrogram.

I think it's pretty easy to see here why the envelope might be audible in the case of DC * envelope, but not perceptible in the case of the audible signal * envelope.
Bottom line is, just because you hear spectral distortion in an artificial scenario which you would never encounter with audible signals, doesn't mean that it will be noticeable in real world scenarios.
(Carrying it further: If there is no envelope, there's a risk of an instantaneous transition from non-zero to zero or vice versa. Instantaneous transitions require a lot of high-frequency content, which we hear as a click. A linear transition effectively lowpass-filters the instantaneous transition -- there are still artifacts, but they are relatively low amplitude, and in a frequency range normally occupied by musical tones at a much higher amplitude. A ramp-enveloped sound will never be perfect, but it's better than a rectangular envelope.)
"replaced by something better" -- A sinusoidal envelope shows a smoother spectrogram. You might try that: cos * 0.5 + 0.5 -- from pi to 2pi is your ramp up, 0 to pi is the ramp down.
Edit: You can eliminate the +0.5 by squaring the cos and halving theta, because cos^2 x = cos(2x) * 0.5 + 0.5. Actually cos~, IIRC, scales radians down to 0 .. 1, so you could do line~ --> cos~ --> [*~] (cos~ to both inlets) and drive it by "0.25, 0.5 30" for the ramp up, and "0, 0.25 50" for the ramp down. Haven't verified this at the computer but I think it's right.
hjh
ADSR and [poly], weird behaviour
Hello!
I'm pretty new to PD and have been building my first polyphonic synth for the last couple of days.
I use [poly] with 10 voices and send note number and velocity to the oscillators and only velocity to the envelope.

Before last night I could press and hold a key on my Beatstep Pro and the note would keep playing until I let go, at which point the release kicked in.
Same if i pressed multiple keys on the BSP.
For some reason this changed last night without me touching the ADSR.
I can see that velocity 0 reaches the ADSR and on the right channel, but if I don't release the key before the sustain is finished the note will just cut off. This is probably because it needs velocity 0 to trigger the release, but it doesn't explain why I can't hold the keys anymore.
To make even more weird, sometimes when I hold a key it works...
Any idea why this happens?
If you want, I can post the whole patch but the problem seem to be in the ADSR.
Also, I'm running vanilla.
Peace!
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.

1p24p(sin): one midi ctrlin used to control 4 parameters via sine curves of different frequency
The abs synchronizes one line and three sine curves using the controlling knob/cc's values (between 0 and 127), i.e. the input, as their angle and their frequency dependent on which sine curve (2^n). Thus, it captures all combinations, just with fewer possible values depending on which sine curve is assigned to which outlet.
1p24p(sin).pd
1p24p(sin)-help.pd
adsr.pd
It takes 5 creation arguments:
$1 the identifying index for the abstraction
and
$2,$3,$4,$5 to determine which outlet receives which frequency/input. So, if used, for instance, with an adsr then [1p24p(sin) 1 0 1 2 3] then "a" would have 127 possible values, d 64, s 32, and r 16. Where as, in the case of ]1p24p(sin) 1 3 2 1 0] r would have 127, s 64, d 32, and a 16.
While it does limit the possible values for the controls/parameters to [127,64,32,16] (respectively) it offers a Lot of flexibity (as the -help file shows) and is very easy to understand.
So basically, for example, in a given synth setup using the abs as input and only 2 knobs/cc you control 16,129 (127^2) adsr presets.
The state chart is as follows (where๐บ๐ปrepresents a value going either up or down, and each arrow represents a set of 16 possible values).
parameter:
0 1 2 3
๐บ๐บ๐บ๐บ
๐บ๐บ๐บ๐ป
๐บ๐บ๐ป๐บ
๐บ๐บ๐ป๐ป
๐บ๐ป๐บ๐บ
๐บ๐ป๐บ๐ป
๐บ๐ป๐ป๐บ
๐บ๐ป๐ป๐ป.
I hope this is easy to understand and that it might "serve(s) you well".
Love through Music,
-S
Let me know if you need help with this. I will (power allowing:-)) be happy to oblige.
p.s. the help files offers a lot of information and two examples (the classicsynth-help and 4 arrays to visually show what's happening).
adsr(1p): adsr envelope controlled with only 1 ctrlin knob (for 81 states)
In case anyone else may need such a thing...
adsr(1p).pd
J08.classicsynth.pd
Here is the Miller/Help adsr with an added layer, such that, all 4 parameters can be controlled via one value, [0..127], in other words one midi [ctrlin].
It is mapped such that it includes all possible 81 combinations (of 3 values per parameter).
It takes a list of 12 values (on the right most inlet) to set the 3 values/parameter.
And the 2nd from right inlet as the ctrlin, i.e. [0..127] value, to change the values.
It includes a (far) right outlet indicating which of the 81 states the adsr is in.
"May it serve you well."
Sincerely,
Scott
p.s. While sacrificing granularity, it makes up for it with compactness. Since, given only two knobs (one for filter and one for amp), I get 6561 comibinations.
p.p.s. As long as, I (the user) enters 12 appreciated values for the values list. 


