confused wth Plugsync~

Apr 23, 2007 at 5:35pm

confused wth Plugsync~

I am trying to generate 16th note pulses from my host for my pluggo plugin.

I was trying to use plugsync~ which gives bar/beat and then ticks (which are a value between 0. and 1.0 and represent a fraction of a beat)

There was a formula in the reference manual for deriving tempo from this: samplerate/ticks*60) but this was not working for me= (getting weird tempo values) which I thought I could just map to a tempo objects tempo in.

If the outputs were something like 96ppq, I would know what to do. I guess I am just confused!
I think I am just overlooking or misunderstanding the way this should be done with plugsync~

Also I noticed some past discussion about using plugphasor~ instead? (my host is Ableton Live 6)

All I want to do is generate 1/16th note triggers based on my host tempo.

#31546
Apr 23, 2007 at 7:39pm

This works for me as far as getting tempo info from plugsync~

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 30 240 75 196617 time signature;
#P number 156 239 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 109 239 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 205 280 148 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 57 45 118 196617 plugsync~;
#B color 5;
#P newex 205 141 40 196617 change;
#P newex 205 234 35 196617 * 60.;
#P newex 205 162 32 196617 t f b;
#P newex 205 210 31 196617 !/ 1.;
#P newex 227 186 54 196617 dspstate~;
#P newex 156 210 40 196617 change;
#P newex 109 210 40 196617 change;
#P newex 109 162 38 196617 unpack;
#P comment 356 282 37 196617 tempo;
#P connect 2 0 11 0;
#P connect 3 0 12 0;
#P connect 7 0 10 0;
#P connect 9 4 1 0;
#P fasten 9 5 8 0 127 101 210 101;
#P connect 6 1 4 0;
#P fasten 4 1 5 1 246 206 231 206;
#P connect 5 0 7 0;
#P connect 6 0 5 0;
#P connect 8 0 6 0;
#P fasten 1 1 3 0 142 194 161 194;
#P connect 1 0 2 0;
#P window clipboard copycount 14;

I’ll post an example of using plugphasor to generate 16th note bangs here in a second.

#102681
Apr 23, 2007 at 7:56pm

Here is an example with plugphasor~. I didnt actually test it, in with pluggo, but I do similar things with rewire all the time, so it should work.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 89 239 224 196617 I copied and pasted it from the plugphasor~ help;
#P comment 229 129 348 196617 The ratio would be 0.5 if an eighth note gets the beat and so on.;
#P flonum 184 194 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 229 103 348 196617 This should come out to a rate of (1/4) = 0.25 if a quarter note gets the beat (i.e. a 4/4 , 3/4 or 2/4 etc time signature);
#P window linecount 1;
#P newex 168 85 40 196617 change;
#P newex 168 110 38 196617 t 0.25 i;
#P newex 168 167 38 196617 / 1.;
#P newex 120 61 58 196617 unpack 4 4;
#P newex 68 32 118 196617 plugsync~;
#P newex 196 137 31 196617 !/ 4.;
#P button 29 300 15 0;
#P newex 29 273 34 196617 edge~;
#P newex 29 246 40 196617 ==~ -1;
#P newex 29 219 49 196617 change~;
#P newex 29 192 149 196617 rate~;
#P newex 29 165 64 196617 plugphasor~;
#P comment 228 86 264 196617 This part just makes sure that the rate~ is set to 16ths.;
#P comment 89 224 274 196617 This part outputs a bang at the begging on each phase cycle;
#P fasten 11 0 3 1 173 187;
#P fasten 11 0 15 0 173 189 189 189;
#P connect 8 0 11 1;
#P connect 12 0 11 0;
#P connect 10 1 13 0;
#P connect 13 0 12 0;
#P connect 12 1 8 0;
#P connect 9 4 10 0;
#P connect 3 0 4 0;
#P connect 2 0 3 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P window clipboard copycount 18;

#102682
Apr 23, 2007 at 10:45pm

mucho gracias!

I will check this out tonight (so close to being finished this should help get the icing on the cake)

cheers,
Danjel

#102683
Apr 24, 2007 at 12:10am

one question:

In the comments about setting the ratio for quarter notes as being 0.25 wouldn’t the ratio for eight notes be 0.125 not 0.5?

thanks,
Danjel

#102684
Apr 24, 2007 at 12:15am

wait I get it now ;)

thanks!

(wow I gotta slow down on the impulsive repsonses!)

#102685
Apr 24, 2007 at 12:19am

hey man, use hostsync~ to learn how plugsync~ works. They are almost identical. you can use hostsync~ within max and play with the outlets to your hearts content. I think hostsync~ has one outlet which plugsync~ does not. Other than that, every outlet is identical.

#102686
Apr 24, 2007 at 2:25am

Yeah, the ratio is the number of 16s to the beat, not the measure. So with four 16s to a quarter note, the ratio is .25. Two 16s to an eight note is a ratio of .5. I know you said you got it, but maybe someone is reading this who doesn’t.

Anyways, good luck with your work!

#102687
Apr 24, 2007 at 3:53am

SO now my step sequencer is all working in sync now. It locks to tempo and generates pulses every 16th note.
However, whenever I start my sequencer by pressing play in the host, I do not hear the first midi note. Everything else plays (and is in time) just not the very first step when the sequence first starts.

This is not the case when I am running the patch just within max.

Has anyone encountered this issue before? Is it something to do with pluggin buffers?

cheers,
Danjel

#102688
Apr 24, 2007 at 5:15am

thats common with startup. Its very hard to fix… same things happens when you have like fruity loops loaded as a vst. it misses the first beat =(

LAME! its not cyclings fault thou =0

#102689
Apr 24, 2007 at 5:34am

Wow that is too bad :( I made a notron style sequencer with cumulative transpose and stuff. If you miss the first note it can mess up the recording of the sequence. Maybe I can create a 1 bar delay option in the sequence and then shift the rest of my arrangement by a bar (e.g. 1 bar empty lead in).

Still sucks to have to do this :p

#102690
Apr 24, 2007 at 6:19am

Danjel van Tijn wrote:
> Wow that is too bad :( I made a notron style sequencer with cumulative transpose and stuff. If you miss the first note it can mess up the recording of the sequence. Maybe I can create a 1 bar delay option in the sequence and then shift the rest of my arrangement by a bar (e.g. 1 bar empty lead in).
>
> Still sucks to have to do this :p
>
>
it’d be great to see this patch when it’s ready for prime-time. It
sounds cool, I love hardware sequencers, especially freaky ones like the
notron!


Cheers,
-Andrew
andrew_burgess@mac.com

#102691
Apr 24, 2007 at 1:16pm

You need to use the leftmost outlet of plugsync~ (the one that shows
transport state) to “force” the first beat (at least that’s how I do
it).

If you post your current bit of code that generates the steps, I
could take a quick look….

Dan

At 9:53 PM -0600 4/23/07, Danjel van Tijn wrote:
>SO now my step sequencer is all working in sync now. It locks to
>tempo and generates pulses every 16th note.
>However, whenever I start my sequencer by pressing play in the host,
>I do not hear the first midi note. Everything else plays (and is in
>time) just not the very first step when the sequence first starts.
>
>This is not the case when I am running the patch just within max.
>
>Has anyone encountered this issue before? Is it something to do with
>pluggin buffers?


Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#102692
Apr 24, 2007 at 2:38pm

jamez skrev:
> thats common with startup. Its very hard to fix… same things happens when you have like fruity loops loaded as a vst. it misses the first beat =(
>
> LAME! its not cyclings fault thou =0
I can’t really remember how I did it right now, but I worked around it
by linking to the start message coming from plugsync~…oh wait, here’s
the abstraction I did;
- please let me know how / if it works for you – it’s been a while since
I’ve used it.

save as: “aw.plugto16.pat”

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 252 133 40 9109513 change;
#P newex 273 75 27 9109513 > 0;
#P newex 313 111 27 9109513 gate;
#P newex 313 246 27 9109513 + 0;
#P newex 313 212 40 9109513 change;
#P newex 313 182 29 9109513 % 16;
#P newex 313 152 27 9109513 * 4.;
#P newex 252 43 120 9109513 plugsync~;
#B color 5;
#P outlet 313 290 15 0;
#P fasten 1 6 7 0 335 68 278 68;
#P fasten 1 6 6 1 335 86 335 86;
#P fasten 8 1 0 0 272 278 318 278;
#P connect 5 0 0 0;
#P connect 4 0 5 0;
#P connect 3 0 4 0;
#P connect 2 0 3 0;
#P connect 6 0 2 0;
#P fasten 7 0 6 0 278 102 318 102;
#P connect 1 0 8 0;
#P window clipboard copycount 9;

#102693
Apr 24, 2007 at 3:31pm

I tried that last patch (thanks for posting!) but I actually got more problems: It did not start on beat (delayed by about an 1/8th) and I did not hear the first note.

Nick Inhofe posted an example of a patch using plugphasor~ in conjunction with plugsync~. The timing on this one has been working for me well. (starts the sequence on beat)

My plugin (will post shortly) locks to tempo nicely, and it even gets a trigger for the first step, you just don’t hear a note play.

If there is a possibility that it is my patch, then I will put a bunch of debug stuff into it and trace it through at low tempo to see what happens. However, I have a feeling this may just be a vst issue (I remember having the same problem with reaktor plugins).

cheers,
Danjel

#102694
Apr 24, 2007 at 3:39pm

At 4:38 PM +0200 4/24/07, Andreas Wetterberg wrote:
>jamez skrev:
>>thats common with startup. Its very hard to fix… same things
>>happens when you have like fruity loops loaded as a vst. it misses
>>the first beat =(
>>LAME! its not cyclings fault thou =0
>I can’t really remember how I did it right now, but I worked around
>it by linking to the start message coming from plugsync~…oh wait,
>here’s the abstraction I did;
>- please let me know how / if it works for you – it’s been a while
>since I’ve used it.

Andreas, the patch you posted will only work right if the transport
is started exactly “on the beat” – if not, it will send a trigger,
despite the transport being started “in between the beat”…

Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#102695
Apr 24, 2007 at 3:47pm

Here is my code for receiving the play/stop and sync info:
If the step sequencers receive a bang (1/16th of a beat trigger) then they output their step values.

I guess there may be some latency in processing and generatign the midi values but it should not be much.

Also I tried recording some of the midi sequence generated with quantising off. I noticed that the timining is actually not as tight as I thought. Each step could either be positively or negtively delayed by different amounts (maybe as much as 1/64th?)

anyways here it is (not much different from what Nick posted)

#P hidden button 140 237 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden comment 510 324 224 9109513 I copied and pasted it from the plugphasor~ help;
#P hidden comment 650 214 348 9109513 The ratio would be 0.5 if an eighth note gets the beat and so on.;
#P hidden flonum 605 279 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P hidden comment 650 188 348 9109513 This should come out to a rate of (1/4) = 0.25 if a quarter note gets the beat (i.e. a 4/4 , 3/4 or 2/4 etc time signature);
#P window linecount 1;
#P hidden newex 589 170 40 9109513 change;
#P hidden newex 589 195 38 9109513 t 0.25 i;
#P hidden newex 589 252 38 9109513 / 1.;
#P hidden newex 541 146 58 9109513 unpack 4 4;
#P hidden newex 617 222 31 9109513 !/ 4.;
#P hidden button 450 385 15 0;
#P hidden newex 450 358 34 9109513 edge~;
#P hidden newex 450 331 40 9109513 ==~ -1;
#P hidden newex 450 304 49 9109513 change~;
#P hidden newex 450 277 149 9109513 rate~;
#P hidden newex 450 250 64 9109513 plugphasor~;
#P hidden comment 649 171 264 9109513 This part just makes sure that the rate~ is set to 16ths.;
#P hidden comment 510 309 274 9109513 This part outputs a bang at the begging on each phase cycle;
#P hidden newex 110 197 40 9109513 change;
#P hidden toggle 109 232 15 0;
#P hidden comment 54 200 52 9109513 play/stop;
#P hidden newex 142 96 355 9109513 plugsync~;
#P hidden newex 140 289 55 9109513 s StartSEQ;
#P window linecount 6;
#P comment 470 386 100 9109513 This output is my step trigger. Each step sequencer counts the bangs to determine position relative to when it started.;
#P comment 125 313 100 9109513 Looks for stop command. This sends out a message to the step sequencers to reset their positions to the first step.;
#P hidden fasten 17 0 10 1 594 272;
#P hidden fasten 17 0 21 0 594 274 610 274;
#P hidden connect 13 0 14 0;
#P hidden connect 24 0 2 0;
#P hidden connect 6 0 5 0;
#P hidden connect 3 0 6 0;
#P hidden connect 6 2 24 0;
#P hidden connect 9 0 10 0;
#P hidden connect 10 0 11 0;
#P hidden connect 11 0 12 0;
#P hidden connect 12 0 13 0;
#P hidden connect 3 4 16 0;
#P hidden connect 16 1 19 0;
#P hidden connect 19 0 18 0;
#P hidden connect 18 0 17 0;
#P hidden connect 18 1 15 0;
#P hidden connect 15 0 17 1;
#P window clipboard copycount 25;

#102696
Apr 24, 2007 at 4:27pm

Dan Nigrin skrev:
> At 4:38 PM +0200 4/24/07, Andreas Wetterberg wrote:
>> jamez skrev:
>>> thats common with startup. Its very hard to fix… same things
>>> happens when you have like fruity loops loaded as a vst. it misses
>>> the first beat =( LAME! its not cyclings fault thou =0
>> I can’t really remember how I did it right now, but I worked around
>> it by linking to the start message coming from plugsync~…oh wait,
>> here’s the abstraction I did;
>> – please let me know how / if it works for you – it’s been a while
>> since I’ve used it.
>
> Andreas, the patch you posted will only work right if the transport is
> started exactly “on the beat” – if not, it will send a trigger,
> despite the transport being started “in between the beat”…
>
> Dan
That is correct, Dan. And it’s the intended behaviour, really. If you
start it at a later point you will *always* get the 1st 16th, and then
subsequent 16th notes are there, too, if I recall correctly. Oh, and I
actually found this method to be really tight, when the results are
recorded q. off.

best,
Andreas.

#102697
Apr 24, 2007 at 5:21pm

I think the trick is going to be to move everything down by a measure, and then use plugsync’s bar count to reset the sequencer.

Here is an example-
#P button 164 154 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 164 87 32 196617 sel 1;
#P newex 164 51 31 196617 == 2;
#P button 119 162 15 0;
#P comment 489 249 224 196617 I copied and pasted it from the plugphasor~ help;
#P comment 629 139 348 196617 The ratio would be 0.5 if an eighth note gets the beat and so on.;
#P flonum 584 204 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 629 113 348 196617 This should come out to a rate of (1/4) = 0.25 if a quarter note gets the beat (i.e. a 4/4 , 3/4 or 2/4 etc time signature);
#P window linecount 1;
#P newex 568 95 40 196617 change;
#P newex 568 120 52 196617 t 0.25 i;
#P newex 568 177 38 196617 / 1.;
#P newex 520 71 58 196617 unpack 4 4;
#P newex 596 147 31 196617 !/ 4.;
#P button 429 310 15 0;
#P newex 429 283 34 196617 edge~;
#P newex 429 256 40 196617 ==~ -1;
#P newex 429 229 49 196617 change~;
#P newex 429 202 149 196617 rate~;
#P newex 429 175 64 196617 plugphasor~;
#P comment 628 96 264 196617 This part just makes sure that the rate~ is set to 16ths.;
#P comment 489 234 274 196617 This part outputs a bang at the begging on each phase cycle;
#P newex 89 122 40 196617 change;
#P toggle 89 157 15 0;
#P comment 33 125 52 196617 play/stop;
#P newex 121 21 355 196617 plugsync~;
#P newex 119 214 55 196617 s StartSEQ;
#P window linecount 6;
#P comment 449 311 114 196617 This output is my step trigger. Each step sequencer counts the bangs to determine position relative to when it started.;
#P comment 104 238 100 196617 Looks for stop command. This sends out a message to the step sequencers to reset their positions to the first step.;
#P window linecount 2;
#P comment 179 116 298 196617 if you move everything down by a measure , this will re-trigger your step sequencer at the begginning of the second measure.;
#P connect 26 0 27 0;
#P connect 14 0 15 0;
#P connect 25 0 3 0;
#P connect 7 0 6 0;
#P fasten 4 0 7 0 126 80 94 80;
#P connect 7 2 25 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 14 0;
#P fasten 4 4 17 0 298 54 525 54;
#P connect 17 1 20 0;
#P connect 20 0 19 0;
#P connect 19 0 18 0;
#P connect 19 1 16 0;
#P connect 16 0 18 1;
#P connect 27 0 28 0;
#P fasten 18 0 22 0 573 199 589 199;
#P fasten 18 0 11 1 573 197;
#P connect 4 1 26 0;
#P window clipboard copycount 29;

Alternatively, you could set the == box to 1, and then just have playback start at measure 0.

#102698
Apr 24, 2007 at 5:32pm

>That is correct, Dan. And it’s the intended behaviour, really. If
>you start it at a later point you will *always* get the 1st 16th,
>and then subsequent 16th notes are there, too, if I recall
>correctly. Oh, and I actually found this method to be really tight,
>when the results are recorded q. off.

But if you send the first trigger “in between” the beat, aren’t you
sending that initial first trigger too soon?

Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#102699
Apr 24, 2007 at 6:04pm

At 9:47 AM -0600 4/24/07, Danjel van Tijn wrote:
>Here is my code for receiving the play/stop and sync info:
>If the step sequencers receive a bang (1/16th of a beat trigger)
>then they output their step values.
>
>I guess there may be some latency in processing and generatign the
>midi values but it should not be much.
>
>Also I tried recording some of the midi sequence generated with
>quantising off. I noticed that the timining is actually not as tight
>as I thought. Each step could either be positively or negtively
>delayed by different amounts (maybe as much as 1/64th?)

Looking at your patch, I’d also suggest to change your ==~ -1 to an
==~ 1 ; I think that might help with your dilemma.

FWIW, since you are just outputting bangs to drive the other parts of
your patch, you could also do this stuff without going through
audio-rate objects (rate~, change~, ==~), and just use the
bar/beat/tick outlets from plugsync~, or even the raw ticks outlet
(which is what I do, with a bit of math). See example below, which
just shows you at the end the total # steps since the start of the
sequence. You can then massage this number for your purposes.

You lose any advantage of audio rate scheduling at the point you
convert to scheduler rate (when you trigger the bangs).

Dan

#P window setfont “Sans Serif” 9.;
#P number 135 264 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 59 130 15 0;
#P window linecount 1;
#P newex 67 171 62 196617 prepend set;
#P flonum 59 197 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 135 236 27 196617 + 1;
#P newex 135 156 40 196617 change;
#P newex 135 112 29 196617 * 4.;
#P newex 57 101 40 196617 change;
#P newex 57 59 118 196617 plugsync~;
#B color 5;
#P comment 64 84 52 196617 play/stop;
#P window linecount 2;
#P comment 143 83 31 196617 raw ticks;
#P window linecount 1;
#P comment 174 265 62 196617 total steps;
#P connect 7 0 11 0;
#P connect 5 0 9 0;
#P connect 5 0 6 0;
#P connect 3 6 5 0;
#P connect 3 0 4 0;
#P connect 4 1 10 0;
#P connect 10 0 8 0;
#P connect 9 0 8 0;
#P connect 6 0 7 0;
#P connect 8 0 7 0;
#P window clipboard copycount 12;


Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#102700
Apr 24, 2007 at 6:24pm

changing the ==~-1 to ==~ 1 worked!

I’ll take a look at your timing patch, what you are saying makes sense so this should work just as well.

many thanks!

Danjel

#102701
Apr 24, 2007 at 7:31pm

Dan Nigrin skrev:
>> That is correct, Dan. And it’s the intended behaviour, really. If you
>> start it at a later point you will *always* get the 1st 16th, and
>> then subsequent 16th notes are there, too, if I recall correctly. Oh,
>> and I actually found this method to be really tight, when the results
>> are recorded q. off.
>
> But if you send the first trigger “in between” the beat, aren’t you
> sending that initial first trigger too soon?
>
> Dan
Thing is; I have never ever ever needed to stop playback to launch it
mid-bar… ever… It must be a hypothetical issue only? I can’t imagine
a situation where you would want that kind of behaviour. My daw resets
to the bar anyway. All I can tell you at this point is that its:
a) Simple, and
b) works for me, and
c)sharing is supposed to be fun!

Cheers,
Andreas.
:-)

#102702
Apr 24, 2007 at 7:53pm

>Thing is; I have never ever ever needed to stop playback to launch
>it mid-bar… ever… It must be a hypothetical issue only?

Not really – if you stop/start Live for example, by Shift-SpaceBar,
instead of just Space-Bar, it continues to play exactly where you
left off, and doesn’t reset to the beat. Many artists that use Live
“live” use this functionality…

>I can’t imagine a situation where you would want that kind of
>behaviour. My daw resets to the bar anyway. All I can tell you at
>this point is that its:
>a) Simple, and
>b) works for me, and
>c)sharing is supposed to be fun!

Never meant to imply that your patch didn’t do exactly what you need
it to! I just wanted to be sure that Danjel understood fully how it
would behave, since he was having some troubles with his setup…

Best,
Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#102703

You must be logged in to reply to this topic.