Forums > MaxMSP

MIDI control of sample playback with note on/off

February 16, 2007 | 1:31 pm

Hi everyone,

I’m trying to make a simple MIDI-controlled sample player. Sounds
should be selected and play back only when/as long as the
corresponding key is pressed. The buffers are created/loaded by
dropping a folder with soundfiles on the field in the "buffers"
subpatch. I’m using a Doepfer CTM64 in note on/note off mode to
trigger the samples.
It works fine as long as I simply push a button to play a sample and
let go of it to stop the playback. However, I’d like to be able to
play back one sample by pushing the corresponding button, and then
switch to another sample without pause by pushing another button. At
the moment that I let go of the first button playback stops, however,
for fairly obvious reasons, even to me.
The question is, how can I switch from sample to sample without
stopping playback when letting go of one button, while another button
is still pressed? Some way of letting the patch know that a certain
button is still pressed, even though another one is being released and
sending a note-off message?

I’d be very grateful for any suggestions… Thanks!

Patch pasted below (is it still okay to paste patches into list
messages like this?)

Alexandra

max v2;
#N vpatcher 37 61 785 672;
#P origin 145 0;
#P window setfont "Sans Serif" 9.;
#P newex 15 229 48 196617 loadbang;
#P user umenu 167 173 78 196647 1 64 189 1;
#X add elapsed time;
#X add remaining time;
#P number 284 174 24 9 0 0 8224 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 272 174 13 9 0 9 8226 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 265 174 13 9 0 9 8226 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 253 174 13 9 0 9 8226 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 246 174 13 9 0 9 8226 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 279 175 12 196617 :;
#P comment 260 175 12 196617 :;
#P message 218 222 14 196617 1;
#P flonum 268 222 36 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 253 222 14 196617 2;
#P message 233 222 19 196617 -1;
#P comment 145 222 77 196617 playback speed;
#N vpatcher 466 321 866 621;
#P origin 0 -220;
#P window setfont "Sans Serif" 9.;
#P flonum 22 57 45 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 23 35 63 196617 snapshot~ 1;
#P flonum 234 127 98 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 281 93 57 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 234 109 68 196617 zmap 0 1 0 1;
#N comlet groove~ sync;
#P inlet 23 1 15 0;
#P newex 124 161 27 196617 + 1;
#N comlet elapsed/remaining time toggle;
#P inlet 124 145 15 0;
#P newex 165 215 40 196617 switch;
#N comlet selection length;
#P inlet 209 16 15 0;
#P newex 192 194 27 196617 !- 0;
#P flonum 165 244 76 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N comlet;
#P outlet 244 471 15 0;
#N comlet;
#P outlet 210 471 15 0;
#N comlet;
#P outlet 176 471 15 0;
#N comlet;
#P outlet 142 471 15 0;
#N comlet;
#P outlet 108 471 15 0;
#N vpatcher 608 206 1008 506;
#P outlet 186 215 15 0;
#P outlet 112 215 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 128 169 27 196617 -;
#P newex 171 124 30 196617 * 10;
#P newex 171 93 29 196617 / 10;
#P inlet 128 48 15 0;
#P fasten 1 0 4 0 218 125 218 184;
#P connect 0 0 3 0;
#P connect 2 0 3 1;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 3 0 5 0;
#P pop;
#P newobj 177 436 45 196617 p twodig;
#N vpatcher 608 206 1008 506;
#P outlet 186 215 15 0;
#P outlet 112 215 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 128 169 27 196617 -;
#P newex 171 124 30 196617 * 10;
#P newex 171 93 29 196617 / 10;
#P inlet 128 48 15 0;
#P fasten 1 0 4 0 218 125 218 184;
#P connect 0 0 3 0;
#P connect 2 0 3 1;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 3 0 5 0;
#P pop;
#P newobj 112 436 45 196617 p twodig;
#P comment 258 401 64 196617 milliseconds;
#P comment 179 399 44 196617 seconds;
#P flonum 112 380 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 101 271 48 196617 / 60000;
#P newex 172 309 33 196617 % 60;
#P flonum 182 380 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 168 271 42 196617 / 1000;
#P flonum 254 380 55 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 257 309 48 196617 % 1000.;
#P comment 107 400 44 196617 minutes;
#P connect 27 0 28 0;
#P connect 23 0 27 0;
#P connect 17 0 6 0;
#P connect 10 0 12 0;
#P connect 6 0 7 0;
#P connect 7 0 10 0;
#P connect 21 0 22 0;
#P connect 10 1 13 0;
#P connect 22 0 20 0;
#P connect 20 0 17 0;
#P connect 17 0 3 0;
#P connect 3 0 5 0;
#P connect 11 0 14 0;
#P connect 4 0 11 0;
#P connect 26 0 20 1;
#P connect 5 0 4 0;
#P connect 26 0 18 0;
#P connect 18 0 20 2;
#P connect 19 0 18 1;
#P connect 11 1 15 0;
#P connect 28 0 24 0;
#P hidden connect 24 0 26 0;
#P connect 2 0 16 0;
#P connect 1 0 2 0;
#P connect 17 0 1 0;
#P connect 19 0 25 0;
#P hidden connect 25 0 24 4;
#P pop;
#P newobj 246 147 66 196617 p e/r time;
#N vpatcher 260 239 860 639;
#N comlet groove sync output;
#P outlet 322 256 15 0;
#N comlet playback speed;
#P inlet 256 139 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 44 178 55 196617 route 127;
#P message 23 246 49 196617 startloop;
#P message 85 245 27 196617 stop;
#P outlet 306 256 15 0;
#P outlet 290 256 15 0;
#N comlet buffer selection;
#P inlet 284 139 15 0;
#N comlet note on/off;
#P inlet 65 95 15 0;
#P toggle 346 139 15 0;
#P message 346 155 41 196617 loop $1;
#P newex 256 155 27 196617 sig~;
#P newex 284 155 61 196617 prepend set;
#P newex 296 201 64 196617 groove~ a 2;
#P connect 11 0 10 0;
#P connect 5 0 11 0;
#P connect 11 1 9 0;
#P connect 12 0 2 0;
#P connect 6 0 1 0;
#P connect 0 0 7 0;
#P connect 1 0 0 0;
#P connect 2 0 0 0;
#P connect 3 0 0 0;
#P connect 10 0 0 0;
#P connect 9 0 0 0;
#P connect 0 1 8 0;
#P connect 0 2 13 0;
#P connect 4 0 3 0;
#P pop;
#P newobj 147 248 49 196617 p groove;
#P newex 35 25 40 196617 notein;
#P newex 165 463 31 196617 dac~;
#P message 143 300 14 196617 0;
#P newex 83 407 62 196617 prepend set;
#P message 131 284 26 196617 127;
#P number 158 407 35 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 183 284 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 158 284 24 100 158 0 1.071519 7.94321 10.;
#P user ubumenu 144 87 197 196617 0 1 1 0;
#X prefix_set 0 0 0;
#N vpatcher 817 521 945 649;
#P origin 84 127;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden message -28 107 32 196617 clear;
#P button 5 90 15 0;
#P hidden newex 5 106 105 196617 js remove-buffers-js;
#P hidden outlet 173 108 15 0;
#P hidden outlet 157 108 15 0;
#P hidden outlet 141 108 15 0;
#P hidden newex 134 55 45 196617 loadbang;
#P hidden message 134 73 28 196617 AIFF;
#N thispatcher;
#Q end;
#P hidden newobj 80 108 60 196617 thispatcher;
#P hidden newex 80 90 64 196617 buffermaker;
#P user dropfile 7 -37 131 87 0;
#P user panel 5 -39 128 128;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 10 0 11 0;
#P hidden connect 10 0 9 0;
#P hidden connect 1 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 5 0 4 0;
#P hidden connect 4 0 2 1;
#P hidden connect 2 1 6 0;
#P hidden connect 11 0 7 0;
#P hidden connect 2 2 7 0;
#P hidden connect 2 3 8 0;
#P pop;
#P newobj 76 25 51 196617 p buffers;
#P background;
#P connect 2 1 6 0;
#P connect 25 0 5 0;
#P connect 9 0 1 0;
#P connect 0 1 1 0;
#P connect 9 1 10 0;
#P connect 4 0 2 0;
#P connect 7 0 2 0;
#P connect 5 0 2 0;
#P connect 10 0 2 0;
#P connect 6 0 4 0;
#P connect 2 0 8 0;
#P connect 16 0 10 1;
#P connect 13 0 10 1;
#P connect 14 0 10 1;
#P connect 15 0 10 1;
#P connect 25 0 24 0;
#P connect 2 1 3 0;
#P connect 10 1 3 0;
#P connect 1 1 10 2;
#P connect 3 0 8 1;
#P connect 25 0 16 0;
#P connect 10 2 11 0;
#P connect 11 0 19 0;
#P connect 11 1 20 0;
#P connect 11 2 21 0;
#P connect 11 3 22 0;
#P connect 24 0 11 1;
#P connect 11 4 23 0;
#P pop;


February 16, 2007 | 4:24 pm

I did this a while back using csound~ and the loscil unit generator. google
the csound manual and look at sample playback.

On 2/16/07 8:31 AM, "|||||||||| ||||||||||" wrote:

> Hi everyone,
>
> I’m trying to make a simple MIDI-controlled sample player. Sounds
> should be selected and play back only when/as long as the
> corresponding key is pressed. The buffers are created/loaded by
> dropping a folder with soundfiles on the field in the "buffers"
> subpatch. I’m using a Doepfer CTM64 in note on/note off mode to
> trigger the samples.
> It works fine as long as I simply push a button to play a sample and
> let go of it to stop the playback. However, I’d like to be able to
> play back one sample by pushing the corresponding button, and then
> switch to another sample without pause by pushing another button. At
> the moment that I let go of the first button playback stops, however,
> for fairly obvious reasons, even to me.
> The question is, how can I switch from sample to sample without
> stopping playback when letting go of one button, while another button
> is still pressed? Some way of letting the patch know that a certain
> button is still pressed, even though another one is being released and
> sending a note-off message?
>
> I’d be very grateful for any suggestions… Thanks!
>
> Patch pasted below (is it still okay to paste patches into list
> messages like this?)
>
> Alexandra

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


February 16, 2007 | 7:11 pm

|||||||||| |||||||||| wrote:
> I’d be very grateful for any suggestions… Thanks!

What you want it called polyphony, check out poly~ and the
examples/tutorials…

> Patch pasted below (is it still okay to paste patches into list
> messages like this?)

Yes, that way I could quickly check and verify that there is only one
groove~ object. You’d need either one groove~ per buffer~, or a poly~…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


March 1, 2007 | 10:07 pm

Stefan and others,

Thanks very much for the response. It made me realize, by looking
into poly~ among other things, that I could actually make something
that could play as many samples as I could hold down keys.

After working my way through the poly and poly~ tutorials and help
patches, I tried to put together a new version of my patch, using
poly~ to control 64 instances of my "polygroove" patch.
I tried to follow the logic in the tutorials. However, the way poly~
works is still hazy to me, and I can’t get my patch to work right. I
don’t know if the [poly 32] makes any sense, whether or not I need a
[thispoly~] or if where the [target] message is sent to is right.
Could someone maybe have a quick look at my patch and notice where I
messed up?
(Drop a folder on the field in the buffer subpatch to create buffers)

The idea is simple: My Doepfer CTM64 has 64 keys that send note on/
off messages. I’d like each of these buttons to trigger looped
playback of a particular sample, a different sample for each key. The
sample should keep looping until I let go of the key, and it should
be possible to play several samples at once by holding down different
keys simultaneously. 64 sounds at my fingertips…

Thanks for any hints!
Alexandra

max v2;
#N vpatcher 592 193 1340 804;
#P origin 145 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 73 153 53 196617 target $1;
#P newex 58 86 53 196617 poly 32;
#P toggle 127 443 15 0;
#P newex 160 250 103 196617 poly~ polygroove 64;
#P newex 12 190 48 196617 loadbang;
#P message 207 229 14 196617 1;
#P flonum 257 229 36 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 242 229 14 196617 2;
#P message 222 229 19 196617 -1;
#P comment 134 229 77 196617 playback speed;
#P newex 35 25 40 196617 notein;
#P newex 165 463 31 196617 dac~;
#P message 143 300 14 196617 0;
#P newex 83 407 62 196617 prepend set;
#P message 131 284 26 196617 127;
#P number 158 407 35 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 183 284 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 158 284 24 100 158 0 1.071519 7.94321 10.;
#N vpatcher 817 521 945 649;
#P origin 84 87;
#P window setfont "Sans Serif" 9.;
#P hidden message -28 147 32 196617 clear;
#P button 5 130 15 0;
#P hidden newex 5 146 105 196617 js remove-buffers-js;
#P hidden outlet 173 148 15 0;
#P hidden outlet 157 148 15 0;
#P hidden outlet 141 148 15 0;
#P hidden newex 134 95 45 196617 loadbang;
#P hidden message 134 113 28 196617 AIFF;
#N thispatcher;
#Q end;
#P hidden newobj 80 148 60 196617 thispatcher;
#P hidden newex 80 130 64 196617 buffermaker;
#P user dropfile 7 3 131 127 0;
#P user panel 5 1 128 128;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 10 0 11 0;
#P hidden connect 10 0 9 0;
#P hidden connect 1 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 5 0 4 0;
#P hidden connect 4 0 2 1;
#P hidden connect 2 1 6 0;
#P hidden connect 2 2 7 0;
#P hidden connect 11 0 7 0;
#P hidden connect 2 3 8 0;
#P pop;
#P newobj 76 25 51 196617 p buffers;
#P background;
#P connect 8 0 17 0;
#P connect 17 0 18 0;
#P connect 1 1 5 0;
#P connect 8 1 17 1;
#P connect 14 0 4 0;
#P connect 15 0 1 0;
#P connect 4 0 1 0;
#P connect 6 0 1 0;
#P connect 3 0 1 0;
#P connect 5 0 3 0;
#P connect 17 2 15 0;
#P connect 18 0 15 0;
#P connect 16 0 7 0;
#P connect 1 0 7 0;
#P connect 15 1 2 0;
#P connect 1 1 2 0;
#P connect 2 0 7 1;
#P connect 13 0 15 1;
#P connect 14 0 13 0;
#P connect 17 1 15 2;
#P pop;

This is the "polygroove" patch the [poly~] object refers to:
max v2;
#N vpatcher 484 310 1084 710;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N in 3;
#P newobj 200 30 25 196617 in 3;
#P user ubumenu 200 51 197 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 0;
#N out~ 3;
#P newobj 349 316 39 196617 out~ 3;
#N out~ 2;
#P newobj 304 313 39 196617 out~ 2;
#N out~ 1;
#P newobj 262 312 39 196617 out~ 1;
#N in~ 2;
#P newobj 248 115 33 196617 in~ 2;
#N in 1;
#P newobj 49 73 25 196617 in 1;
#P toggle 388 139 15 0;
#P message 388 155 68 196617 loopinterp $1;
#P newex 346 96 48 196617 loadbang;
#P newex 44 178 55 196617 route 127;
#P message 23 246 49 196617 startloop;
#P message 85 245 27 196617 stop;
#P toggle 346 139 15 0;
#P message 346 155 41 196617 loop $1;
#P newex 256 155 27 196617 sig~;
#P newex 284 155 61 196617 prepend set;
#P newex 296 201 64 196617 groove~ a 2;
#P connect 7 0 6 0;
#P connect 11 0 7 0;
#P connect 7 1 5 0;
#P connect 17 0 16 0;
#P connect 12 0 2 0;
#P connect 0 0 13 0;
#P connect 16 1 1 0;
#P connect 9 0 0 0;
#P connect 5 0 0 0;
#P connect 6 0 0 0;
#P connect 3 0 0 0;
#P connect 2 0 0 0;
#P connect 1 0 0 0;
#P connect 0 1 14 0;
#P connect 8 0 4 0;
#P connect 4 0 3 0;
#P connect 0 2 15 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P pop;

On Feb 16, 2007, at 8:11 PM, Stefan Tiedje wrote:

> |||||||||| |||||||||| wrote:
>> I’d be very grateful for any suggestions… Thanks!
>
> What you want it called polyphony, check out poly~ and the examples/
> tutorials…
>
>> Patch pasted below (is it still okay to paste patches into list
>> messages like this?)
>
> Yes, that way I could quickly check and verify that there is only
> one groove~ object. You’d need either one groove~ per buffer~, or a
> poly~…
>
> Stefan
>
> —
> Stefan Tiedje————x——-
> –_____———–|————–
> –(_|_ —-|—–|—–()——-
> — _|_)—-|—–()————–
> ———-()——–www.ccmix.com
>


March 4, 2007 | 9:27 pm

Stefan and others,

Thanks very much for the response. It made me realize, by looking
into poly~ among other things, that I could actually make something
that could play as many samples as I could hold down keys.

After working my way through the poly and poly~ tutorials and help
patches, I tried to put together a new version of my patch, using
poly~ to control 64 instances of my "polygroove" patch.
I tried to follow the logic in the tutorials. However, the way poly~
works is still hazy to me, and I can’t get my patch to work right. I
don’t know if the [poly 32] makes any sense, whether or not I need a
[thispoly~] or if where the [target] message is sent to is right.
Could someone maybe have a quick look at my patch and notice where I
messed up?
(Drop a folder on the field in the buffer subpatch to create buffers)

The idea is simple: My Doepfer CTM64 has 64 keys that send note on/
off messages. I’d like each of these buttons to trigger looped
playback of a particular sample, a different sample for each key. The
sample should keep looping until I let go of the key, and it should
be possible to play several samples at once by holding down different
keys simultaneously. 64 sounds at my fingertips…

Thanks for any hints!
Alexandra

max v2;
#N vpatcher 592 193 1340 804;
#P origin 145 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 73 153 53 196617 target $1;
#P newex 58 86 53 196617 poly 32;
#P toggle 127 443 15 0;
#P newex 160 250 103 196617 poly~ polygroove 64;
#P newex 12 190 48 196617 loadbang;
#P message 207 229 14 196617 1;
#P flonum 257 229 36 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 242 229 14 196617 2;
#P message 222 229 19 196617 -1;
#P comment 134 229 77 196617 playback speed;
#P newex 35 25 40 196617 notein;
#P newex 165 463 31 196617 dac~;
#P message 143 300 14 196617 0;
#P newex 83 407 62 196617 prepend set;
#P message 131 284 26 196617 127;
#P number 158 407 35 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 183 284 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 158 284 24 100 158 0 1.071519 7.94321 10.;
#N vpatcher 817 521 945 649;
#P origin 84 87;
#P window setfont "Sans Serif" 9.;
#P hidden message -28 147 32 196617 clear;
#P button 5 130 15 0;
#P hidden newex 5 146 105 196617 js remove-buffers-js;
#P hidden outlet 173 148 15 0;
#P hidden outlet 157 148 15 0;
#P hidden outlet 141 148 15 0;
#P hidden newex 134 95 45 196617 loadbang;
#P hidden message 134 113 28 196617 AIFF;
#N thispatcher;
#Q end;
#P hidden newobj 80 148 60 196617 thispatcher;
#P hidden newex 80 130 64 196617 buffermaker;
#P user dropfile 7 3 131 127 0;
#P user panel 5 1 128 128;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 10 0 11 0;
#P hidden connect 10 0 9 0;
#P hidden connect 1 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 5 0 4 0;
#P hidden connect 4 0 2 1;
#P hidden connect 2 1 6 0;
#P hidden connect 2 2 7 0;
#P hidden connect 11 0 7 0;
#P hidden connect 2 3 8 0;
#P pop;
#P newobj 76 25 51 196617 p buffers;
#P background;
#P connect 8 0 17 0;
#P connect 17 0 18 0;
#P connect 1 1 5 0;
#P connect 8 1 17 1;
#P connect 14 0 4 0;
#P connect 15 0 1 0;
#P connect 4 0 1 0;
#P connect 6 0 1 0;
#P connect 3 0 1 0;
#P connect 5 0 3 0;
#P connect 17 2 15 0;
#P connect 18 0 15 0;
#P connect 16 0 7 0;
#P connect 1 0 7 0;
#P connect 15 1 2 0;
#P connect 1 1 2 0;
#P connect 2 0 7 1;
#P connect 13 0 15 1;
#P connect 14 0 13 0;
#P connect 17 1 15 2;
#P pop;

This is the "polygroove" patch the [poly~] object refers to:
max v2;
#N vpatcher 484 310 1084 710;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N in 3;
#P newobj 200 30 25 196617 in 3;
#P user ubumenu 200 51 197 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 0;
#N out~ 3;
#P newobj 349 316 39 196617 out~ 3;
#N out~ 2;
#P newobj 304 313 39 196617 out~ 2;
#N out~ 1;
#P newobj 262 312 39 196617 out~ 1;
#N in~ 2;
#P newobj 248 115 33 196617 in~ 2;
#N in 1;
#P newobj 49 73 25 196617 in 1;
#P toggle 388 139 15 0;
#P message 388 155 68 196617 loopinterp $1;
#P newex 346 96 48 196617 loadbang;
#P newex 44 178 55 196617 route 127;
#P message 23 246 49 196617 startloop;
#P message 85 245 27 196617 stop;
#P toggle 346 139 15 0;
#P message 346 155 41 196617 loop $1;
#P newex 256 155 27 196617 sig~;
#P newex 284 155 61 196617 prepend set;
#P newex 296 201 64 196617 groove~ a 2;
#P connect 7 0 6 0;
#P connect 11 0 7 0;
#P connect 7 1 5 0;
#P connect 17 0 16 0;
#P connect 12 0 2 0;
#P connect 0 0 13 0;
#P connect 16 1 1 0;
#P connect 9 0 0 0;
#P connect 5 0 0 0;
#P connect 6 0 0 0;
#P connect 3 0 0 0;
#P connect 2 0 0 0;
#P connect 1 0 0 0;
#P connect 0 1 14 0;
#P connect 8 0 4 0;
#P connect 4 0 3 0;
#P connect 0 2 15 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P pop;

On Feb 16, 2007, at 8:11 PM, Stefan Tiedje wrote:

> |||||||||| |||||||||| wrote:
>
>> I’d be very grateful for any suggestions… Thanks!
>>
>
> What you want it called polyphony, check out poly~ and the examples/
> tutorials…
>
>
>> Patch pasted below (is it still okay to paste patches into list
>> messages like this?)
>>
>
> Yes, that way I could quickly check and verify that there is only
> one groove~ object. You’d need either one groove~ per buffer~, or a
> poly~…
>
> Stefan
>
> —
> Stefan Tiedje————x——-
> –_____———–|————–
> –(_|_ —-|—–|—–()——-
> — _|_)—-|—–()————–
> ———-()——–www.ccmix.com
>
>


March 4, 2007 | 10:22 pm

Stefan and others,

Thanks very much for the response. It made me realize, by looking
into poly~ among other things, that I could actually make something
that could play as many samples as I could hold down keys.

After working my way through the poly and poly~ tutorials and help
patches, I tried to put together a new version of my patch, using
poly~ to control 64 instances of my "polygroove" patch.
I tried to follow the logic in the tutorials. However, the way poly~
works is still hazy to me, and I can’t get my patch to work right. I
don’t know if the [poly 32] makes any sense, whether or not I need a
[thispoly~] or if where the [target] message is sent to is right.
Could someone maybe have a quick look at my patch and notice where I
messed up?
(Drop a folder on the field in the buffer subpatch to create buffers)

The idea is simple: My Doepfer CTM64 has 64 keys that send note on/
off messages. I’d like each of these buttons to trigger looped
playback of a particular sample, a different sample for each key. The
sample should keep looping until I let go of the key, and it should
be possible to play several samples at once by holding down different
keys simultaneously. 64 sounds at my fingertips…

Thanks for any hints!
Alexandra

max v2;
#N vpatcher 592 193 1340 804;
#P origin 145 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 73 153 53 196617 target $1;
#P newex 58 86 53 196617 poly 32;
#P toggle 127 443 15 0;
#P newex 160 250 103 196617 poly~ polygroove 64;
#P newex 12 190 48 196617 loadbang;
#P message 207 229 14 196617 1;
#P flonum 257 229 36 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 242 229 14 196617 2;
#P message 222 229 19 196617 -1;
#P comment 134 229 77 196617 playback speed;
#P newex 35 25 40 196617 notein;
#P newex 165 463 31 196617 dac~;
#P message 143 300 14 196617 0;
#P newex 83 407 62 196617 prepend set;
#P message 131 284 26 196617 127;
#P number 158 407 35 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 183 284 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 158 284 24 100 158 0 1.071519 7.94321 10.;
#N vpatcher 817 521 945 649;
#P origin 84 87;
#P window setfont "Sans Serif" 9.;
#P hidden message -28 147 32 196617 clear;
#P button 5 130 15 0;
#P hidden newex 5 146 105 196617 js remove-buffers-js;
#P hidden outlet 173 148 15 0;
#P hidden outlet 157 148 15 0;
#P hidden outlet 141 148 15 0;
#P hidden newex 134 95 45 196617 loadbang;
#P hidden message 134 113 28 196617 AIFF;
#N thispatcher;
#Q end;
#P hidden newobj 80 148 60 196617 thispatcher;
#P hidden newex 80 130 64 196617 buffermaker;
#P user dropfile 7 3 131 127 0;
#P user panel 5 1 128 128;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 10 0 11 0;
#P hidden connect 10 0 9 0;
#P hidden connect 1 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 5 0 4 0;
#P hidden connect 4 0 2 1;
#P hidden connect 2 1 6 0;
#P hidden connect 2 2 7 0;
#P hidden connect 11 0 7 0;
#P hidden connect 2 3 8 0;
#P pop;
#P newobj 76 25 51 196617 p buffers;
#P background;
#P connect 8 0 17 0;
#P connect 17 0 18 0;
#P connect 1 1 5 0;
#P connect 8 1 17 1;
#P connect 14 0 4 0;
#P connect 15 0 1 0;
#P connect 4 0 1 0;
#P connect 6 0 1 0;
#P connect 3 0 1 0;
#P connect 5 0 3 0;
#P connect 17 2 15 0;
#P connect 18 0 15 0;
#P connect 16 0 7 0;
#P connect 1 0 7 0;
#P connect 15 1 2 0;
#P connect 1 1 2 0;
#P connect 2 0 7 1;
#P connect 13 0 15 1;
#P connect 14 0 13 0;
#P connect 17 1 15 2;
#P pop;

This is the "polygroove" patch the [poly~] object refers to:
max v2;
#N vpatcher 484 310 1084 710;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N in 3;
#P newobj 200 30 25 196617 in 3;
#P user ubumenu 200 51 197 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 0;
#N out~ 3;
#P newobj 349 316 39 196617 out~ 3;
#N out~ 2;
#P newobj 304 313 39 196617 out~ 2;
#N out~ 1;
#P newobj 262 312 39 196617 out~ 1;
#N in~ 2;
#P newobj 248 115 33 196617 in~ 2;
#N in 1;
#P newobj 49 73 25 196617 in 1;
#P toggle 388 139 15 0;
#P message 388 155 68 196617 loopinterp $1;
#P newex 346 96 48 196617 loadbang;
#P newex 44 178 55 196617 route 127;
#P message 23 246 49 196617 startloop;
#P message 85 245 27 196617 stop;
#P toggle 346 139 15 0;
#P message 346 155 41 196617 loop $1;
#P newex 256 155 27 196617 sig~;
#P newex 284 155 61 196617 prepend set;
#P newex 296 201 64 196617 groove~ a 2;
#P connect 7 0 6 0;
#P connect 11 0 7 0;
#P connect 7 1 5 0;
#P connect 17 0 16 0;
#P connect 12 0 2 0;
#P connect 0 0 13 0;
#P connect 16 1 1 0;
#P connect 9 0 0 0;
#P connect 5 0 0 0;
#P connect 6 0 0 0;
#P connect 3 0 0 0;
#P connect 2 0 0 0;
#P connect 1 0 0 0;
#P connect 0 1 14 0;
#P connect 8 0 4 0;
#P connect 4 0 3 0;
#P connect 0 2 15 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P pop;

On Feb 16, 2007, at 8:11 PM, Stefan Tiedje wrote:

> |||||||||| |||||||||| wrote:
>
>> I’d be very grateful for any suggestions… Thanks!
>>
>
> What you want it called polyphony, check out poly~ and the examples/
> tutorials…
>
>
>> Patch pasted below (is it still okay to paste patches into list
>> messages like this?)
>>
>
> Yes, that way I could quickly check and verify that there is only
> one groove~ object. You’d need either one groove~ per buffer~, or a
> poly~…
>
> Stefan
>
> —
> Stefan Tiedje————x——-
> –_____———–|————–
> –(_|_ —-|—–|—–()——-
> — _|_)—-|—–()————–
> ———-()——–www.ccmix.com
>
>


March 4, 2007 | 11:14 pm

dear max people,

it is entirely possible i’m missing something, or being stupid, but i’m
having a little trouble with filtergraph~. in general, it does what i
want, especially simple params and nfilters messages (etc.).

but:-

(1) is there a way of figuring out which filter number is being operated
on by mouse actions? the right outlet only seems to respond to messages
like params and whichfilt, and seems at other times to output the highest
numbered filter. if i could do this, i could have the appropriate outlets
report what is happening, rather them reporting on the current
(possibly un-mouse-selected) filter.

(2) is whichfilt documented? (it seems that i must have an earlier version
of documentation, or certain filtergraph~ things have gone unsaid.) are
there other undocumented features of filtergraph~?

(3) is there a way of extracting from the object how many filters there
are? this is so i can constrain a number box connected to a whichfilt $1
or query $1 message.

for all this i’ve examined the filtergraph~ inspector, but that has left
me worse for wear. i’m sure someone must have messed with filtergraph~
hoping to achieve similar things. i’m not a newbie, but i suddenly feel
like one. perhaps it was the lunar eclipse last night.

thanks for any help anyone might offer, and i apologize if i’ve missed
something obvious.

peter

mac os 10.4.8, max/msp 4.6.2, dual 1.42ghz ppc g4.


March 5, 2007 | 12:20 pm

beschaving@gmail.com wrote:
> I don’t know if the [poly 32] makes any sense

No, as poly~ has its own voice allocation, look at the midinote or the
note messages to poly~

> whether or not I need a [thispoly~]

Depends on what you are doing, I usually have one in…

> or if where the [target] message is sent to is right.

The target message adresses an instance of poly~ concretely. it will
remain until you change it. If you do voice allocation with the midinote
message, you won’t need it usually, but you might want a [target 0]
message to send info to all of the instances. You have to be careful
about message order, put up triggers to garantie the correct order…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


March 5, 2007 | 6:57 pm

On Mar 5, 2007, at 1:20 PM, Stefan Tiedje wrote:

> beschaving@gmail.com wrote:
>> I don’t know if the [poly 32] makes any sense
>
> No, as poly~ has its own voice allocation, look at the midinote or the
> note messages to poly~

OK, I put in a midinote message instead, but I still can’t get the
patch to play
It seems to respond more or less correctly, but I can’t get the
instances of my "polygroove" subpatch to play any sound

>
>> whether or not I need a [thispoly~]
>
> Depends on what you are doing, I usually have one in…

I put one in the subpatch

>
>> or if where the [target] message is sent to is right.
>
> The target message adresses an instance of poly~ concretely. it
> will remain until you change it. If you do voice allocation with
> the midinote message, you won’t need it usually, but you might want
> a [target 0] message to send info to all of the instances. You have
> to be careful about message order, put up triggers to garantie the
> correct order…
>

I don’t know what I’m doing wrong, I can usually get my patches
working when I read the help etc., but I’m a little stuck here. Maybe
I need more coffee.

Thanks!
Alexandra

max v2;
#N vpatcher 679 211 1427 822;
#P origin 145 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 32 96 30 196617 pack;
#P message 85 175 78 196617 midinote $1 $2;
#P toggle 127 443 15 0;
#P newex 160 250 103 196617 poly~ polygroove 64;
#P newex 12 190 48 196617 loadbang;
#P message 207 222 14 196617 1;
#P flonum 257 222 36 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 242 222 14 196617 2;
#P message 222 222 19 196617 -1;
#P comment 134 222 77 196617 playback speed;
#P newex 35 25 40 196617 notein;
#P newex 165 463 31 196617 dac~;
#P message 143 300 14 196617 0;
#P newex 83 407 62 196617 prepend set;
#P message 131 284 26 196617 127;
#P number 158 407 35 9 0 0 32 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 183 284 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 158 284 24 100 158 0 1.071519 7.94321 10.;
#N vpatcher 1195 459 1357 615;
#P origin 84 87;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden message -28 147 32 196617 clear;
#P button 5 130 15 0;
#P hidden newex 5 146 105 196617 js remove-buffers-js;
#P hidden outlet 173 148 15 0;
#P hidden outlet 157 148 15 0;
#P hidden outlet 141 148 15 0;
#P hidden newex 134 95 45 196617 loadbang;
#P hidden message 134 113 28 196617 AIFF;
#N thispatcher;
#Q end;
#P hidden newobj 80 148 60 196617 thispatcher;
#P hidden newex 80 130 64 196617 buffermaker;
#P user dropfile 7 3 131 127 0;
#P user panel 5 1 128 128;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 10 0 11 0;
#P hidden connect 10 0 9 0;
#P hidden connect 1 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 5 0 4 0;
#P hidden connect 4 0 2 1;
#P hidden connect 2 1 6 0;
#P hidden connect 2 2 7 0;
#P hidden connect 11 0 7 0;
#P hidden connect 2 3 8 0;
#P pop;
#P newobj 76 25 51 196617 p buffers;
#P background;
#P connect 8 0 18 0;
#P connect 8 1 18 1;
#P connect 1 1 5 0;
#P connect 18 0 17 0;
#P connect 14 0 4 0;
#P connect 15 0 1 0;
#P connect 4 0 1 0;
#P connect 6 0 1 0;
#P connect 3 0 1 0;
#P connect 5 0 3 0;
#P connect 0 1 15 0;
#P connect 17 0 15 0;
#P connect 16 0 7 0;
#P connect 1 0 7 0;
#P connect 15 1 2 0;
#P connect 1 1 2 0;
#P connect 2 0 7 1;
#P connect 14 0 13 0;
#P connect 12 0 15 1;
#P connect 11 0 15 1;
#P connect 10 0 15 1;
#P connect 13 0 15 1;
#P pop;

the subpatch:
max v2;
#N vpatcher 74 456 674 856;
#P window setfont "Sans Serif" 9.;
#P number 180 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 143 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 145 93 40 196617 unpack;
#P newex 391 256 52 196617 thispoly~;
#N in 1;
#P newobj 200 30 25 196617 in 1;
#P user ubumenu 200 51 197 196617 0 1 1 0;
#X add;
#X prefix_set 0 0 0;
#N out~ 3;
#P newobj 349 316 39 196617 out~ 3;
#N out~ 2;
#P newobj 304 313 39 196617 out~ 2;
#N out~ 1;
#P newobj 262 312 39 196617 out~ 1;
#N in~ 2;
#P newobj 248 115 33 196617 in~ 2;
#P toggle 388 139 15 0;
#P message 388 155 68 196617 loopinterp $1;
#P newex 346 96 48 196617 loadbang;
#P newex 44 178 55 196617 route 127;
#P message 23 246 49 196617 startloop;
#P message 85 245 27 196617 stop;
#P toggle 346 139 15 0;
#P message 346 155 41 196617 loop $1;
#P newex 256 155 27 196617 sig~;
#P newex 284 155 61 196617 prepend set;
#P newex 296 201 64 196617 groove~ a 2;
#P connect 7 0 6 0;
#P connect 20 0 7 0;
#P connect 7 1 5 0;
#P connect 18 0 19 0;
#P connect 16 0 18 0;
#P connect 18 1 20 0;
#P connect 16 0 15 0;
#P connect 11 0 2 0;
#P connect 0 0 12 0;
#P connect 15 1 1 0;
#P connect 1 0 0 0;
#P connect 2 0 0 0;
#P connect 3 0 0 0;
#P connect 6 0 0 0;
#P connect 5 0 0 0;
#P connect 9 0 0 0;
#P connect 0 1 13 0;
#P connect 8 0 4 0;
#P connect 4 0 3 0;
#P connect 0 2 14 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 0 2 17 0;
#P pop;

> Stefan
>
> —
> Stefan Tiedje————x——-
> –_____———–|————–
> –(_|_ —-|—–|—–()——-
> — _|_)—-|—–()————–
> ———-()——–www.ccmix.com
>


March 5, 2007 | 8:00 pm

I didn’t take the time to figure out your patch, but for a thread
last year, I made this very simple patch illustrating the use of poly~

It’s called "StupidSynth", and it’s currently the only thing here:

http://www.xfade.com/max/examples

-C


Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." – Brian Eno


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