audio scrub with mouse position in waveform~ ??

Apr 20, 2006 at 7:42pm

audio scrub with mouse position in waveform~ ??

This question seems obvious enough but after 40 straight hours of looking at max im drawing a blank

I’m taking the horizontal mouse position outputted from the [waveform~] object, and I want to be able to scrub over the audio within the buffer. I get values from 0 – 1 as i drag the mouse across the file.

what is the correct object to use for this? could I use a play~ object and map the values from 0-1 to the values of the start and end time of the buffer? hmm actually i might have answered my own question right there…but i doubt it…any help?

#25539
Apr 20, 2006 at 8:14pm

ok yea i tried what i said before but when when i try to scrub over the audio it just makes a clicking static sound. any suggestions on the objects i should use for this?

im thinking i need to interpolate the audio in some fasion…

#75310
Apr 21, 2006 at 11:32am

Try to use buffer~ and play~ and how they works.
ric

#75311
Apr 21, 2006 at 12:58pm

you should use a line object with a short ramp (5ms or whatever), that would remove the clicking sounds. Use the line~ to drive a play~ object. The play~ interpolates by default.

If you want the pitch to be left unchanged, use a granulator or phase vocoder for playing back the audio.

#75312
Apr 21, 2006 at 1:09pm

Darek Rossman wrote:
> what is the correct object to use for this? could I use a play~
> object and map the values from 0-1 to the values of the start and end
> time of the buffer? hmm actually i might have answered my own
> question right there…but i doubt it…any help?

Its not as easy as it seems, one pixel mouse movement is a lot of
samples….

But as always there is hope: in the examples there is a pvoc patcher
(read “phase vocoder”) which does some scratching. Not necessarily
beginners stuff, as its fft based, but it does scrubbing…

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#75313
Apr 21, 2006 at 1:32pm

Here’s a very simple and rough scrubber using buffer~ , play~ and line~.
Hope it may help

ciao,
ric

max v2;
#N vpatcher 202 104 793 629;
#P origin 0 -35;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 74 105 43 196617 $1 500;
#P user number~ 113 155 168 170 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221
221 222 222 222 0 0 0;
#P newex 74 131 32 196617 line~;
#P message 31 35 41 196617 replace;
#P flonum 74 78 90 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 74 57 65 196617 buffer~ voce;
#P message 74 35 98 196617 read VoceA2 0 -1 1;
#P newex 74 177 59 196617 play~ voce;
#P user meter~ 121 227 201 240 100 0 168 0 103 103 103 255 153 0 255 0
0 217 217 0 153 186 0 12 3 3 3 3;
#P newex 74 247 30 196617 dac~;
#P message 9 200 65 196617 startwindow;
#P message 10 220 27 196617 stop;
#P comment 180 36 100 196617 choose the soundfile;
#P comment 143 105 205 196617 try different interpolation time (in ms);
#P window linecount 5;
#P comment 223 155 152 196617 if you open the buffer window and
click&hold mouse , you can do a very simple scrubbing. Try also with
different zoom sets;
#P connect 11 0 9 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 14 0;
#P connect 14 0 12 0;
#P connect 12 0 7 0;
#P connect 4 0 5 0;
#P connect 3 0 5 0;
#P connect 7 0 5 0;
#P connect 12 0 13 0;
#P connect 7 0 6 0;
#P pop;

#75314
Apr 21, 2006 at 3:49pm

an example using waveform

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 370 90 39 196617 set $1;
#P newex 353 121 50 196617 deferlow;
#P message 224 137 48 196617 set voce;
#P user waveform~ 228 168 200 74 3 9;
#W mode loop;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P message 74 105 43 196617 $1 100;
#P user number~ 113 155 168 170 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 74 131 32 196617 line~;
#P message 31 35 41 196617 replace;
#P flonum 74 78 90 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 74 57 65 196617 buffer~ voce;
#P message 74 35 98 196617 read VoceA2 0 -1 1;
#P newex 74 177 59 196617 play~ voce;
#P user meter~ 121 227 201 240 100 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P newex 74 247 30 196617 dac~;
#P message 9 200 65 196617 startwindow;
#P message 10 220 27 196617 stop;
#P comment 180 36 100 196617 choose the soundfile;
#P comment 143 105 205 196617 try different interpolation time (in ms);
#P window linecount 5;
#P comment 260 272 146 196617 if you open the buffer window and click&hold mouse , you can do a very simple scrubbing. Try also with different zoom sets;
#P connect 18 0 17 0;
#P connect 18 0 15 3;
#P connect 15 2 10 0;
#P connect 15 2 18 0;
#P connect 17 0 15 2;
#P connect 9 1 16 0;
#P connect 16 0 15 0;
#P connect 7 0 5 0;
#P connect 7 0 6 0;
#P connect 12 0 7 0;
#P connect 12 0 13 0;
#P connect 3 0 5 0;
#P connect 4 0 5 0;
#P connect 14 0 12 0;
#P connect 10 0 14 0;
#P connect 9 0 10 0;
#P connect 8 0 9 0;
#P connect 11 0 9 0;
#P window clipboard copycount 19;

#75315
Apr 21, 2006 at 7:57pm

thanks for all the feedback guys ill try this stuff out

#75316
Apr 21, 2006 at 8:37pm

also, consider using the clock object to get the time since the last
mousemove event, then you don’t have to guess :)

_Mark

#75317

You must be logged in to reply to this topic.