Forums > MaxMSP

extracting an impulse from phasor

September 7, 2007 | 2:06 am

Hi folks,

I need to extract an impluse from a phasor ramp in order to trigger one of Eric Lyon’s objects. I’m currently using edge~ to get a bang from the ramp and then into click~, but it’s not elegant, accurate, or efficient.

Thanks,
Huntley


September 7, 2007 | 3:13 am

Quote: Huntley Miller wrote on Thu, 06 September 2007 20:06
—————————————————-
> Hi folks,
>
> I need to extract an impluse from a phasor ramp in order to trigger one of Eric Lyon’s objects. I’m currently using edge~ to get a bang from the ramp and then into click~, but it’s not elegant, accurate, or efficient.
>
> Thanks,
> Huntley
>
>
—————————————————-

i know this problem well, from various situations.

it is not possible.

due to the fact that phasor~ is interpolating as soon as it is running faster than system samplingrate, there is no transition from 1. to 0. at a sample of the system samplingrate anymore – the transition happens somewhere between 2 samples – so you cant convert it into a spike.

i have never found a solution so i try to organize things differently already on the machine model layer.
replacing cycle~ or phasor~ with line~ for example does not help much, as line~ does not take signal input …

sometimes a system where stuff is running two times and you fade between them can help around this logic problem (do you know vdb~ and its brothers?)

-110


September 7, 2007 | 6:07 am

Maybe I misunderstand your problem, but this is what I do.
Let me know if it helps…

max v2;
#N vpatcher 487 145 1087 545;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 190 177 39 196617 >~ 0.5;
#P user scope~ 58 225 188 355 8 3 128 -1. 1. 0 0. 0 0. 102 255 51 135
135 135 0;
#P user ezdac~ 381 269 425 302 0;
#P user scope~ 190 225 320 355 8 3 128 -1. 1. 0 0. 0 0. 102 255 51 135
135 135 0;
#P newex 190 154 27 196617 !-~;
#P newex 207 130 58 196617 delay~ 1 1;
#P flonum 190 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 190 98 70 196617 phasor~ 172.;
#P connect 0 0 6 0;
#P connect 1 0 0 0;
#P connect 0 0 3 0;
#P connect 3 0 7 0;
#P connect 7 0 4 0;
#P connect 0 0 2 0;
#P connect 2 0 3 1;
#P pop;

- Luigi

— Roman Thilenius wrote:

>
> Quote: Huntley Miller wrote on Thu, 06 September 2007 20:06
> —————————————————-
> > Hi folks,
> >
> > I need to extract an impluse from a phasor ramp in order to trigger
> one of Eric Lyon’s objects. I’m currently using edge~ to get a bang
> from the ramp and then into click~, but it’s not elegant, accurate,
> or efficient.
> >
> > Thanks,
> > Huntley
> >
> >
> —————————————————-
>
>
> i know this problem well, from various situations.
>
> it is not possible.
>
> due to the fact that phasor~ is interpolating as soon as it is
> running faster than system samplingrate, there is no transition from
> 1. to 0. at a sample of the system samplingrate anymore – the
> transition happens somewhere between 2 samples – so you cant convert
> it into a spike.
>
> i have never found a solution so i try to organize things differently
> already on the machine model layer.
> replacing cycle~ or phasor~ with line~ for example does not help
> much, as line~ does not take signal input …
>
> sometimes a system where stuff is running two times and you fade
> between them can help around this logic problem (do you know vdb~ and
> its brothers?)
>
>
> -110
>
> –
> http://vst-mac.info/
>

————————————————————
THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. ANY UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE SENDER BY E-MAIL AT SUPERBIGIO@YAHOO.COM AND DESTROY ALL COPIES OF THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC1-207.
————————————————————

Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7


September 7, 2007 | 7:21 am

On 07 Sep 2007, at 04:06, Huntley Miller wrote:

>
> Hi folks,
>
> I need to extract an impluse from a phasor ramp in order to trigger
> one of Eric Lyon’s objects. I’m currently using edge~ to get a bang
> from the ramp and then into click~, but it’s not elegant, accurate,
> or efficient.

[phasor~] => [delta~] => [< ~ 0] ===> unit impulse at start of the ramp.

vb


September 7, 2007 | 8:53 am


September 8, 2007 | 2:50 am

Thanks for all the replies! Greatly appreciated.


September 8, 2007 | 8:26 am

Roman Thilenius schrieb:
> Quote: Huntley Miller wrote on Thu, 06 September 2007 20:06
> —————————————————-
>> I need to extract an impluse from a phasor ramp in order to trigger
>> one of Eric Lyon’s objects.
>>
>
> i know this problem well, from various situations.
>
> it is not possible.

I’ve always used change~ for the various situations… ;-)

Just to add another possibility…

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 154 132 50 196617 ==~ -1;
#P newex 154 101 49 196617 change~;
#P user scope~ 22 165 145 248 8 3 128 -1. 1. 0 0. 1 0.1 102 255 51 135
135 135 0;
#P user ezdac~ 232 120 276 153 0;
#P user scope~ 154 165 277 248 8 3 128 -1. 1. 0 0. 1 0.1 102 255 51 135
135 135 0;
#P flonum 154 48 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 154 68 70 196617 phasor~ 110.;
#P connect 0 0 4 0;
#P connect 0 0 5 0;
#P connect 1 0 0 0;
#P connect 6 0 2 0;
#P connect 5 0 6 0;
#P window clipboard copycount 7;


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


September 8, 2007 | 10:19 pm

> > it is not possible.
>
> I’ve always used change~ for the various situations… ;-)

ja ja, but it stops working as soon as the phasor~ or cycle~ runs faster than runtime rate.

i run into this often when building oscillators. you need to sync stuff at timepoints which do not exist between but only _inside objects (like cycle~ or wave~).

-110


September 9, 2007 | 11:29 am

roman, i don’t get why you really want to trigger something faster than 1/4 samplingrate? i think we are talking more of a control signal here, with the phasor operating in frequencies of rhythm…

micha


September 9, 2007 | 9:32 pm

Roman Thilenius schrieb:
> ja ja, but it stops working as soon as the phasor~ or cycle~ runs
> faster than runtime rate.

What is runtime rate??? I never patch when moving faster than light…

Stefan


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


September 9, 2007 | 11:13 pm


September 10, 2007 | 9:41 am

hm, i guess that this is hardly audible…i mean, if you ramp from -1 to 1 in 2 (skiping one sample) or 3 samples, i don’t think that it will make such a great difference. also if you use wave~, you get an interpolated result.

i would be really interested in an example of this, and yes, triggering logic on the audio level is still an interesting topic.

nevertheless, i think that what you mentioned does not apply to huntleys problem, looked more like he needed a simple click to trigger something…

all the best

micha


September 10, 2007 | 4:52 pm

>also if you use wave~, you get an interpolated result.

the problem is all about that wave~ does not interpolate when you change the start and end points.

here is a very basic model of a wavetable oscillator which has 2 waves.
the next step in such a patch would be to make sure that changes to the wavetable number will only be made at exactly the first sample of the each wave.

i am happy to announce that my buddy from france will now show us how to use [change~] to find the right moment for switchig to another wave. (feel free to remove cycle~ and use phasor~ instead)

max v2;
#N vpatcher 70 225 761 806;
#P message 472 106 50 196617 read;
#P newex 472 129 145 196617 buffer~ frenchfries;
#B color 5;
#P toggle 24 431 15 0;
#P newex 62 447 50 196617 dac~;
#P message 388 309 129 196617 20.408164 40.816327;
#P message 388 334 129 196617 second wave;
#P message 296 334 87 196617 first wave;
#P newex 196 353 50 196617 sig~;
#P newex 129 325 77 196617 unpack 0. 0.;
#P message 296 309 87 196617 0. 20.408164;
#P newex 129 353 50 196617 sig~;
#P newex 62 383 145 196617 wave~ frenchfries;
#B color 5;
#P newex 62 201 103 196617 cycle~ WLphasor;
#B color 5;
#P newex 62 142 51 196617 mtof;
#B color 5;
#P user kslider 62 81 54 0 36 48 31 12 0 128 128 128;
#P newex 62 164 50 196617 sig~;
#N vpatcher 36 604 403 945;
#P newex 68 257 124 196617 buffer~ WLphasor 100.;
#B color 5;
#P newex 127 154 69 196617 / 512.;
#P newex 206 67 69 196617 loadbang;
#P newex 68 179 69 196617 pack 0 0.;
#P newex 68 221 124 196617 peek~ WLphasor;
#B color 5;
#P newex 68 129 69 196617 t i i;
#P newex 68 106 69 196617 line 0. 10.;
#P message 68 85 69 196617 0 , 512 5120;
#P connect 5 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 2 1 6 0;
#P connect 6 0 4 1;
#P pop;
#P newobj 470 49 100 196617 p makephasor;
#B color 6;
#P user panel 276 285 260 87;
#X brgb 255 255 255;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 3 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 6 0;
#P connect 15 0 14 0;
#P connect 6 0 14 0;
#P connect 13 0 9 0;
#P connect 8 0 9 0;
#P connect 9 0 7 0;
#P connect 7 0 6 1;
#P connect 9 1 10 0;
#P connect 10 0 6 2;
#P connect 17 0 16 0;
#P pop;


September 11, 2007 | 9:54 am

> the problem is all about that wave~ does not interpolate when you change the start and end points.

then why not use two wave~ objects (with fixed start and end points) and crossfade them?


September 11, 2007 | 4:37 pm

Quote: micha wrote on Tue, 11 September 2007 03:54
—————————————————-
>
> > the problem is all about that wave~ does not interpolate when you change the start and end points.
>
> then why not use two wave~ objects (with fixed start and end points) and crossfade them?
—————————————————-

thats what i am doing since 4 years, it is called [110.interwave~] and works quite well.

but i would not mind to learn about a better way if there is one, especially if there is one which needs less CPU.
(interwave is 5 connections more than using just one wave object)


Viewing 15 posts - 1 through 15 (of 15 total)