Forums > MaxMSP

changing start point in line~

April 11, 2008 | 1:55 am

I am using a line~ to control a sound file’s start point, end point, and speed through play~ (just like in the help file). However, I can’t seem to find a way to alter all three parameter individually. The left inlet of line~ takes a destination value and the right inlet takes the ramp time. I’d like to use random to randomly determine start time and end time within the sound file, but can’t figure out how. Right now, I can only randomly determine the destination value and ramp time.

Thanks for any help.
Mr. Bacon


April 11, 2008 | 2:50 am


April 11, 2008 | 3:47 am

Thank you. I did notice that, and by supplying one message with fixed start point, end point, and ramp time, it’s easy. However, is there a way to use random to supply the start point (and then an another random number to this start point so as to determine the end point)? With the three part message, I’d have to write messages for every start and end point combination to truly acheive playback of random snippets of the sound file.

Perhaps there is an object or variable indication within a message to which I can connect number boxes?


April 11, 2008 | 8:09 am

If I understand you correctly, you’re looking for variable arguments
in the message box -

[$1, $2 $3] where 1 is the start time, 2 the end time and 3 the
duration. Remember that if you randomise the difference between 1 & 2
that the playback speed will change (You’re traversing a variable
distance in the same time (value 3)).

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 10.;
#P window linecount 1;
#P newex 82 351 36 196618 print;
#P toggle 147 50 15 0;
#P newex 150 95 32 196618 t b b;
#P newex 148 72 63 196618 metro 500;
#P message 82 317 62 196618 $1 , $2 $3;
#P newex 82 174 27 196618 t i i;
#P newex 183 168 42 196618 + 100;
#P newex 183 132 70 196618 random 400;
#P newex 82 286 70 196618 pack i i 400;
#P newex 166 223 27 196618 +;
#P newex 82 132 77 196618 random 1000;
#P fasten 8 0 0 0 155 123 87 123;
#P connect 0 0 5 0;
#P connect 5 0 2 0;
#P connect 2 0 6 0;
#P connect 6 0 10 0;
#P fasten 1 0 2 1 171 264 117 264;
#P connect 9 0 7 0;
#P connect 7 0 8 0;
#P fasten 5 1 1 0 104 208 171 208;
#P fasten 8 1 3 0 177 123 188 123;
#P connect 3 0 4 0;
#P connect 4 0 1 1;
#P pop;

On 11 Apr 2008, at 04:47, Mr. Bacon wrote:

>
> Thank you. I did notice that, and by supplying one message with
> fixed start point, end point, and ramp time, it’s easy. However, is
> there a way to use random to supply the start point (and then an
> another random number to this start point so as to determine the end
> point)? With the three part message, I’d have to write messages for
> every start and end point combination to truly acheive playback of
> random snippets of the sound file.
>
> Perhaps there is an object or variable indication within a message
> to which I can connect number boxes?


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