Getting a phasor locked to transport to step through an audio file of any length

Jul 11, 2011 at 8:58pm

Getting a phasor locked to transport to step through an audio file of any length

Hi guys,

This is part of a much larger patch. I’m using a phasor locked to the transport using phasor~ 1n @lock 1 to play audio using wave~. Obviously this means that when I play audio that is not exactly 1 bar in length the phasor needs to be scaled. I initially used the rate~ object, which worked perfectly for what I wanted the patch to do at the time, but I’ve decided to try going about it in a different way because it would simplify other parts of the patch.

For instance, if the audio is 4 bars long, I’m multiplying the master phasor buy .25 to slow it down by the correct amount, then stepping through the bars by using +~, so bar one = +~ 0.,bar two = +~ .25, bar three = +~ .5, bar four = +~ .75.

My problem is that I can’t get it to step through smoothly, as you can see from the scope in the patch, which causes little glitches in the audio.

Anyone know the best way to get around this?

As always any help would be greatly appreciated!

Best,
Christian

– Pasted Max Patch, click to expand. –
#57974
Jul 12, 2011 at 9:04am

I’ve also tried using the signal to trigger the steps, but sometimes it triggers too early, and sometimes too late…

Is it possible to trigger sample accurately from a phasor?

– Pasted Max Patch, click to expand. –
#208015
Jul 12, 2011 at 11:54am

Have you enabled “Scheduler in Audio Interrupt” and set Audio Vector Size to a small value ?
This is essential for having an accurate message timing !

#208016
Jul 12, 2011 at 12:37pm

BTW, a bit more precise method to get a bang on phasor’s turnaround could be:

[phasor~]
|
[delta~]
|
[< ~ 0]
|
[edge~]
|

#208017
Jul 12, 2011 at 12:54pm

Ah. Yes. The Signal Vector Size was too large…

Thanks!

#208018
Jan 6, 2012 at 4:17pm

I’m thinking this may be a better way to go about this, but I still can’t get rid of the little clicks. Does anyone know of a better way to go about it. I’m having a bit of a nightmare with it. It’s part of a much bigger and more complex patch, and for the sequencer to function properly I need to be able to use a phasor scaled to 1 bar to step through audio files seamlessly. The rate object that comes after the phasor is used to change playback position reverse etc within my larger patch.

Is this possible?

Any advice is much appreciated.

– Pasted Max Patch, click to expand. –
#208019
Jan 7, 2012 at 10:39am

and if it’s not possible, is there another/better way of going about it?

I basically need to have multiple sound files of various bar lengths playing simultaneously, they have to be synced, I have to be able to change which bar within the loop is playing back, and I have to be able to press a button which will reverse playback from the current position and when released will snap back into sync. I have all of this and more working at the moment, but I can’t get rid of the clicks between bars, so I’m thinking I may need to rethink how I’m going about it…

#208020
Jan 7, 2012 at 12:58pm

First of all, if you’re on Max 5 you might want to have a look at this post: http://cycling74.com/forums/topic.php?id=36980 with regards transport locked phasors~ – you can ignore it if you’re on 6.

For the clicking, perhaps you could use a windowed pair of wave~s, like in the /examples/sampling folder?

Finally, you might want to have a look at 2dwave~ for changing the playback position within the buffer,
cheers
Roger

#208021
Jan 9, 2012 at 5:04pm

Hi Roger. Thanks for the reply. I am indeed still on Max 5, so it’s good to know about the timing issue with the locked phasor.

Using a windowed pair of waves won’t work in this instance as it doesn’t work unless the 2 samples are playing in sync, and I need to be able to jump around to different bars within the sample.

I’ve just had to rethink how I was going about it. I thought this would be something fairly simple to do, but unless you can be sample accurate when stepping through the bars it doesn’t work. It’s fine when looping segments as you can use a hanning window etc and it’s not noticeable, but when stepping through the bars it is noticeable with most audio…

#208022

You must be logged in to reply to this topic.