Forums > MaxMSP

Switching Between Delay Times

May 2, 2008 | 3:21 pm

Hi there,

What I’ve done is created a delay effect and with four different delay times (whole note, half note etc..) What I’m finding difficult is switching between the delay times without each number box interfering with each other. Hopefully the patch below will explain better.

Thanks

max v2;
#N vpatcher 0 0 1280 702;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#P newex 466 359 74 9240586 tapout~ 1.;
#P window setfont Tahoma 9.;
#P window linecount 2;
#P comment 558 279 39 19726345 Eighth Note;
#P comment 498 278 39 19726345 Quarter Note;
#P window linecount 1;
#P comment 438 277 53 19726345 Half Note;
#P flonum 558 260 35 9 0 0 0 301 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 558 236 27 19726345 / 8;
#P flonum 499 261 35 9 0 0 0 301 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 445 262 35 9 0 0 0 301 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 388 260 35 9 0 0 0 301 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 499 237 27 19726345 / 4;
#P newex 445 238 27 19726345 / 2;
#P flonum 488 155 35 9 0 0 0 301 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Tahoma 12.;
#P window linecount 2;
#P comment 524 148 154 19726348 MS in 1 bar (being received from a metronome);
#P window setfont Tahoma 9.;
#P window linecount 1;
#P comment 380 277 53 19726345 Whole Note;
#P comment 545 362 57 19726345 Delay Time;
#P window setfont Tahoma 14.;
#P window linecount 5;
#P comment 628 238 181 19726350 I need the user to be able to switch between each note time , without the number boxes interfering with each other;
#P connect 4 0 7 0;
#P connect 4 0 5 0;
#P connect 5 0 8 0;
#P connect 11 0 15 0;
#P connect 9 0 15 0;
#P connect 8 0 15 0;
#P connect 7 0 15 0;
#P connect 4 0 6 0;
#P connect 6 0 9 0;
#P connect 4 0 10 0;
#P connect 10 0 11 0;
#P pop;


May 2, 2008 | 3:29 pm

On 2 mai 08, at 17:21, Chris Scott wrote:

> Hi there,
>
> What I’ve done is created a delay effect and with four different
> delay times (whole note, half note etc..) What I’m finding difficult
> is switching between the delay times without each number box
> interfering with each other. Hopefully the patch below will explain
> better.

In order to have multiple delays at the same time, you need to use
multiple [tapout~] or one [tapout~ 0. 0. 0. 0.] with arguments to have
different playhead at the same time.

ej


May 2, 2008 | 4:03 pm

#P user ubutton 565 288 38 22 0 0;
#P user ubutton 506 285 38 22 0 0;
#P user ubutton 444 284 51 13 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 566 353 27 196617 f;
#P newex 489 353 27 196617 f;
#P newex 457 353 27 196617 f;
#P user ubutton 391 285 51 13 0 0;
#P newex 428 353 27 196617 f;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 471 411 74 1441802 tapout~ 1.;
#P window setfont Tahoma 9.;
#P window linecount 2;
#P comment 565 286 39 431423497 Eighth Note;
#P comment 505 285 39 431423497 Quarter Note;
#P window linecount 1;
#P comment 445 284 53 431423497 Half Note;
#P newex 583 316 27 431423497 / 8.;
#P newex 506 316 27 431423497 / 4.;
#P newex 474 316 27 431423497 / 2.;
#P flonum 495 162 35 9 0 0 0 6583 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Tahoma 12.;
#P window linecount 2;
#P comment 531 155 168 431423500 MS in 1 bar (being received from a metronome);
#P window setfont Tahoma 9.;
#P window linecount 1;
#P comment 390 284 53 431423497 Whole Note;
#P comment 550 414 57 431423497 Delay Time;
#P window setfont Tahoma 14.;
#P window linecount 5;
#P comment 635 245 181 431423502 I need the user to be able to switch between each note time , without the number boxes interfering with each other;
#P connect 16 0 11 0;
#P connect 4 0 12 1;
#P connect 4 0 5 0;
#P connect 4 0 6 0;
#P connect 4 0 7 0;
#P connect 19 1 16 0;
#P connect 7 0 16 1;
#P connect 15 0 11 0;
#P connect 18 1 15 0;
#P connect 6 0 15 1;
#P connect 12 0 11 0;
#P connect 14 0 11 0;
#P connect 17 1 14 0;
#P connect 5 0 14 1;
#P connect 13 1 12 0;
#P window clipboard copycount 20;


May 2, 2008 | 4:16 pm

thanks thats just what I needed!


May 2, 2008 | 5:31 pm

On May 2, 2008, at 8:21 AM, Chris Scott wrote:
> What I’ve done is created a delay effect and with four different
> delay times (whole note, half note etc..) What I’m finding difficult
> is switching between the delay times without each number box
> interfering with each other. Hopefully the patch below will explain
> better.

There are many ways to do this, like pretty much everything else in
Max. This is one of them:

#P window setfont Tahoma 9.;
#P window linecount 1;
#P comment 94 152 59 -1501560823 Eighth Note;
#P comment 94 136 65 -1501560823 Quarter Note;
#P comment 94 120 50 -1501560823 Half Note;
#P comment 94 104 58 -1501560823 Whole Note;
#P user radiogroup 75 103 18 64;
#X size 4;
#X offset 16;
#X inactive 0;
#X itemtype 0;
#X flagmode 0;
#X set 2;
#X done;
#P flonum 75 194 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#N vpatcher 623 116 1350 524;
#P origin -64 0;
#P window setfont Tahoma 9.;
#P window linecount 1;
#P newex 182 110 481 -1501560823 sel 0 1 2 3;
#P newex 77 79 27 -1501560823 + 1;
#P newex 60 52 27 -1501560823 t i i;
#P newex 77 199 478 -1501560823 switch 4;
#P flonum 77 239 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#N comlet Note Index;
#P inlet 60 28 15 0;
#P button 533 134 15 0;
#P button 416 134 15 0;
#P button 299 134 15 0;
#P button 182 134 15 0;
#P newex 545 158 27 -1501560823 f;
#P newex 428 158 27 -1501560823 f;
#P newex 311 158 27 -1501560823 f;
#P newex 194 158 27 -1501560823 f;
#P window linecount 2;
#P comment 584 80 39 -1501560823 Eighth Note;
#P comment 467 80 39 -1501560823 Quarter Note;
#P comment 350 80 31 -1501560823 Half Note;
#P flonum 545 83 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 545 60 27 -1501560823 / 8;
#P flonum 428 84 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 311 85 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 194 83 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 428 61 27 -1501560823 / 4;
#P newex 311 62 27 -1501560823 / 2;
#P window linecount 2;
#P comment 233 80 39 -1501560823 Whole Note;
#N comlet Whole note time;
#P inlet 545 30 15 0;
#P outlet 77 263 15 0;
#P connect 21 0 24 0;
#P connect 24 1 25 0;
#P connect 25 0 23 0;
#P connect 23 0 22 0;
#P connect 22 0 0 0;
#P fasten 24 0 26 0 65 106 187 106;
#P connect 26 0 17 0;
#P fasten 1 0 5 0 550 53 199 53;
#P connect 5 0 13 0;
#P connect 17 0 13 0;
#P connect 13 0 23 1;
#P connect 26 1 18 0;
#P fasten 1 0 3 0 550 53 316 53;
#P connect 3 0 6 0;
#P connect 6 0 14 0;
#P connect 18 0 14 0;
#P connect 14 0 23 2;
#P connect 26 2 19 0;
#P fasten 1 0 4 0 550 53 433 53;
#P connect 4 0 7 0;
#P connect 7 0 15 0;
#P connect 19 0 15 0;
#P connect 15 0 23 3;
#P connect 26 3 20 0;
#P connect 1 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 16 0;
#P connect 20 0 16 0;
#P connect 16 0 23 4;
#P pop;
#P newobj 75 172 78 196617 p noteDivisions;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 75 274 74 1441802 tapout~ 1.;
#P window setfont Tahoma 9.;
#P flonum 155 63 35 9 0 0 0 -22912 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Tahoma 12.;
#P window linecount 2;
#P comment 191 56 168 -1501560820 MS in 1 bar (being received from a
metronome);
#P window setfont Tahoma 9.;
#P window linecount 1;
#P comment 154 277 57 -1501560823 Delay Time;
#P connect 6 0 4 0;
#P connect 5 0 3 0;
#P connect 4 0 5 0;
#P fasten 2 0 4 1 160 167 148 167;
#P window clipboard copycount 11;

Chris Muir
cbm@well.com

http://www.xfade.com


May 2, 2008 | 11:11 pm

here is a neat routine from the forum a long time ago
to crossfade smoothly to the new delay time

#P user ezdac~ 384 441 428 474 0;
#P user ubutton 478 154 38 22 0 0;
#P user ubutton 419 151 38 22 0 0;
#P user ubutton 357 150 51 13 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 479 219 27 196617 f;
#P newex 402 219 27 196617 f;
#P newex 370 219 27 196617 f;
#P user ubutton 304 151 51 13 0 0;
#P newex 341 219 27 196617 f;
#P window setfont Tahoma 9.;
#P window linecount 2;
#P comment 478 152 39 431423497 Eighth Note;
#P comment 418 151 39 431423497 Quarter Note;
#P window linecount 1;
#P comment 358 150 53 431423497 Half Note;
#P newex 496 182 27 431423497 / 8.;
#P newex 419 182 27 431423497 / 4.;
#P newex 387 182 27 431423497 / 2.;
#P flonum 408 28 35 9 0 0 0 6583 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Tahoma 12.;
#P window linecount 2;
#P comment 444 21 168 431423500 MS in 1 bar (being received from a metronome);
#P window setfont Tahoma 9.;
#P window linecount 1;
#P comment 303 150 53 431423497 Whole Note;
#P window setfont Tahoma 14.;
#P window linecount 5;
#P comment 548 111 181 431423502 I need the user to be able to switch between each note time , without the number boxes interfering with each other;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 251 306 45 196617 loadbang;
#P message 287 331 35 196617 1 0 0.;
#P message 251 331 35 196617 0 0 1.;
#P newex 384 402 97 196617 matrix~ 2 1 0.;
#N vpatcher 627 266 971 667;
#P origin 4 0;
#N comlet delay time;
#P inlet 117 40 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 3 50 32 196617 1000;
#N comlet matrix;
#P outlet 117 323 15 0;
#P newex 36 25 45 196617 loadbang;
#P message 72 50 35 196617 1 0 0.;
#P message 36 50 35 196617 0 0 1.;
#P newex 3 233 63 196617 pipe 0. 100.;
#P newex 3 265 27 196617 t f f;
#N vpatcher 616 99 1085 426;
#P window setfont "Sans Serif" 9.;
#P message 16 123 14 196617 0;
#P newex 16 99 45 196617 loadbang;
#N vpatcher 40 104 514 507;
#P window setfont "Sans Serif" 9.;
#P newex 152 141 27 196617 t i i;
#P newex 55 112 27 196617 t i i;
#P newex 206 290 54 196617 delay 100;
#P newex 206 268 31 196617 sel 0;
#P newex 277 289 54 196617 delay 100;
#P newex 277 267 31 196617 sel 0;
#P outlet 277 312 15 0;
#P outlet 206 312 15 0;
#P message 72 181 60 196617 0 0 $1 100;
#P message 169 181 60 196617 1 0 $1 100;
#P newex 152 113 27 196617 !- 1;
#P outlet 72 233 15 0;
#P inlet 55 67 15 0;
#P comment 234 184 100 196617 inlet oulet value time;
#P connect 1 0 12 0;
#P connect 12 1 5 0;
#P connect 5 0 2 0;
#P connect 4 0 2 0;
#P connect 1 0 3 0;
#P connect 3 0 13 0;
#P connect 13 1 4 0;
#P connect 12 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 6 0;
#P connect 13 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 7 0;
#P pop;
#P newobj 67 177 91 196617 p MATRIX-COEFFS;
#P newex 265 237 42 196617 float 0.;
#P newex 150 235 42 196617 float 0.;
#P newex 67 97 240 196617 t b f f;
#P comment 141 67 268 196617 Pass values no faster than 100 ms (makes sure our ramp gets to its destination BEFORE changing delay time);
#P newex 67 66 69 196617 speedlim 100;
#P inlet 67 38 15 0;
#P toggle 67 147 15 0;
#P comment 64 291 45 196617 matrix~;
#P comment 257 290 32 196617 tap 2;
#P outlet 265 266 15 0;
#P outlet 150 266 15 0;
#P outlet 67 267 15 0;
#P comment 139 290 32 196617 tap 1;
#P comment 89 39 100 196617 Incoming Delay Time;
#P connect 15 0 16 0;
#P connect 8 0 9 0;
#P connect 9 0 11 0;
#P connect 16 0 7 0;
#P connect 11 0 7 0;
#P connect 7 0 14 0;
#P connect 14 0 2 0;
#P connect 14 1 12 0;
#P connect 12 0 3 0;
#P connect 11 1 12 1;
#P connect 14 2 13 0;
#P connect 13 0 4 0;
#P connect 11 2 13 1;
#P pop;
#P newobj 117 292 158 196617 p CHANGE-DELAYS-AND-MATRIX;
#N comlet 2;
#P outlet 265 323 15 0;
#N comlet 1;
#P outlet 191 323 15 0;
#P connect 7 0 9 0;
#P connect 9 0 4 0;
#P connect 4 0 3 0;
#P connect 7 0 5 0;
#P connect 7 0 6 0;
#P connect 10 0 2 0;
#P connect 2 0 8 0;
#P connect 5 0 8 0;
#P connect 6 0 8 0;
#P connect 2 1 0 0;
#P connect 3 0 0 0;
#P connect 2 2 1 0;
#P connect 3 1 1 0;
#P pop 1;
#P newobj 383 319 99 196617 p overlap;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 384 370 97 1441802 tapout~ 30. 30.;
#P connect 2 0 24 0;
#P connect 2 0 24 1;
#P connect 20 0 1 0;
#P connect 19 0 1 0;
#P connect 18 0 1 0;
#P connect 16 0 1 0;
#P connect 9 0 16 1;
#P connect 9 0 10 0;
#P connect 9 0 11 0;
#P connect 9 0 12 0;
#P connect 17 1 16 0;
#P connect 10 0 18 1;
#P connect 21 1 18 0;
#P connect 11 0 19 1;
#P connect 22 1 19 0;
#P connect 12 0 20 1;
#P connect 23 1 20 0;
#P connect 5 0 3 0;
#P connect 5 0 4 0;
#P connect 1 1 0 0;
#P connect 4 0 2 0;
#P connect 3 0 2 0;
#P connect 0 0 2 0;
#P connect 1 0 2 0;
#P connect 1 2 0 1;
#P connect 0 1 2 1;
#P window clipboard copycount 25;


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