MIDI notes played from list <– how to?

May 14, 2006 at 3:14pm

MIDI notes played from list <– how to?

this is silly but here’s the deal: i create a list containing notes values as int, then zl slice it to get the next note being played… until there’s nothing left in the list.

1st i tried iter to “shoot” notes 1 by 1 to pipe, in the hope that pipe would delay them 1 by 1 as well… but NO, they are all sent to pipe at the same time simultaneously. so that’s why i went the loop path and zl slice 1 the list.

now this’s where the problem is: max stack overflow every time i play a chord on the midi keyboard. must be an error on my maxing??

the patch is attached… plz have a look if u can ~__~

#25970
May 14, 2006 at 3:27pm

forum don’t like attached files. Paste it as text please, so we can
have a look at it.

Best,

Julien.

#77081
May 14, 2006 at 3:43pm

oooh i didn’t know that.. here’s the text file…

thanks a lot for looking into this, err, issue ^o^~

max v2;
#N vpatcher 91 23 1219 933;
#P origin -121 62;
#P toggle 586 480 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 603 452 14 9109513 1;
#P newex 404 410 162 9109513 if $i2 > 0 then set $i1 else out2 set 0;
#B color 5;
#P newex 473 371 83 9109513 prepend comp_str;
#P message 505 335 14 9109513 0;
#P newex 505 310 29 9109513 zl len;
#P message 650 345 23 9109513 127;
#P newex 506 225 81 9109513 receive comp_str;
#P newex 79 632 70 9109513 send comp_str;
#P message 529 267 29 9109513 0 0 0;
#P message 79 604 29 9109513 0 0 0;
#P number 706 257 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 595 312 49 9109513 zl slice 1;
#B color 5;
#P newex 595 225 50 9109513 metro 250;
#P newex 595 345 43 9109513 pipe 250;
#P newex 614 394 40 9109513 noteout;
#P newex 79 543 31 9109513 zl join;
#P newex 100 508 31 9109513 zl rev;
#P newex 23 604 47 9109513 print note;
#P newex 79 473 31 9109513 zl join;
#P newex 100 427 42 9109513 thresh 0;
#B color 5;
#P newex 100 396 27 9109513 + 12;
#P newex 100 360 21 9109513 iter;
#P number 324 353 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P newex 190 305 174 9109513 if $i1 < = 12 then set $i1 else out2 set $i1;
#B color 5;
#P number 156 359 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 242 265 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 179 200 49 9109513 maximum;
#P newex 241 199 46 9109513 minimum;
#P newex 244 228 27 9109513 -;
#P newex 35 62 55 9109513 stripnote;
#P newex 35 32 43 9109513 notein;
#P number 82 91 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 35 118 57 9109513 thresh 1000;
#B color 5;
#P user panel 27 23 139 127;
#X brgb 181 181 181;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 2;
#P comment 168 24 100 9109513 Allow a 1sec window for input;
#P connect 19 0 17 0;
#P connect 4 0 5 0;
#P connect 5 0 2 0;
#P fasten 2 0 16 0 40 459 84 459;
#P connect 16 0 19 0;
#P connect 19 0 25 0;
#P connect 25 0 27 0;
#P connect 4 1 5 1;
#P connect 3 0 2 1;
#P connect 2 0 13 0;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 16 1;
#P connect 16 0 18 0;
#P connect 18 0 19 1;
#P connect 10 0 14 1;
#P fasten 11 0 10 0 195 350 161 350;
#P fasten 2 0 8 0 40 192 184 192;
#P connect 9 0 11 0;
#P fasten 2 0 7 0 40 170 246 170;
#P connect 6 0 9 0;
#P connect 8 0 6 0;
#P connect 7 0 6 1;
#P connect 11 1 12 0;
#P connect 32 0 33 0;
#P connect 31 0 32 0;
#P connect 26 0 30 0;
#P connect 30 0 31 0;
#P connect 28 0 26 0;
#P connect 23 1 26 0;
#P connect 34 0 35 0;
#P connect 33 1 35 0;
#P connect 22 0 23 0;
#P connect 26 0 23 0;
#P connect 23 0 21 0;
#P connect 21 0 20 0;
#P connect 29 0 20 1;
#P connect 24 0 23 1;
#P pop;

#77082
May 14, 2006 at 4:55pm

…still helpless? >__< '''

a few more hours and i’ll be with the firing squads. but seriuosly, i can’t find out why there’s a “stack overflow” with this… the loop should be the culprit but why..?

#77083
May 15, 2006 at 1:44pm

Arion wrote:
> now this’s where the problem is: max stack overflow every time i play
> a chord on the midi keyboard. must be an error on my maxing??

I guess the attached patch is different than mine (it works for me)

Stefan

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 169 109 118 196617 60 61 62 63 64 65;
#P number 169 260 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 196 50 196617 delay 500;
#P newex 169 174 32 196617 t i b;
#P newex 191 217 59 196617 zl reg;
#P newex 169 151 81 196617 zl slice 1;
#P connect 5 0 0 0;
#P connect 2 0 4 0;
#P fasten 1 0 0 0 196 240 261 240 261 142 174 142;
#P connect 3 0 1 0;
#P connect 2 1 3 0;
#P connect 0 0 2 0;
#P connect 0 1 1 1;
#P window clipboard copycount 6;


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

#77084
May 15, 2006 at 9:29pm

Arion wrote:
> oooh i didn’t know that.. here’s the text file…
>
> thanks a lot for looking into this, err, issue ^o^~

the message object is not like a number, it does not pass what you send
in. The feedback causing the stackoverflow is the zl slice, the right
outlet will send a list to the messagebox which sends the same list as
before, this will never stop till the stack overflows…

There is a trace option which helps to track down probs like that, and
don’t forget to do all the tutorials, there is some obvious lack of
basic understanding documented in your patch…

Stefan


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

#77085
May 16, 2006 at 11:29am

thanks Stefan~ ^^ i realized that as well… it’s all fixed now. but in order to have more control over lists there isn’t any choice but to use the various exteral objects is there? cuz zl offers only the basics.

#77086
May 16, 2006 at 6:40pm

Arion wrote:
> thanks Stefan~ ^^ i realized that as well… it’s all fixed now. but
> in order to have more control over lists there isn’t any choice but
> to use the various exteral objects is there? cuz zl offers only the
> basics.

zl usually delivers all I need, what are you missing? Beside that, there
are list specialised externals – Lobjects for example. Don’t forget as
long you are just dealing with Midi, Max was able to do anyhthing you
want long before zl came up. I think its always a good exercise to try
to come along with the standard distribution as long you deal with
simple problems…

There are some collections though, which open new worlds (FTM for
example), but in your state of learning I’d recommend to stick with what
you got, it will keep you busy for a while and you’ll learn a lot…

Stefan


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

#77087

You must be logged in to reply to this topic.