hi. Everytime i send the message " set sound" to the syncgrain object it reads the table (sound ) from the begining. Is it possible that the syncgrain object begins processing a sound from a random position of the table? any hint?
thanx
pun chik punchik@fastmail.fm
Hi,
I want to make a clock [stopwatch] which counts down from [for example] 30 minutes till zero, but I have a very hard time making it. For so far I made a counter with a metro of 1000 which counts the seconds and connected a select 60 to count the minutes. [counter 1] I can combine the message via pack, which prints out [for example] time: 30 min 15 sec in the terminal. [counter 2]
But it gets weird when it comes close to 60:
time: 9 min 59 sec time: 10 min 1 sec time: 10 min 1 sec time: 10 min 60 sec time: 10 min 2 sec time: 10 min 3 sec
Cannot figure out why it is doing this. The countdown is another issue. I thought multiplying by -1 and adding 30 [for the minutes] and 60 [for the seconds] would do, but not really.
I attached the patch. It's probably very simple, but I cannot get a hold of it.
Sara
#N canvas 194 290 839 464 10; #X obj 105 297 + 1; #X msg 178 12 bang; #X obj 107 111 float; #X msg 222 12 stop; #X obj 16 160 select 60; #X msg 204 95 0; #X obj 109 11 t b b; #X obj 443 268 t; #X obj 382 314 pack f s f s; #X msg 316 275 30 min 0 sec; #X obj 443 268 t; #X obj 108 69 metro 100; #X floatatom 16 330 5 0 0 0 - - -; #X floatatom 105 330 5 0 0 0 - - -; #X obj 16 298 + 1; #X obj 17 191 float; #X obj 441 234 + 1; #X msg 512 14 bang; #X obj 441 113 float; #X msg 556 14 stop; #X obj 350 162 select 60; #X msg 538 97 0; #X obj 443 13 t b b; #X obj 351 235 + 1; #X obj 351 193 float; #X obj 441 72 metro 1000; #X obj 389 350 print time; #X text 279 11 COUNTER 1; #X text 575 97 Only resets seconds to zero when I press stop. When I connect it to the second float to reset the minutes to zero , the counter does not work properly anymore.; #X text 610 11 COUNTER 2 prints in terminal for example: time: 30 min 0 sec; #X connect 0 0 2 1; #X connect 0 0 4 0; #X connect 0 0 13 0; #X connect 1 0 11 0; #X connect 2 0 0 0; #X connect 3 0 5 0; #X connect 3 0 11 0; #X connect 4 0 6 0; #X connect 4 0 15 0; #X connect 5 0 2 1; #X connect 6 0 11 0; #X connect 6 1 5 0; #X connect 8 0 26 0; #X connect 9 0 8 0; #X connect 10 0 8 0; #X connect 11 0 2 0; #X connect 14 0 12 0; #X connect 14 0 15 1; #X connect 15 0 14 0; #X connect 16 0 18 1; #X connect 16 0 20 0; #X connect 16 0 10 0; #X connect 16 0 8 2; #X connect 17 0 25 0; #X connect 18 0 16 0; #X connect 19 0 21 0; #X connect 19 0 25 0; #X connect 20 0 22 0; #X connect 20 0 24 0; #X connect 21 0 18 1; #X connect 22 0 25 0; #X connect 22 1 21 0; #X connect 23 0 24 1; #X connect 23 0 8 0; #X connect 24 0 23 0; #X connect 25 0 18 0;
Hallo, sara kolster hat gesagt: // sara kolster wrote:
I want to make a clock [stopwatch] which counts down from [for example] 30 minutes till zero, but I have a very hard time making it. For so far I made a counter with a metro of 1000 which counts the seconds and connected a select 60 to count the minutes.
Actually it's better to not use [select] here, but [mod 60]. Combined with [div] you get a very simple clock for minutes and seconds:
[r seconds] | [t f f] | | [div 60] [mod 60] | | "minutes" "seconds"
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41
Hallo, sara kolster hat gesagt: // sara kolster wrote:
I want to make a clock [stopwatch] which counts down from [for example] 30 minutes till zero, but I have a very hard time making it. For so far I made a counter with a metro of 1000 which counts the seconds and connected a select 60 to count the minutes. [counter 1] I can combine the message via pack, which prints out [for example] time: 30 min 15 sec in the terminal. [counter 2]
But it gets weird when it comes close to 60:
time: 9 min 59 sec time: 10 min 1 sec time: 10 min 1 sec time: 10 min 60 sec time: 10 min 2 sec time: 10 min 3 sec
Cannot figure out why it is doing this.
I now could look at your patch, too. The reason for this strange behaviour is, that the outlet of the [+ 1] in the counter can never be 0 and also the order of execution is undefined in some states of execution. Some more triggers should help.
But you are also using an unusual way to count. This is hard to explain in ascii-patching, so maybe you want to take a look at attached explanation in Pd-format.
Basically when you do the [f 0] X [+ 1] counters it's better to use the outlet of the float object for the counter value. If you don't want to start counting at 0, you can always add or substract some values after the counter.
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
But you are also using an unusual way to count. This is hard to explain in ascii-patching, so maybe you want to take a look at attached explanation in Pd-format.
Uhm, some errors in that patch: Replace all occurences of the word "left" with "right". :(
Attached is the fixed version for archive searchs..
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41
Hey Frank, Matthew and Phillip,
Thanks so much for the input. I succeeded in making a countdown combining the expr. and the mod / div objects. This expr is quite fun to experiment with ;)
Does anyone know which logical math element I can use for the following problem? I was wondering if there is such a element instead of using select or expr.
The object should only give a 0/1 when two separate floats [connected to right & left inlet] inlet are 0?
I tried [&&] and [== 0] but these don't act as I want to. Now I use [expr if($f1 + $f2 == 0, 0, 1] but I was wondering if one there is another way to do it.
s
Frank Barknecht wrote:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
But you are also using an unusual way to count. This is hard to explain in ascii-patching, so maybe you want to take a look at attached explanation in Pd-format.
Uhm, some errors in that patch: Replace all occurences of the word "left" with "right". :(
Attached is the fixed version for archive searchs..
Ciao
#N canvas 248 25 581 856 10; #X obj 59 21 cnv 15 300 30 empty empty Counters_in_Pd 20 12 0 14 -233017 -66577 0; #X obj 174 132 + 1; #X obj 172 276 + 1; #X obj 130 276 f 0; #X obj 272 132 + 1; #X obj 236 132 f 0; #X obj 114 132 float 0; #X text 207 133 ==; #X text 311 135 ~=; #X obj 380 132 + 1; #X obj 344 132 f; #X text 66 168 Every bang sent to the float will first output the current value of the float to its outlet and to the [+ 1] , which then adds 1 to the internally stored value of the float *without* outputting it immediatly.; #X text 64 226 The new value will be emitted on the next bang.; #X floatatom 130 307 5 0 0 0 current_output - -; #X msg 130 254 bang; #X floatatom 172 308 5 0 0 1 next_output - -; #X obj 192 497 + 1; #X obj 150 497 f 0; #X floatatom 150 528 5 0 0 0 current_output - -; #X msg 150 432 bang; #X floatatom 192 528 5 0 0 1 next_output - -; #X msg 166 460 0; #X obj 70 340 cnv 15 300 20 empty empty Resetting_Counters 20 10 0 12 -233017 -66577 0; #X obj 67 588 cnv 15 300 20 empty empty From-To-Counters_(Modulo-n) 20 10 0 12 -233017 -66577 0; #X obj 197 757 + 1; #X obj 155 757 f 0; #X floatatom 155 817 5 0 0 0 current_output - -; #X msg 155 699 bang; #X msg 171 726 0; #X obj 155 784 mod 4; #X text 92 634 If you want to count from 0 to a max-value and then start over , use a "Modulo N" counter. Note , that the [mod] is inserted *between* the float and the [+ 1] addition. To count until N use a [mod N-1] object:; #X text 65 75 Counting in Pd doesn't require externals , you can also count with the builtin objects. The basic idiom to remember is [f 0] x [+ 1]:; #X text 212 785 <= count from 0 to 3 (where 3 == 4 - 1); #X floatatom 111 774 5 0 0 0 - - -; #X text 87 376 To start over , send the new starting value to the right outlet of the float:; #X text 193 459 <= RESET using right inlet of float; #X connect 1 0 6 1; #X connect 2 0 3 1; #X connect 2 0 15 0; #X connect 3 0 2 0; #X connect 3 0 13 0; #X connect 4 0 5 1; #X connect 5 0 4 0; #X connect 6 0 1 0; #X connect 9 0 10 1; #X connect 10 0 9 0; #X connect 14 0 3 0; #X connect 16 0 17 1; #X connect 16 0 20 0; #X connect 17 0 16 0; #X connect 17 0 18 0; #X connect 19 0 17 0; #X connect 21 0 17 1; #X connect 24 0 25 1; #X connect 25 0 29 0; #X connect 25 0 33 0; #X connect 27 0 25 0; #X connect 28 0 25 1; #X connect 29 0 26 0; #X connect 29 0 24 0;
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, sara kolster hat gesagt: // sara kolster wrote:
The object should only give a 0/1 when two separate floats [connected to right & left inlet] inlet are 0?
I tried [&&] and [== 0] but these don't act as I want to.
AND means: Say True only, if input A AND input B are true, otherwise say False. So [&&] will be 0 as soon as one input is 0.
OR however gives True as soon as one input is True, too. It will thus only lead to a False result, if both inputs are False. This is what you want: Give 0 if both inputs are 0 at the same time.
So instead of AND: [&&] you need OR, which is [||] or [|] in Pd.
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41
Thanks; that was where I was looking for. I did not even look at OR, since I logically thought that AND was the right one. Next time I'll also try the unlogical - according to my brain - approach ;)
Ciao, S
Frank Barknecht wrote:
Hallo, sara kolster hat gesagt: // sara kolster wrote:
The object should only give a 0/1 when two separate floats [connected to right & left inlet] inlet are 0?
I tried [&&] and [== 0] but these don't act as I want to.
AND means: Say True only, if input A AND input B are true, otherwise say False. So [&&] will be 0 as soon as one input is 0.
OR however gives True as soon as one input is True, too. It will thus only lead to a False result, if both inputs are False. This is what you want: Give 0 if both inputs are 0 at the same time.
So instead of AND: [&&] you need OR, which is [||] or [|] in Pd.
Ciao