Forums > MaxMSP

waveform for setting playback start & end points

December 10, 2007 | 11:33 am

OK here’s my problem –

Ive got a basic step sequencer which sequences samples loaded into the usual buffer~ groove~ combo. Im using the waveform object to view the sample loaded into the buffer~. I also want to use the same waveform object to edit the start and end point of the sample. I understand you can do this when the sample is looping (i.e. you set the loop min and loop max points). however, i dont want my sample to loop – i only want it to play when it’s supposed to in the sequencer.

Essentailly, i want to be able to highlight a particular area in the wavefrom object and for the groove~ object to play that highlighted part when it recieves a bang from my sequencer. Would play~ provide this function? Is there a way to set the start and end points of the sample in waveform when it isnt looping?

I have tried using my current set up with the loop on but the sample continues looping and sounding after the sequencer has stopped.

Any help would be appreciated


December 10, 2007 | 12:29 pm

Hi.
Here is a way of doing it with play~.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 202 62 45 9109513 loadbang;
#P newex 294 197 27 9109513 t i i;
#P newex 340 188 27 9109513 t i i;
#P newex 393 232 56 9109513 expr $i2-$i1;
#P newex 124 258 27 9109513 line~;
#P message 124 234 133 9109513 2139 , 3522 1383;
#P newex 293 259 111 9109513 sprintf set %ld\, %ld %ld;
#P newex 124 280 48 9109513 play~ buf;
#P button 124 73 39 0;
#P newex 124 337 46 9109513 dac~;
#P newex 124 305 33 9109513 *~ 0.3;
#P message 202 87 38 9109513 set buf;
#P window setfont "Sans Serif" 9.;
#P user waveform~ 202 110 242 67 3 9;
#W mode select;
#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 window setfont "Sans Serif" 9.;
#P message 53 93 38 9109513 replace;
#P newex 53 114 56 9109513 buffer~ buf;
#P toggle 94 315 15 0;
#P connect 9 0 10 0;
#P connect 15 0 4 0;
#P connect 7 0 10 0;
#P connect 3 2 14 0;
#P connect 14 0 9 0;
#P connect 14 1 12 0;
#P connect 3 3 13 0;
#P connect 13 0 9 1;
#P connect 13 1 12 1;
#P connect 5 0 6 0;
#P connect 5 0 6 1;
#P connect 8 0 5 0;
#P connect 12 0 9 2;
#P connect 11 0 8 0;
#P connect 10 0 11 0;
#P connect 0 0 6 0;
#P connect 4 0 3 0;
#P connect 2 0 1 0;
#P window clipboard copycount 16;


December 10, 2007 | 12:35 pm

Hello,

I’d probably use a line~ play~ combination. Use the waveform start selection
outlet to set the line~ start point, then send the duration (end – start) to
the right inlet, then finally send the end selection point to the left inlet
of line~ to create a ramp to drive a play~ (see the line~ help file).
Something like this:

max v2;
#N vpatcher 193 116 793 516;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 53 33 45 9109513 loadbang;
#P number 230 228 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 230 205 27 9109513 -;
#P newex 230 253 27 9109513 i;
#P newex 168 208 27 9109513 i;
#P number 167 179 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 130 207 27 9109513 i;
#P number 129 178 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 298 136 40 9109513 t b b b;
#P button 298 85 38 0;
#P user ezdac~ 210 349 254 382 0;
#P message 53 57 54 9109513 set sample;
#P window setfont Geneva 9.;
#P user waveform~ 53 78 200 74 194 9;
#W mode select;
#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 window setfont "Sans Serif" 9.;
#P message 450 83 38 9109513 replace;
#P newex 213 279 27 9109513 line~;
#P newex 450 109 72 9109513 buffer~ sample;
#P newex 212 309 64 9109513 play~ sample;
#P connect 16 0 5 0;
#P connect 5 0 4 0;
#P connect 4 2 9 0;
#P connect 8 2 10 0;
#P connect 9 0 10 1;
#P connect 4 3 11 0;
#P connect 8 0 12 0;
#P connect 11 0 12 1;
#P connect 0 0 6 0;
#P connect 2 0 0 0;
#P connect 12 0 2 0;
#P connect 10 0 2 0;
#P connect 4 3 14 0;
#P connect 14 0 15 0;
#P connect 8 1 13 0;
#P connect 13 0 2 1;
#P connect 0 0 6 1;
#P connect 4 2 14 1;
#P connect 15 0 13 1;
#P connect 7 0 8 0;
#P connect 3 0 1 0;
#P pop;

Hope that helps,
Simon

—–Original Message—–
From: maxmsp-bounces@cycling74.com [mailto:maxmsp-bounces@cycling74.com] On
Behalf Of Stefan Scheuregger
Sent: 10 December 2007 11:34
Subject: [maxmsp] waveform for setting playback start & end points

OK here’s my problem –

Ive got a basic step sequencer which sequences samples loaded into the usual
buffer~ groove~ combo. Im using the waveform object to view the sample
loaded into the buffer~. I also want to use the same waveform object to edit
the start and end point of the sample. I understand you can do this when the
sample is looping (i.e. you set the loop min and loop max points). however,
i dont want my sample to loop – i only want it to play when it’s supposed to
in the sequencer.

Essentailly, i want to be able to highlight a particular area in the
wavefrom object and for the groove~ object to play that highlighted part
when it recieves a bang from my sequencer. Would play~ provide this
function? Is there a way to set the start and end points of the sample in
waveform when it isnt looping?

I have tried using my current set up with the loop on but the sample
continues looping and sounding after the sequencer has stopped.

Any help would be appreciated


December 10, 2007 | 2:35 pm

both of these are excellent and do exactly what i need! thank you both for your quick replies!

Stefan


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