pitch – speed relationship

Jan 11, 2008 at 3:11pm

pitch – speed relationship

hi,

first off im new to maxmsp so please forgive me if i’m missing something that is very obvious.

i am building a looper using groove~.
my buffered files are very short. mostly drum hits and glitches.
my objective is to make the file play quicker without the pitch shifting as much as it does when you tweak the speed.
the goal is to make a natural sounding snarerush/drumroll.
i was wondering if i should use a different MSP object.

any pointers towards pitch / speed manipulation much appreciated.

TY.

#35320
Jan 11, 2008 at 3:43pm

Look at using [gizmo~] in conjunction with [groove~]. You can set up
a control structure to change the pitch of a speed-changed audio file
to compensate for the resulting pitch-change.

On Jan 11, 2008, at 8:11 AM, mithat madra wrote:

>
> hi,
>
> first off im new to maxmsp so please forgive me if i’m missing
> something that is very obvious.
>
> i am building a looper using groove~.
> my buffered files are very short. mostly drum hits and glitches.
> my objective is to make the file play quicker without the pitch
> shifting as much as it does when you tweak the speed.
> the goal is to make a natural sounding snarerush/drumroll.
> i was wondering if i should use a different MSP object.
>
> any pointers towards pitch / speed manipulation much appreciated.

—-
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe

Home < http://pubweb.csf.edu/~smill>
SFIFEM <
http://sfifem.csf.edu>
Atrium Sound Space <
http://atrium.csf.edu>
OVOS <
http://pubweb.csf.edu/~smill/ovos.html>
CMP <
http://www.csf.edu/academics/contemporary_music/>

#120260
Jan 11, 2008 at 7:06pm

Quote: psnow wrote on Fri, 11 January 2008 07:11
—————————————————-
> i am building a looper using groove~.
> my buffered files are very short. mostly drum hits and glitches.
> my objective is to make the file play quicker without the pitch shifting as much as it does when you tweak the speed.
—————————————————-

Here’s a patch that uses sfplay~, rather than groove~. Same idea, though.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 54 474 100 196617 volume;
#P user led 230 23 17 17 3 150;
#P user led 233 378 17 17 3 150;
#P user led 304 23 17 17 3 150;
#P user led 312 380 17 17 3 150;
#P hidden newex 465 337 27 196617 > 1.;
#P hidden newex 437 336 27 196617 < 1.;
#P hidden newex 399 335 34 196617 == 1.;
#P user led 203 238 17 17 3 150;
#P user radiogroup 121 320 18 16;
#X size 1;
#X offset 16;
#X inactive 0;
#X itemtype 1;
#X flagmode 0;
#X set 1;
#X done;
#P message 121 344 43 196617 loop $1;
#P comment 40 185 100 196617 click to play;
#P window setfont “Sans Serif” 18.;
#P comment 356 507 205 196626 relative soundfile time;
#B color 5;
#P window setfont “Sans Serif” 9.;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 294 121 31 196617 !/ 1.;
#P flonum 241 196 35 9 0 0 0 3 0 0 0 153 153 255 222 222 222 0 0 0;
#P newex 71 253 160 196617 pfft~ gizmo_loadme 4096 4;
#P newex 50 228 160 196617 pfft~ gizmo_loadme 4096 4;
#P flonum 202 115 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 202 142 50 196617 speed $1;
#N sfplay~ 2 181440 2 ;
#P newobj 50 176 101 196617 sfplay~ 2 181440 2;
#P inlet 50 156 15 0;
#P inlet 202 30 15 0;
#P outlet 50 250 15 0;
#P outlet 71 275 15 0;
#P outlet 94 198 15 0;
#P window linecount 1;
#P message 202 50 43 196617 $1 500;
#P newex 202 78 40 196617 line 0.;
#P connect 8 0 7 0;
#P connect 6 0 7 0;
#P connect 7 0 10 0;
#P connect 10 0 4 0;
#P connect 7 1 11 0;
#P connect 11 0 3 0;
#P connect 7 2 2 0;
#P connect 12 0 10 1;
#P connect 5 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 9 0;
#P connect 9 0 8 0;
#P connect 12 0 11 1;
#P connect 13 0 12 0;
#P connect 0 0 13 0;
#P pop;
#P newobj 105 382 125 196617 p variable speed playback;
#P window setfont “Sans Serif” 18.;
#P comment 246 19 63 196626 faster;
#B color 5;
#P window setfont “Sans Serif” 9.;
#P hidden newex 488 227 48 196617 loadbang;
#P newex 7 24 106 196617 bgcolor 200 200 200;
#P window setfont “Sans Serif” 14.;
#P comment 347 676 121 196622 current position;
#B color 5;
#P window setfont “Sans Serif” 36.;
#P number 540 450 101 36 0 0 32 3 0 0 0 255 227 23 222 222 222 0 0 0;
#P comment 646 450 63 196644 ms;
#B color 5;
#P number 431 450 62 36 0 0 32 3 0 0 0 255 227 23 222 222 222 0 0 0;
#P comment 497 450 38 196644 s;
#B color 5;
#P number 319 450 62 36 0 0 32 3 0 0 0 255 227 23 222 222 222 0 0 0;
#P comment 383 450 38 196644 m;
#B color 5;
#P number 218 450 62 36 0 0 32 3 0 0 0 255 227 23 222 222 222 0 0 0;
#P comment 282 450 28 196644 h;
#B color 5;
#P window setfont “Sans Serif” 9.;
#N vpatcher 779 381 1415 724;
#P window setfont “Sans Serif” 9.;
#P newex 130 82 48 196617 loadbang;
#P newex 259 208 68 196617 expr $f1-$i2;
#P newex 352 231 45 196617 * 1000.;
#P newex 158 162 68 196617 expr $f1-$i2;
#P newex 243 186 33 196617 * 60.;
#P number 120 25 36 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 75 25 15 0;
#P newex 46 114 68 196617 expr $f1-$i2;
#P outlet 352 261 15 0;
#P outlet 243 261 15 0;
#P outlet 131 261 15 0;
#P newex 131 139 33 196617 * 60.;
#P outlet 30 261 15 0;
#P newex 30 91 62 196617 / 3600000.;
#P newex 75 45 55 196617 metro 100;
#P newex 30 71 53 196617 snapshot~;
#P inlet 30 27 15 0;
#P window setfont “Sans Serif” 12.;
#P comment 173 45 230 196620 < = Turn on metronome to see clock;
#P connect 1 0 2 0;
#P fasten 3 0 2 0 80 64 35 64;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P fasten 4 0 10 0 35 111 51 111;
#P connect 17 0 11 0;
#P connect 11 0 3 0;
#P fasten 4 0 10 1 35 110 109 110;
#P connect 12 0 3 1;
#P fasten 10 0 6 0 51 135 136 135;
#P connect 6 0 7 0;
#P fasten 6 0 14 0 136 158 163 158;
#P fasten 6 0 14 1 136 158 221 158;
#P fasten 14 0 13 0 163 183 248 183;
#P connect 13 0 8 0;
#P fasten 13 0 16 0 248 206 264 206;
#P fasten 13 0 16 1 248 205 322 205;
#P fasten 16 0 15 0 264 228 357 228;
#P connect 15 0 9 0;
#P pop;
#P newobj 218 406 59 196617 p h:m:s:ms;
#P hidden message 482 257 17 196617 1.;
#P user ubutton 342 228 135 32 0 0;
#P window setfont “Sans Serif” 18.;
#P comment 249 374 144 196626 slower;
#B color 5;
#P user multiSlider 220 48 118 325 0.9 1.15 1 2681 47 0 3 5 0 30 0;
#M frgb 225 214 25;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 225 214 25;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P toggle 105 169 57 0;
#P user ezdac~ 105 565 149 598 0;
#P user gain~ 139 422 24 100 158 5 1.071519 7.94321 10.;
#P user gain~ 105 422 24 100 158 5 1.071519 7.94321 10.;
#P window setfont “Sans Serif” 9.;
#P message 20 100 30 196617 open;
#B color 5;
#P window setfont “Sans Serif” 18.;
#P comment 342 230 132 196626 Normal Speed;
#P user panel 341 227 135 33;
#X brgb 255 243 59;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont “Sans Serif” 9.;
#P comment 49 100 100 196617 open a soundfile;
#P fasten 12 3 20 0 271 436 545 436;
#P hidden connect 23 0 11 0;
#P hidden connect 10 1 11 0;
#P connect 8 0 25 1;
#P hidden connect 8 0 31 0;
#P hidden connect 8 0 32 0;
#P hidden connect 8 0 33 0;
#P fasten 12 2 18 0 255 436 436 436;
#P fasten 12 1 16 0 239 436 324 436;
#P hidden connect 32 0 36 0;
#P hidden connect 32 0 34 0;
#P hidden connect 33 0 37 0;
#P hidden connect 33 0 35 0;
#P hidden connect 11 0 8 0;
#P fasten 12 0 14 0 223 436 223 436;
#P connect 25 2 12 0;
#P hidden connect 31 0 30 0;
#P connect 5 0 6 1;
#P hidden connect 4 1 5 0;
#P fasten 25 1 5 0 167 410 144 410;
#P connect 29 0 28 0;
#P connect 4 0 6 0;
#P connect 25 0 4 0;
#P connect 28 0 25 0;
#P fasten 3 0 25 0 25 248 110 248;
#P connect 7 0 25 0;
#P window clipboard copycount 39;

#120261
Jan 11, 2008 at 11:33pm

hey,
thank you so much for your help but i seem to be having trouble producing sound.
the error i get is:

error: pfft~ : no patcher gizmo__loadme
error: pfft~ : no patcher gizmo__loadme

do you happen to know why?

on the other hand i will look into the help files of sfplay and gizmo thanks for the tip…

#120262
Jan 12, 2008 at 12:16am

Quote: psnow wrote on Fri, 11 January 2008 15:33
—————————————————-
> hey,
> thank you so much for your help but i seem to be having trouble producing sound.
> the error i get is:
>
> error: pfft~ : no patcher gizmo__loadme
> error: pfft~ : no patcher gizmo__loadme
>
> do you happen to know why?
>
> on the other hand i will look into the help files of sfplay and gizmo thanks for the tip…
—————————————————-

It should be straight from the gizmo helpfile. It looks like:

#P window setfont “Sans Serif” 9.;
#P flonum 172 158 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 172 103 72 196617 route int float;
#P newex 92 236 50 196617 fftout~ 1;
#N in 2;
#P newobj 172 70 25 196617 in 2;
#P newex 92 182 90 196617 gizmo~;
#B color 5;
#P newex 92 70 44 196617 fftin~ 1;
#P window linecount 3;
#P comment 246 94 94 196617 other messages get sent to gizmo~’s left inlet;
#P window linecount 2;
#P comment 213 158 110 196617 right inlet (float) is for transposition factor;
#P connect 7 0 3 2;
#P connect 6 0 7 0;
#P connect 6 1 7 0;
#P connect 4 0 6 0;
#P connect 3 1 5 1;
#P connect 2 1 3 1;
#P connect 3 0 5 0;
#P connect 2 0 3 0;
#P connect 6 2 3 0;
#P window clipboard copycount 8;

mz

#120263
Jan 12, 2008 at 1:21am

the problem ensues.
i suppose it must be me.
unfortunately i cant run max/msp in any other machines to test it out.
is this working out in everyone else’s macs?
when i try to type in exactly what is written, there are no inputs or outputs on my object.
this is frustrating.

on the other hand, great GUI. :)

#120264
Jan 12, 2008 at 2:04am

Quote: psnow wrote on Fri, 11 January 2008 17:21
—————————————————-
> the problem ensues.
> i suppose it must be me.
> unfortunately i cant run max/msp in any other machines to test it out.
> is this working out in everyone else’s macs?
> when i try to type in exactly what is written, there are no inputs or outputs on my object.
> this is frustrating.
>
> on the other hand, great GUI. :)
>
>
—————————————————-

Thanks. How does the help patch for gizmo work for you?

mz

#120265
Jan 12, 2008 at 2:58pm

Gizmo~ works very well. Below is my playsample~ patch. It must be used in
a poly~ object.

It uses play~ to play a selected portion of a sample buffer~. Selecting the
begin and end points of the buffer may change duration. If duration
changes, play~ will change pitch by a predictable interval that can be
“corrected” with the transposition factor of gizmo~.

If the intent is to change output duration without changing pitch, the
transposition factor for gizmo~ is computed as

1./(intended_duration/actual_duration). (see panel A)

If the intended duration is half the actual, play~ raises the pitch by an
octave so the transposition ratio for gizmo~ should be .5 to transpose down
an octave.

To specify both a new duration and transposition interval, you must make a
transposition ratio that takes into account the effect of play~ AND the
specified transposition ratio. (see panel B). Note that an extra gizmo~ is
not required.

I haven’t made a help file for this. If you would like to see one let me
know. It will require an attachment of a folder with all of the objects so
I’ll have to post it in the forum from Cycling’74.com.

#P window setfont “Sans Serif” 14.;
#P window linecount 1;
#P comment 305 169 49 196622 B;
#P comment 210 170 24 196622 A;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 614 134 67 196617 envelope buffer~ name;
#P comment 245 132 79 196617 sample end in milliseconds;
#P window linecount 1;
#P newex 603 220 62 196617 prepend set;
#P newex 336 474 21 196617 t 0;
#P newex 51 519 35 196617 *~ 1.;
#N out~ 1;
#P newobj 51 558 39 196617 out~ 1;
#P newex 720 113 22 196617 b 1;
#P newex 670 334 48 196617 loadbang;
#P window setfont “Fixedwidth Serif” 10.;
#P message 631 372 62 1441802 mute 1 , 0;
#P message 720 376 63 1441802 mute 0 , 1;
#P newex 631 403 65 1441802 thispoly~;
#P window setfont “Sans Serif” 9.;
#P newex 51 112 562 196617 unpack 0. 0 0 0. 0. sample envelope;
#N in 1;
#P newobj 51 43 25 196617 in 1;
#P newex 511 221 62 196617 prepend set;
#P newex 308 298 29 196617 * 1.;
#P newex 51 450 35 196617 *~ 0.;
#P message 161 273 20 196617 $3;
#P newex 144 353 27 196617 /~;
#P newex 144 387 95 196617 wave~ $0envelope;
#P window linecount 4;
#P newex 327 176 78 196617 expr ((440. * exp(.057762265 * $f1))* 0.002273);
#P window linecount 1;
#P newex 51 175 47 196617 * 1000.;
#P newex 241 199 48 196617 pack 0 0;
#P newex 51 478 135 196617 pfft~ gizmo_loadme 1024 2;
#P newex 220 253 31 196617 / 1.;
#P message 51 270 56 196617 $2 , $3 $1;
#P newex 51 241 57 196617 pack 0 0 0;
#P newex 241 229 30 196617 !-;
#P newex 51 353 82 196617 play~ $0sample;
#P newex 51 291 32 196617 line~;
#P window linecount 2;
#P comment 83 40 453 196617 duration , start of loop , end of loop ,
transposition interval in semitones , amplitude , sample buffer~ name ,
envelope buffer~ name;
#P window linecount 1;
#P comment 341 233 63 196617 transratio;
#P window linecount 4;
#P comment 97 419 122 196617 final transposition factor is a function of
BOTH transposition interval AND duration;
#P window linecount 2;
#P comment 61 136 54 196617 duration in seconds;
#P comment 153 134 79 196617 sample start in milliseconds;
#P comment 338 136 64 196617 transposition in semitones;
#P window linecount 1;
#P comment 430 136 71 196617 amplitude 0..1;
#P window linecount 2;
#P comment 522 135 67 196617 sample buffer~ name;
#P comment 89 292 59 196617 mute at end of line;
#P comment 362 472 56 196617 envelope off;
#P window linecount 1;
#P comment 732 353 52 196617 unmute;
#P window linecount 3;
#P comment 219 278 57 196617 return to original pitch;
#P window linecount 5;
#P comment 339 248 79 196617 change ratio to include desired transposition
from original pitch;
#P user panel 202 165 96 155;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 302 164 121 157;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 31 0 32 0;
#P connect 32 0 23 0;
#P connect 23 0 18 0;
#P connect 18 0 19 0;
#P connect 19 0 15 0;
#P connect 15 0 16 0;
#P fasten 30 0 16 0 516 335 56 335;
#P connect 16 0 28 0;
#P connect 28 0 21 0;
#P connect 21 0 39 0;
#P connect 39 0 38 0;
#P fasten 22 0 18 1 246 222 79 222;
#P fasten 25 0 28 1 149 412 81 412;
#P fasten 32 4 39 1 424 502 81 502;
#P fasten 40 0 39 1 341 499 81 499;
#P fasten 15 0 26 0 56 343 149 343;
#P connect 26 0 25 0;
#P fasten 41 0 25 0 608 373 149 373;
#P fasten 18 0 27 0 56 263 166 263;
#P connect 27 0 26 1;
#P fasten 29 0 21 1 313 473 181 473;
#P fasten 23 0 20 0 56 235 225 235;
#P fasten 32 1 22 0 148 193 246 193;
#P fasten 22 0 17 0 246 211 246 211;
#P connect 17 0 20 1;
#P fasten 32 2 22 1 240 161 284 161;
#P fasten 20 0 29 0 225 274 313 274;
#P connect 32 3 24 0;
#P connect 24 0 29 1;
#P fasten 15 1 40 0 78 328 341 328;
#P connect 32 5 30 0;
#P connect 32 6 41 0;
#P fasten 15 1 35 0 78 322 636 322;
#P fasten 36 0 35 0 675 361 636 361;
#P fasten 34 0 33 0 725 396 636 396;
#P fasten 35 0 33 0 636 390 636 390;
#P fasten 31 0 37 0 56 92 725 92;
#P connect 37 0 34 0;
#P window clipboard copycount 46;

On 1/11/08 9:04 PM, “mzed” wrote:

>
> Quote: psnow wrote on Fri, 11 January 2008 17:21
> —————————————————-
>> the problem ensues.
>> i suppose it must be me.
>> unfortunately i cant run max/msp in any other machines to test it out.
>> is this working out in everyone else’s macs?
>> when i try to type in exactly what is written, there are no inputs or outputs
>> on my object.
>> this is frustrating.
>>
>> on the other hand, great GUI. :)
>>
>>
> —————————————————-
>
> Thanks. How does the help patch for gizmo work for you?
>
> mz
>
>
> –
> || michael f. zbyszynski — molecular gastronimist
> || http://www.cnmat.berkeley.edu/
> || http://www.mikezed.com/
>
>
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#120266
Jan 12, 2008 at 3:41pm

the pfft~ gizmo__loadme error happens again…
i don’t understand the problem. i will re install max/msp to see what happens..

#120267
Jan 12, 2008 at 3:57pm

On 12 janv. 08, at 16:41, mithat madra wrote:

> the pfft~ gizmo__loadme error happens again…
> i don’t understand the problem. i will re install max/msp to see
> what happens..

gizmo_loadme patch is in the max-help folder. It’s not in the search
path. You may have to copy somewhere else in your search path to use
it all the time.

HTH,
ej

#120268
Jan 13, 2008 at 4:23pm

emmanuel you were right. it was not in the search path.
thank you all for your help this was very helpful..

#120269
Jan 14, 2008 at 8:50pm

Quote: Emmanuel Jourdan wrote on Sat, 12 January 2008 07:57
—————————————————-
> On 12 janv. 08, at 16:41, mithat madra wrote:
>
> > the pfft~ gizmo__loadme error happens again…
> > i don’t understand the problem. i will re install max/msp to see
> > what happens..
>
>
> gizmo_loadme patch is in the max-help folder. It’s not in the search
> path. You may have to copy somewhere else in your search path to use
> it all the time.
>

Dang.

I though that ./max-help was in the search path by default. I have no problem loading this patch, but now I see that is because there is a version of it included in FTM. I’ve been had!

mz

#120270

You must be logged in to reply to this topic.