MIDI activated envelopes
@Samuel said:
- Is playing synths from a keyboard something that Pd people just do not do? Those who need this use Csound or SC?
People do it all the time. I don't think the developers use MIDI so much, though, but I got a similar impression about the Csound developers as well.
- Or do all Pd users immediately install the RjLib after installing Pd, and use RjLib all the time?
No, Pd users just make their own envelopes. An ADSR envelope isn't too difficult to build with the vanilla objects, and Miller doesn't seem too into the idea of piling on "unnecessary" objects if you can already build them as abstractions. He even provides an example in 3.audio.examples -> D02.adsr.pd.
RjLib, as it happens, is entirely abstractions built from vanilla objects.
MIDI activated envelopes
Sorry to repost about this, but there is something I'm not getting.
In Csound and SuperCollider (as in any VST instrument, etc.), there are standard, built-in mechanisms for MIDI-activated envelopes -- meaning playing synths from a keyboard.
In Csound, it's the 'r' family of line and envelope opcodes. In SuperCollider, it's the 'gate' parameter of the EnvGen UGen.
What these do is:
- start the envelope when you press a keyboard key,
- keep the sustain level as long as you hold the key,
- engage the release segment of the envelope when you release the key (ie Note Off MIDI message).
When I posted about this ealier, someone kindly pointed me to the [c_adsr] object in RjLib. But RjLib is part of neither Pd vanilla nor Pd extended.
Leading me to ask:
-
Is playing synths from a keyboard something that Pd people just do not do? Those who need this use Csound or SC?
-
Or do all Pd users immediately install the RjLib after installing Pd, and use RjLib all the time?
-
Or does Pd have another mechanism for MIDI-driven envelopes that I'm unaware of and that everybody uses?
Thanks very much.
I'd be very curious to know if other Pd users have asked themselves the same question.
Phasor~ as index to tabread~ with del and line~ envelope glitch
Hey
I'm using phasor for an index to a tabread~ to play a sample.
I'm also using line~ as an envelope to control audio output.
The timing for the envelope is set by the size of the sample size and samplerate~ as well as the frequency for the phasor~.
The magnitude of the phasor is adjusted to the sample size.
The sample player can be re-triggered and when this happens a line~ is set to go to 0 in 5ms,
a delay is set for 5ms,
then bangs another line~ to go to velocity in 0,
as well as setting phasor~ frequency to 1/t and phase to zero.
At which time another delay is setup at samplelength in ms.
After the sample is played the phasor~ frequency is set to 0 then
another line~ to 0 in 5ms is sent to the [*~] .
This causes a glitch when the sample is retriggered because the phasor~ is reset to zero and starts replaying the sample.
This glitch can not be heard when the sample is not re-triggered so maybe it's a control vs signal timing issue.
I did hear the glitch at the end of the sample re-triggered or not using vline~.
So my question is how do you do audio rate envelope triggering of envelopes ? I would post the patch but it is a mess. A good answer or pointer to some reference material would be greatly appreciated. I haven't quite wrapped my head around the sample and hold sampler examples yet.
Tremolo effect on saw, square waveforms?
just had a short look at the patch, but cant't figure out the function of the double casting of the slider values - first it's getting casted to float, then again to integer. if you only use the right inlet as storage and you want an integer to output you can only use the _object, without casting to a float before.
you also get error messages in the pd window, because the [select 0] object in the adsr subpatch receives bang-messages it can't handle (from the [t f b] before the [send adsr_bang]). this will not work properly.
btw, a tremolo is - afaik - a pitch modulation, not an amplitude modulation.
i attached a little ahdsr-envelope abstraction, using vline~.
Tremolo effect on saw, square waveforms?
Hi guys,
for the adsr, you'll need to bang it every time you make a note. So you can link the left output of your metro (when you use the sequencer). Or you could send a bang each time you send a frequency, (will enable you to filter zeros, and send a note only when there's an actual note here)
So before your you can do like this :
[mtof]
l
[t f b]
l l
l
this way each time a frequency will be sent a bang for the adsr env will be send just before. (see the help file of trigger which is usefull for sequencers).
You'll need to create an object [r adsr-bang] and plug it in the first inlet of your [pd adsr] subpatch. Btw your adsr subpatch does a line~ object.
For the loadbang you just need to create one loadbang anywhere, then you link messages to it :
[loadbang]
l
[10(
l
at the openning of the patch the loadbang will send a bang to its output thus sending the value 10, now you just have to create the according receive object.
Have fun
Having trouble with my adsr
Well it's difficult to answer, maybe if post your patch.
some basics about adsr :
ADSR will control amplitude of your sound it needs to be connected to the right inlet of a *~ object and triggered each time you want sound. the left inlet will take the outlet of your dsp part.
you can try the attached adsr which uses pack before sending values to the line object
Having trouble with my adsr
I have created an adsr to further my control over my piece, however it does not seem to work. all that I did was go to the browser and find the adsr patch (3.audio.examples/D02adsr.pd), I copied and pasted that patch into my patch then added faders and plugged them into the inlets assuming that they went in the order: peak, attack, decay, sustain, release. However when I trigger the envelpoe, nothing happens, it also doesn't show the envelope in the graph. I have a fader for the main level of the adsr as well.
The main outlet for the adsr is plugged into the last [*~] before the [dac]
any suggestions on how I can make it work?
Thank you
Beginner's pd: striking a note. smarter way?
When using [line~] that's more or less it. [vline~] allows you to add a delay time to the message so you can schedule several ramps at once. To truly harness this, though, it would help to understand lists in Pd. Check out this tutorial on using lists and [vline~] to make an adsr envelope generator, if you're interested:
http://www.footils.org/cms/weblog/2009/mar/21/adsr-envelopes-pd/
Trubble with adsr objects!!!
Im having trubble with the tutorial called: D02.adsr.pd... and all of the other tutorials using adsr-objects.
the problem is that the adsr dont want to be created. as if adsr is spelld in a wrong way.
Or like its not a object that PD knows of (hopefully you know what im talking about).
are there any one how knows what i can do, to do it right. or what is wrong with my adsr object.
-Kh Mads
Transdetect~ and transcomp~: transient shaping and detection
transcomp~ uses transdetect~ to shape the initial attack and release of a signal.
Requires IEM's FIR~, fexpr~ and dbtorms~ which are provided in PD-Extended.
To work properly the transdetect folder should be added to PD's path.
Start by opening help-transcomp~.pd
01 Implementation:
transdetect~ works by using two pairs of envelope followers. The first pair
subtracts an envelope follower with a slow attack from an accurate follower,
the result of which is a signal containing the initial attack. For the initial
release, the second pair subtracts an accurate envelope follower from one with
a slow release.
An envelope follower measures the mean square power of a signal over time
(see 3.audio.examples/H06.envelope.follower.pd for details on implementing an
envelope follower). To do this we must use a low pass filter at a very low
frequency. In order to achieve an accurate follower a linear phase FIR filter
was used (using IEM's FIR~ external). Unfortunately this introduces a phase
delay.
In order to facilitate the use of different envelope follower implementations,
transdetect~ requires a filter type as a creation argument implemented in
followernameTransDetectEF~.pd. 4 linear phase fir implementations are provided:
181, 251, 451 and 501 taps filters. The 501 taps filter provides the most
accurate filter but with a phase delay of 5.668 ms at 44.1kHz (raise the
sampling rate to lower the phase delay). They were all generating using
http://www.dsptutor.freeuk.com/FIRFilterDesign/FIRFiltDes102.html with a
cutoff frequency between 5 and 10 Hz.
A compromise between accuracy and phase delay might be achieved by using
minimum phase FIR filters. A 5th implementation using PD's native lop~ object
is also provided under the designation iir (FIR~ not required).
Along with different possible envelope follower implementation transdetect~
also requires an attack and hold type implemented in
attacknameTransDetectAttackShape~.pd and holdnameTransDetectHoldShape~.pd
respectively. These implementations dictate the kind of attack and release
curves used on the envelope followers (linear, slow[er|est] and fast[er|est]).
All implementations provided use fexpr~. A more efficient external could be
made to take fexpr~ place.
02 Use
In help-transcomp~.pd patch enable start and pay attention to the snap in the
hit. Disable the green toggle button to disable the compression make the snap
go away. Check out the tables on the left to see the results of the transient
compression.
transcomp~ is useful when used with recorded drums to maximize or minimize
its transient (to make it punchier or to make snare drums less clappy).
transcomp~ uses transdetect~. By itself transdetect~ can be used to synthesis
hits from a recording. For example, take a bass drum recording and use the
signals generated by transdetect~ to shape the frequency and envelope of a
synthesized kick drum.
Would love to have some feedback and some help in turning the linear phase filters into minimum phase filters.