is there any way to display during the playback of an array, the current sample being heard? i know [soundfiler] can display the total number of samples in an array, but how can one see which is currently being played?
-
-
When running at 44.1 that would mean displaying 44100 number(updates) per second, i'm afraid tcl/tk won't handle that...
There are various ways to give an indication (unless you can read 44100 numbers per second of course) of where the sample is being played. You could set up a slider (ranging from 0 to 1). Each time the sample is triggered you could then e.g. trigger a [line] object going from 0 to 1 (the time would be the time of the sample) and send that to the slider so it moves along with the playback.
Does that make any sense?
|] [] |.| ][|-| -- http://soundcloud.com/domxh
-
yeah, do you want a constant stream of values with the current position, or do you just need to be able to bang for specific values?
for the first, as domien said, [line] will help.. you can add a creation argument, like [line 0 1] to make it more accurate (check the helpfiel if yoU want more info)
if you just need to bang to find the current position, then you can get current position in ms, using [realtime] (or [timer], i can never remember the difference between those, again check the helpfile). then multiply the current position in ms by 1000 to get the position in seconds, and then multiply by the samplerate to get the current position in samples.
-
You could also set up a canvas and update the x coordinate using [snapshot~] and a metro and the appropiate messages.
check out this nice patch that Maelstorm did recently (it is also a really nice timstretching patch!):
http://puredata.hurleur.com/sujet-2779-time-stratching(sorry-have i misread the original question? I always do that!)
boonier