## extracting an impulse from phasor

Sep 7, 2007 at 2:06am

# extracting an impulse from phasor

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

#33575
Sep 7, 2007 at 3:13am

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

#111974
Sep 7, 2007 at 6:07am

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.
————————————————————

#111975
Sep 7, 2007 at 7:21am

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

#111976
Sep 7, 2007 at 8:53am

#111977
Sep 8, 2007 at 2:50am

Thanks for all the replies! Greatly appreciated.

#111978
Sep 8, 2007 at 8:26am

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… ;-)

#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

#111979
Sep 8, 2007 at 10:19pm

> > 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

#111980
Sep 9, 2007 at 11:29am

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

#111981
Sep 9, 2007 at 9:32pm

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

#111982
Sep 9, 2007 at 11:13pm

#111983
Sep 10, 2007 at 9:41am

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

#111984
Sep 10, 2007 at 4:52pm

>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 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;

#111985
Sep 11, 2007 at 9:54am

> 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?

#111986
Sep 11, 2007 at 4:37pm

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)

#111987

You must be logged in to reply to this topic.