i got the h_stack working for incoming midi notes in order to achieve monophonic portamento (see the attached patch).
however this method has a bug:
you press C3 (osc plays C3) [stack->push(C3), out: C3] you press F3 (osc slides to F3) [stack->push(F3), out: F3] you release C3 (osc slides to C3) [stack->pop(), out: C3] (wrong! F3 now it is the only note pressed, but osc plays C3)
remembering how VAZ works, i'm thinking that it is better to get highest (and lowest) note pressed, rather than using a stack. however i can't find a container that would do the job.
can you help me?
sorry! i forgot to attach the patch...
#N canvas 402 218 608 642 10; #X obj 42 241 osc~; #X obj 42 214 line~; #X obj 42 160 mtof; #X obj 106 279 *~; #X obj 53 411 dac~; #X obj 42 187 pack 0 0; #X obj 253 162 hsl 128 15 0 127 0 0 empty empty portamento -2 -6 0 8 -262144 -1 -1 12000 1; #N canvas 0 0 450 300 stack 0; #X obj 118 154 h_stack; #X obj 110 50 > 0; #X obj 65 50 spigot; #X msg 115 114 push $1; #X obj 155 52 spigot; #X obj 200 52 == 0; #X msg 82 114 top; #X msg 23 112 getsize; #X msg 177 114 top; #X msg 210 114 pop; #X obj 150 180 > 0; #X obj 155 76 t b b b; #X obj 65 76 t b b f; #X obj 65 21 inlet; #X obj 156 21 inlet; #X obj 95 207 outlet; #X obj 148 206 outlet; #X connect 0 0 15 0; #X connect 0 1 10 0; #X connect 1 0 2 1; #X connect 2 0 12 0; #X connect 3 0 0 0; #X connect 4 0 11 0; #X connect 5 0 4 1; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X connect 9 0 0 0; #X connect 10 0 16 0; #X connect 11 0 7 0; #X connect 11 1 8 0; #X connect 11 2 9 0; #X connect 12 0 7 0; #X connect 12 1 6 0; #X connect 12 2 3 0; #X connect 13 0 2 0; #X connect 13 0 4 0; #X connect 14 0 1 0; #X connect 14 0 5 0; #X restore 42 99 pd stack; #X obj 42 69 notein 1; #N canvas 0 0 450 300 adsr 0; #X obj 21 56 inlet; #X obj 223 71 inlet; #X text 17 31 trigger; #X obj 21 84 sel 0; #X obj 160 100 t b; #X obj 82 209 f $1; #X obj 82 234 pack 0 $2; #X obj 280 71 inlet; #X obj 226 201 del $2; #X obj 246 349 line~; #X obj 250 224 f $4; #X obj 289 299 pack 0 $3; #X obj 342 71 inlet; #X obj 404 71 inlet; #X obj 474 71 inlet; #X msg 21 115 stop; #X obj 400 226 pack 0 $5; #X text 223 49 level; #X obj 289 275 * $1; #X obj 246 374 outlet~; #X obj 250 249 * 0.01; #X text 276 49 attack; #X text 343 48 decay; #X text 397 49 sustain; #X text 471 50 release; #X text 118 16 attack; #X obj 120 37 moses; #X obj 110 67 t b b; #X msg 44 235 0; #X text 227 33 peak; #X connect 0 0 3 0; #X connect 1 0 5 1; #X connect 1 0 18 1; #X connect 3 0 15 0; #X connect 3 0 16 0; #X connect 3 1 26 0; #X connect 4 0 5 0; #X connect 4 0 8 0; #X connect 5 0 6 0; #X connect 6 0 9 0; #X connect 7 0 6 1; #X connect 7 0 8 1; #X connect 8 0 10 0; #X connect 9 0 19 0; #X connect 10 0 20 0; #X connect 11 0 9 0; #X connect 12 0 11 1; #X connect 13 0 10 1; #X connect 14 0 16 1; #X connect 15 0 8 0; #X connect 16 0 9 0; #X connect 18 0 11 0; #X connect 20 0 18 0; #X connect 26 0 27 0; #X connect 26 1 4 0; #X connect 27 0 4 0; #X connect 27 1 28 0; #X connect 28 0 9 0; #X restore 121 140 pd adsr; #N canvas 293 442 450 300 waveshaper 0; #X obj 24 55 inlet~; #X obj 25 154 outlet~; #N canvas 0 0 450 300 graph1 0; #X array ws 1024 float 3; #A 0 -1 -0.999023 -0.998045 -0.997066 -0.996086 -0.995105 -0.994123 -0.993141 -0.992157 -0.991172 -0.990186 -0.9892 -0.988212 -0.987223 -0.986233 -0.985243 -0.984251 -0.983258 -0.982265 -0.98127 -0.980274 -0.979277 -0.97828 -0.977281 -0.976281 -0.97528 -0.974279 -0.973276 -0.972272 -0.971267 -0.970261 -0.969254 -0.968246 -0.967237 -0.966227 -0.965215 -0.964203 -0.96319 -0.962175 -0.96116 -0.960143 -0.959126 -0.958107 -0.957087 -0.956066 -0.955044 -0.954021 -0.952997 -0.951972 -0.950945 -0.949918 -0.948889 -0.947859 -0.946829 -0.945797 -0.944764 -0.943729 -0.942694 -0.941657 -0.94062 -0.939581 -0.938541 -0.9375 -0.936458 -0.935414 -0.93437 -0.933324 -0.932277 -0.931229 -0.93018 -0.929129 -0.928078 -0.927025 -0.925971 -0.924916 -0.923859 -0.922801 -0.921743 -0.920683 -0.919621 -0.918559 -0.917495 -0.91643 -0.915364 -0.914296 -0.913227 -0.912157 -0.911086 -0.910014 -0.90894 -0.907865 -0.906789 -0.905711 -0.904632 -0.903552 -0.902471 -0.901388 -0.900304 -0.899218 -0.898132 -0.897044 -0.895954 -0.894864 -0.893772 -0.892679 -0.891584 -0.890488 -0.889391 -0.888292 -0.887192 -0.88609 -0.884988 -0.883883 -0.882778 -0.881671 -0.880563 -0.879453 -0.878342 -0.877229 -0.876115 -0.875 -0.873883 -0.872765 -0.871645 -0.870524 -0.869402 -0.868278 -0.867152 -0.866025 -0.864897 -0.863767 -0.862636 -0.861503 -0.860369 -0.859233 -0.858096 -0.856957 -0.855817 -0.854675 -0.853531 -0.852386 -0.85124 -0.850092 -0.848942 -0.847791 -0.846639 -0.845484 -0.844328 -0.843171 -0.842012 -0.840852 -0.839689 -0.838526 -0.83736 -0.836193 -0.835024 -0.833854 -0.832682 -0.831508 -0.830333 -0.829156 -0.827978 -0.826797 -0.825615 -0.824432 -0.823246 -0.822059 -0.82087 -0.81968 -0.818488 -0.817294 -0.816098 -0.8149 -0.813701 -0.8125 -0.811297 -0.810093 -0.808886 -0.807678 -0.806468 -0.805256 -0.804043 -0.802827 -0.80161 -0.800391 -0.799169 -0.797947 -0.796722 -0.795495 -0.794267 -0.793036 -0.791804 -0.790569 -0.789333 -0.788095 -0.786855 -0.785613 -0.784369 -0.783123 -0.781875 -0.780625 -0.779373 -0.778119 -0.776863 -0.775605 -0.774345 -0.773082 -0.771818 -0.770552 -0.769283 -0.768013 -0.76674 -0.765466 -0.764189 -0.76291 -0.761629 -0.760345 -0.75906 -0.757772 -0.756482 -0.75519 -0.753896 -0.7526 -0.751301 -0.75 -0.748697 -0.747391 -0.746084 -0.744773 -0.743461 -0.742146 -0.740829 -0.73951 -0.738188 -0.736864 -0.735538 -0.734209 -0.732877 -0.731544 -0.730208 -0.728869 -0.727528 -0.726184 -0.724838 -0.72349 -0.722139 -0.720785 -0.719429 -0.71807 -0.716709 -0.715345 -0.713979 -0.71261 -0.711238 -0.709864 -0.708486 -0.707107 -0.705724 -0.704339 -0.702951 -0.701561 -0.700167 -0.698771 -0.697372 -0.695971 -0.694566 -0.693159 -0.691748 -0.690335 -0.688919 -0.6875 -0.686078 -0.684653 -0.683225 -0.681795 -0.680361 -0.678924 -0.677484 -0.676041 -0.674595 -0.673146 -0.671693 -0.670238 -0.668779 -0.667317 -0.665852 -0.664384 -0.662913 -0.661438 -0.65996 -0.658478 -0.656994 -0.655506 -0.654014 -0.652519 -0.651021 -0.649519 -0.648014 -0.646505 -0.644993 -0.643477 -0.641958 -0.640434 -0.638908 -0.637377 -0.635843 -0.634306 -0.632764 -0.631219 -0.62967 -0.628117 -0.626561 -0.625 -0.623436 -0.621867 -0.620295 -0.618718 -0.617138 -0.615554 -0.613965 -0.612372 -0.610776 -0.609175 -0.607569 -0.60596 -0.604346 -0.602728 -0.601106 -0.599479 -0.597848 -0.596212 -0.594572 -0.592927 -0.591278 -0.589624 -0.587965 -0.586302 -0.584634 -0.582961 -0.581284 -0.579601 -0.577914 -0.576222 -0.574524 -0.572822 -0.571115 -0.569402 -0.567684 -0.565962 -0.564233 -0.5625 -0.560761 -0.559017 -0.557267 -0.555512 -0.553751 -0.551985 -0.550213 -0.548435 -0.546652 -0.544862 -0.543067 -0.541266 -0.539459 -0.537645 -0.535826 -0.534 -0.532168 -0.53033 -0.528485 -0.526634 -0.524777 -0.522913 -0.521042 -0.519164 -0.51728 -0.515388 -0.51349 -0.511585 -0.509672 -0.507752 -0.505825 -0.503891 -0.501949 -0.5 -0.498043 -0.496078 -0.494106 -0.492125 -0.490137 -0.488141 -0.486136 -0.484123 -0.482102 -0.480072 -0.478033 -0.475986 -0.47393 -0.471865 -0.469791 -0.467707 -0.465614 -0.463512 -0.461401 -0.459279 -0.457148 -0.455007 -0.452856 -0.450694 -0.448522 -0.446339 -0.444146 -0.441942 -0.439727 -0.4375 -0.435262 -0.433013 -0.430752 -0.428478 -0.426193 -0.423896 -0.421586 -0.419263 -0.416927 -0.414578 -0.412216 -0.40984 -0.40745 -0.405046 -0.402628 -0.400195 -0.397748 -0.395285 -0.392806 -0.390312 -0.387802 -0.385276 -0.382733 -0.380173 -0.377595 -0.375 -0.372387 -0.369755 -0.367104 -0.364435 -0.361745 -0.359035 -0.356305 -0.353553 -0.35078 -0.347985 -0.345168 -0.342327 -0.339462 -0.336573 -0.333659 -0.330719 -0.327753 -0.32476 -0.321738 -0.318689 -0.31561 -0.3125 -0.309359 -0.306186 -0.30298 -0.299739 -0.296464 -0.293151 -0.289801 -0.286411 -0.282981 -0.279509 -0.275993 -0.272431 -0.268823 -0.265165 -0.261456 -0.257694 -0.253876 -0.25 -0.246063 -0.242061 -0.237993 -0.233854 -0.22964 -0.225347 -0.220971 -0.216506 -0.211948 -0.207289 -0.202523 -0.197642 -0.192638 -0.1875 -0.182217 -0.176777 -0.171163 -0.165359 -0.159344 -0.153093 -0.146575 -0.139754 -0.132583 -0.125 -0.116927 -0.108253 -0.0988212 -0.0883883 -0.0765466 -0.0625 -0.0441942 0 0.0441942 0.0625 0.0765466 0.0883883 0.0988212 0.108253 0.116927 0.125 0.132583 0.139754 0.146575 0.153093 0.159344 0.165359 0.171163 0.176777 0.182217 0.1875 0.192638 0.197642 0.202523 0.207289 0.211948 0.216506 0.220971 0.225347 0.22964 0.233854 0.237993 0.242061 0.246063 0.25 0.253876 0.257694 0.261456 0.265165 0.268823 0.272431 0.275993 0.279509 0.282981 0.286411 0.289801 0.293151 0.296464 0.299739 0.30298 0.306186 0.309359 0.3125 0.31561 0.318689 0.321738 0.32476 0.327753 0.330719 0.333659 0.336573 0.339462 0.342327 0.345168 0.347985 0.35078 0.353553 0.356305 0.359035 0.361745 0.364435 0.367104 0.369755 0.372387 0.375 0.377595 0.380173 0.382733 0.385276 0.387802 0.390312 0.392806 0.395285 0.397748 0.400195 0.402628 0.405046 0.40745 0.40984 0.412216 0.414578 0.416927 0.419263 0.421586 0.423896 0.426193 0.428478 0.430752 0.433013 0.435262 0.4375 0.439727 0.441942 0.444146 0.446339 0.448522 0.450694 0.452856 0.455007 0.457148 0.459279 0.461401 0.463512 0.465614 0.467707 0.469791 0.471865 0.47393 0.475986 0.478033 0.480072 0.482102 0.484123 0.486136 0.488141 0.490137 0.492125 0.494106 0.496078 0.498043 0.5 0.501949 0.503891 0.505825 0.507752 0.509672 0.511585 0.51349 0.515388 0.51728 0.519164 0.521042 0.522913 0.524777 0.526634 0.528485 0.53033 0.532168 0.534 0.535826 0.537645 0.539459 0.541266 0.543067 0.544862 0.546652 0.548435 0.550213 0.551985 0.553751 0.555512 0.557267 0.559017 0.560761 0.5625 0.564233 0.565962 0.567684 0.569402 0.571115 0.572822 0.574524 0.576222 0.577914 0.579601 0.581284 0.582961 0.584634 0.586302 0.587965 0.589624 0.591278 0.592927 0.594572 0.596212 0.597848 0.599479 0.601106 0.602728 0.604346 0.60596 0.607569 0.609175 0.610776 0.612372 0.613965 0.615554 0.617138 0.618718 0.620295 0.621867 0.623436 0.625 0.626561 0.628117 0.62967 0.631219 0.632764 0.634306 0.635843 0.637377 0.638908 0.640434 0.641958 0.643477 0.644993 0.646505 0.648014 0.649519 0.651021 0.652519 0.654014 0.655506 0.656994 0.658478 0.65996 0.661438 0.662913 0.664384 0.665852 0.667317 0.668779 0.670238 0.671693 0.673146 0.674595 0.676041 0.677484 0.678924 0.680361 0.681795 0.683225 0.684653 0.686078 0.6875 0.688919 0.690335 0.691748 0.693159 0.694566 0.695971 0.697372 0.698771 0.700167 0.701561 0.702951 0.704339 0.705724 0.707107 0.708486 0.709864 0.711238 0.71261 0.713979 0.715345 0.716709 0.71807 0.719429 0.720785 0.722139 0.72349 0.724838 0.726184 0.727528 0.728869 0.730208 0.731544 0.732877 0.734209 0.735538 0.736864 0.738188 0.73951 0.740829 0.742146 0.743461 0.744773 0.746084 0.747391 0.748697 0.75 0.751301 0.7526 0.753896 0.75519 0.756482 0.757772 0.75906 0.760345 0.761629 0.76291 0.764189 0.765466 0.76674 0.768013 0.769283 0.770552 0.771818 0.773082 0.774345 0.775605 0.776863 0.778119 0.779373 0.780625 0.781875 0.783123 0.784369 0.785613 0.786855 0.788095 0.789333 0.790569 0.791804 0.793036 0.794267 0.795495 0.796722 0.797947 0.799169 0.800391 0.80161 0.802827 0.804043 0.805256 0.806468 0.807678 0.808886 0.810093 0.811297 0.8125 0.813701 0.8149 0.816098 0.817294 0.818488 0.81968 0.82087 0.822059 0.823246 0.824432 0.825615 0.826797 0.827978 0.829156 0.830333 0.831508 0.832682 0.833854 0.835024 0.836193 0.83736 0.838526 0.839689 0.840852 0.842012 0.843171 0.844328 0.845484 0.846639 0.847791 0.848942 0.850092 0.85124 0.852386 0.853531 0.854675 0.855817 0.856957 0.858096 0.859233 0.860369 0.861503 0.862636 0.863767 0.864897 0.866025 0.867152 0.868278 0.869402 0.870524 0.871645 0.872765 0.873883 0.875 0.876115 0.877229 0.878342 0.879453 0.880563 0.881671 0.882778 0.883883 0.884988 0.88609 0.887192 0.888292 0.889391 0.890488 0.891584 0.892679 0.893772 0.894864 0.895954 0.897044 0.898132 0.899218 0.900304 0.901388 0.902471 0.903552 0.904632 0.905711 0.906789 0.907865 0.90894 0.910014 0.911086 0.912157 0.913227 0.914296 0.915364 0.91643 0.917495 0.918559 0.919621 0.920683 0.921743 0.922801 0.923859 0.924916 0.925971 0.927025 0.928078 0.929129 0.93018 0.931229 0.932277 0.933324 0.93437 0.935414 0.936458 0.9375 0.938541 0.939581 0.94062 0.941657 0.942694 0.943729 0.944764 0.945797 0.946829 0.947859 0.948889 0.949918 0.950945 0.951972 0.952997 0.954021 0.955044 0.956066 0.957087 0.958107 0.959126 0.960143 0.96116 0.962175 0.96319 0.964203 0.965215 0.966227 0.967237 0.968246 0.969254 0.970261 0.971267 0.972272 0.973276 0.974279 0.97528; #A 1000 0.976281 0.977281 0.97828 0.979277 0.980274 0.98127 0.982265 0.983258 0.984251 0.985243 0.986233 0.987223 0.988212 0.9892 0.990186 0.991172 0.992157 0.993141 0.994123 0.995105 0.996086 0.997066 0.998045 0.999023; #X coords 0 1 1023 -1 200 140 1; #X restore 153 48 graph; #X obj 24 126 tabread4~ ws; #X obj 24 80 *~ 512; #X obj 24 103 +~ 512; #X connect 0 0 4 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 5 0 3 0; #X restore 105 317 pd waveshaper; #X obj 127 26 loadbang; #X obj 129 102 unpack 0 0 0 0 0 0; #X text 237 215 require: PDContainer; #X obj 84 372 *~; #X obj 204 337 == 0; #X obj 204 318 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 127 54 1 10 200 50 50 120; #X obj 46 372 *~ 1; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 5 0; #X connect 3 0 10 0; #X connect 3 0 18 0; #X connect 5 0 1 0; #X connect 6 0 5 1; #X connect 7 0 2 0; #X connect 7 1 9 0; #X connect 8 0 7 0; #X connect 8 1 7 1; #X connect 9 0 3 1; #X connect 10 0 14 0; #X connect 11 0 17 0; #X connect 12 0 9 1; #X connect 12 1 9 2; #X connect 12 2 9 3; #X connect 12 3 9 4; #X connect 12 4 9 5; #X connect 12 5 6 0; #X connect 14 0 4 0; #X connect 14 0 4 1; #X connect 15 0 18 1; #X connect 16 0 15 0; #X connect 16 0 14 1; #X connect 17 0 12 0; #X connect 18 0 4 0; #X connect 18 0 4 1;
is C10.monophonic.synth any use for this?
I remember writing exactly what you describe, using manually sorted lists to store the last 6 notes pressed. Then it was pointed out that Miller had solved this in one of the example patches, which caused me some embarrassment.
If it doesn't do what you want, I have the original patch I can send you that does this. regards,
Matt
-=-=-=-=-=-=-=-=-=-=-=- http://www.loopit.org -=-=-=-=-=-=-=-=-=-=-=- ----- Original Message ----- From: "federico" xaero@inwind.it To: "pd-list" pd-list@iem.at Sent: Saturday, March 26, 2005 6:36 PM Subject: Re: [PD] monophonic behavior...(again) how to get the lowest note?
sorry! i forgot to attach the patch...
matthew jones ha scritto:
is C10.monophonic.synth any use for this?
I remember writing exactly what you describe, using manually sorted lists to store the last 6 notes pressed. Then it was pointed out that Miller had solved this in one of the example patches, which caused me some embarrassment.
nope. C10.monophonic.synth simply strips note-on messages, so the last note you press is the actual pitch of the osc (nothing happens when you release a note).
what i wanted is instead keep in memory all notes that are pressed, and dinamically get the lowest/highest note (e.g.: if you release the actual lowest note, the new lowest note would became another note).
i coded two simple externals that do the job (and tell you the gate status also, eg. if there are notes pressed or not). you can find on my (under construction) website http://xaero.ath.cx/cms/software
bye!
federico wrote: ...
remembering how VAZ works, i'm thinking that it is better to get highest (and lowest) note pressed, rather than using a stack. however i can't find a container that would do the job.
btw, this is easily doable with the (current) Max version of 'bag'. Pd's bag does not handle the 'bang' query... so I wonder, should cyclone have its 'Bag' too?
Krzysztof