Hi,
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count.
The sequence would be this for example:
1 - 2- 3 - 4 - 5 - 6 - 7 (bang) - 4 - 5 (bang) - 2 - 3 - ...
I've tried several ways, but i dont get it..
br. GARFF
La vida de los famosos al desnudo en MSN Entretenimiento http://entretenimiento.es.msn.com/
Hi ! Using a demultiplex after the float works well. See the attached example.
a
2008/1/2, Javier Garcia tirengarfio@hotmail.com:
Hi,
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count.
The sequence would be this for example:
1 - 2- 3 - 4 - 5 - 6 - 7 (bang) - 4 - 5 (bang) - 2 - 3 - ...
I've tried several ways, but i dont get it..
br. GARFF
Sigue los principales acontecimientos deportivos en directo. MSN Motor _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, Javier Garcia hat gesagt: // Javier Garcia wrote:
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count.
The sequence would be this for example:
1 - 2- 3 - 4 - 5 - 6 - 7 (bang) - 4 - 5 (bang) - 2 - 3 - ...
I've tried several ways, but i dont get it..
I assume you use the standard fx+1 counter idiom to build a counter in Pd. But now you want to temporarily add not 1, but a different value, say: -2 to the current counter value. For that, just set the value of the "+ 1" object to "-2" for one iteration of the counter, then reset it it to 1 again immediatly after the counter has fired. You can use a trigger object to schedule the logic flow here.
Frank Barknecht _ ______footils.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I assume you use the standard fx+1 counter idiom to build a counter in Pd. But now you want to temporarily add not 1, but a different value, say: -2 to the current counter value. For that, just set the value of the "+ 1" object to "-2" for one iteration of the counter, then reset it it to 1 again immediatly after the counter has fired. You can use a trigger object to schedule the logic flow here.
Attached is a solution, but you may want to try my approach on your own first.
Frank Barknecht _ ______footils.org__
On Thu, 2008-01-03 at 03:04 +0700, tetragor@rambler.ru wrote:
Garcia:
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count. I've tried several ways, but i dont get it..
the easiest way is to write this counter on c/c++. (and this would costs much less cpu for patch)
you have a funny understanding of 'the easiest'. on the other hand, this is only what _i_ think and i think that only because i don't know how to write in in c/c++. but since people, who know to write pd patches don't necessarily know how to write in c/c++, i would rather say, the easiest and most reasonable solution would be to write an abstraction, as frank suggested.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
Hallo, tetragor@rambler.ru hat gesagt: // tetragor@rambler.ru wrote:
Garcia:
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count. I've tried several ways, but i dont get it..
the easiest way is to write this counter on c/c++. (and this would costs much less cpu for patch)
There already are many counter externals, however I think, the small savings of a counter external vs. a [f]x[+ 1] construct don't really outweight requiring users to build and install an external.
Frank Barknecht _ ______footils.org__
Hi Javier
You could trigger the counter with the count. see attached
mvh Steffen Leve Poulsen
Javier Garcia skrev:
Hi,
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count.
The sequence would be this for example:
1 - 2- 3 - 4 - 5 - 6 - 7 (bang) - 4 - 5 (bang) - 2 - 3 - ...
I've tried several ways, but i dont get it..
br. GARFF
#N canvas 326 98 494 409 10; #X obj 96 168 list split 1; #X obj 50 206 list prepend; #X obj 96 276 +; #X msg 249 87 1 1 1 1 1 1 1 -4 1 1 -4; #X obj 115 247 mod 128; #X obj 151 19 loadbang; #X obj 96 75 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 ; #X obj 96 133 list; #X obj 99 305 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 0 1; #X obj 96 101 metro 40; #X msg 249 116 1 1 1 -2; #X msg 248 144 -1 1 1 1 1 -1 -1; #X obj 151 42 t b b; #X connect 0 0 1 0; #X connect 0 0 2 0; #X connect 0 1 1 1; #X connect 1 0 7 1; #X connect 2 0 4 0; #X connect 2 0 8 0; #X connect 3 0 7 1; #X connect 4 0 2 1; #X connect 5 0 12 0; #X connect 6 0 9 0; #X connect 7 0 0 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 7 1; #X connect 12 0 6 0; #X connect 12 1 3 0;
Hi!
I think a counter approach with a changing jump could be the easiest way as Frank suggested, and no c/c++ programation would be necessary (Pd is easier!). Look at attached patch Javier! My two cents! ;-)
Saludos.
2008/1/3, Steffen Leve Poulsen slagmark@worldonline.dk:
Hi Javier
You could trigger the counter with the count. see attached
mvh Steffen Leve Poulsen
Javier Garcia skrev:
Hi,
im trying to create a patch with a counter that when i send a bang I substract a quantity (that i specify) to the count.
The sequence would be this for example:
1 - 2- 3 - 4 - 5 - 6 - 7 (bang) - 4 - 5 (bang) - 2 - 3 - ...
I've tried several ways, but i dont get it..
br. GARFF
#N canvas 326 98 494 409 10; #X obj 96 168 list split 1; #X obj 50 206 list prepend; #X obj 96 276 +; #X msg 249 87 1 1 1 1 1 1 1 -4 1 1 -4; #X obj 115 247 mod 128; #X obj 151 19 loadbang; #X obj 96 75 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 ; #X obj 96 133 list; #X obj 99 305 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 0 1; #X obj 96 101 metro 40; #X msg 249 116 1 1 1 -2; #X msg 248 144 -1 1 1 1 1 -1 -1; #X obj 151 42 t b b; #X connect 0 0 1 0; #X connect 0 0 2 0; #X connect 0 1 1 1; #X connect 1 0 7 1; #X connect 2 0 4 0; #X connect 2 0 8 0; #X connect 3 0 7 1; #X connect 4 0 2 1; #X connect 5 0 12 0; #X connect 6 0 9 0; #X connect 7 0 0 0; #X connect 9 0 7 0; #X connect 10 0 7 1; #X connect 11 0 7 1; #X connect 12 0 6 0; #X connect 12 1 3 0;
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list