Triggering oscillators with an envelope?

Dr. Spankenstein's icon

Is it possible to trigger a set of oscillators so that they all start when an envelope is triggered?

Max Patch
Copy patch and select New From Clipboard in Max.

Many thanks

Rhys

Dr. Spankenstein's icon

I've noticed that if I fiddle with the phase of an oscillator it causes it to stutter but I'm still clueless as to how to go about this.

Is there any way of starting and stopping (i.e resetting) an oscillator perhaps or are they always on even when not connected to a dac~ object?

conorhiggins1601's icon

you can use the begin~ to stop it from playing altogether as well as being processed by max msp.
you can also use an envelope by using line~...

> Date: Mon, 12 Nov 2007 16:50:02 -0700
> From: Spa8nky@hotmail.com
> Subject: [maxmsp] Re: Triggering oscillators with an envelope?
>
>
> I've noticed that if I fiddle with the phase of an oscillator it causes it to stutter but I'm still clueless as to how to go about this.
>
> Is there any way of starting and stopping (i.e resetting) an oscillator perhaps or are they always on even when not connected to a dac~ object?

Download 30 FREE Emoticons for your Windows Live Messenger!
http://www.livemessenger-emoticons.com/en-ie/

lorbi's icon

maybe this is what u r looking for.

Max Patch
Copy patch and select New From Clipboard in Max.

conorhiggins1601's icon

no no first of all you dont really need the loadmess that value is going to be constant anyway thats being sent into the left inlet of the cycle~

what might be easier for you to grasp might be the adsr~ object...check the help on that and it will give you an example and explanation. it lets you send values to it teling it how long you want the attack, decay sustain and release to be, so it will cut out oonce it has finished all the commands youve sent to it. if you are using the line~ object then you can use the message box sendiing it values such. you send them like: [0, 1 1000 .5 500 .2 400 0 100] thats what youd put in the message box. try it out...

Download 30 FREE Emoticons for your Windows Live Messenger!
http://www.livemessenger-emoticons.com/en-ie/

Dr. Spankenstein's icon

Unfortunately begin~, mute~ and adsr~ do absolutely nothing to reset each oscillator so when the envelope is triggered and the sound comes thru it is entirely dependant on when I bang it as to what sound I hear.

Does anyone have any experience with this problem and is there a way of hearing the same sound everytime the envelope in banged?

Thanks very much for all your help.

Rhys

lorbi's icon

what do you mean with "reset the oscillators"?
i think it's a phase problem, no?

try to put the phase at 0 at the same time.
(that's my patch)

byez

L.

conorhiggins1601's icon

how bout using a metro object??? you could set it so that it was being routed through a toggle which could turn on and off an oscillators envelope. but thats entirely dependent then on the value sent to the metro...

> Date: Tue, 13 Nov 2007 07:11:05 -0700
> From: Spa8nky@hotmail.com
> Subject: [maxmsp] Re: RE: Re: RE: Re: Triggering oscillators with an    envelope?
>
>
> Unfortunately begin~, mute~ and adsr~ do absolutely nothing to reset each oscillator so when the envelope is triggered and the sound comes thru it is entirely dependant on when I bang it as to what sound I hear.
>
> Does anyone have any experience with this problem and is there a way of hearing the same sound everytime the envelope in banged?
>
> Thanks very much for all your help.
>
> Rhys

Download 30 FREE Emoticons for your Windows Live Messenger!
http://www.livemessenger-emoticons.com/en-ie/

Stefan Tiedje's icon

Rhys Perkins schrieb:
> Is there any way of starting and stopping (i.e resetting) an
> oscillator perhaps or are they always on even when not connected to a
> dac~ object?

They are always on, and they simply will never know if they are
connected to a dac~ or to anything else.
You would stop an oscillator from oscillating if you give it a frequency
of 0. It would remain on an arbitrary DC (somwhere between -1. and 1.)
till you get it going again with a non-zero frequency...

You probably want an envelope, (and have a deep look into all those
examples coming with Max/MSP...)

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Isosceles_CAT's icon

To me it sounds like he wants to reset the phase of the oscillators at noteon. For example, every time the note is triggered, the oscillator resets to the first value in its table.

lorbi's icon

voil

Dr. Spankenstein's icon

Bingo! CAT and lorbi are bang on the money!

I've been thinking about it (yes I have read through all the relevant tutorials) and I figured that maybe storing the waveforms in a buffer~ and using groove~ to play them back at the same time might work?

Any further ideas guys now we've cleared up the nature of my question (sorry for the confusion).

Rhys

solomonB's icon

Sorry if I misunderstood but why dont use the trigger object to reset the phase before triggering the line~?

>>It would remain on an arbitrary DC (somwhere between -1. and 1.)
till you get it going again with a non-zero frequency...

I know this is irrelevant but wouldn't that be an AC current if it alternating between -1. and 1.?

Peter McCulloch's icon

Yes. Use phasor~ to play back cycle~ using the right inlet of cycle~.
(you don't want to give cycle~ an argument IIRC)

When you trigger the note, send a 0. (or other desired phase) into the
right inlet of phasor~. Since cycle~ outputs a cosine wave, the
appropriate value should be 0.75. Please note that this is note
sample accurate but is more than good enough for LFOs, etc. (and
should not be terribly noticeable on oscillators.) Sample accuracy is
a moving target, because your control-rate input is never sample
accurate. (and it's fine...)

Also, be sure that function (if you're using it) is set to output
coefficients for line~. (set this value in the inspector) If this is
not set, function outputs its coefficients in two parts, rather than
as one long list, and this can cause slight timing differences.
Chances are that the differences you are hearing have less to do with
the phase, and more to do with inaccuracies in the envelope execution.
Adsr~ is a good place to start. I like to take the output of adsr~
and multiply it with itself (squaring it), which gives it a nicer
fade-in and out. (exp, rather lin)

Peter McCulloch

On 11/14/07, Rhys Perkins wrote:
>
> Bingo! CAT and lorbi are bang on the money!
>
> I've been thinking about it (yes I have read through all the relevant tutorials) and I figured that maybe storing the waveforms in a buffer~ and using groove~ to play them back at the same time might work?
>
> Any further ideas guys now we've cleared up the nature of my question (sorry for the confusion).
>
> Rhys
>

--
www.petermcculloch.com