-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player nodes: how to access current/last sample value/index #116
Comments
should something like this work? from signalflow import *
graph = AudioGraph()
audio_buf = Buffer(audio_path)
player = BufferPlayer(audio_buf, loop=True)
clock = Impulse(1.0)
divided_clock = ClockDivider(clock, graph.sample_rate)
counter = Counter(clock=divided_clock, min=0, max=audio_buf.num_frames)
graph.play(player)
co = counter.output_buffer[0][0]
nf = audio_buf.num_frames
conf = co / nf # percentage way through the buffer |
If you're looking to get the current read position of a
Is this what you were looking to do?
|
Ok cool - does Read position is good, but then we have to use that to manually fetch the value associated with that position. Would be great if this was available via another property. Or not? |
Named properties can be defined for each node class. Yes, it could be nice to have |
Ok so in practice |
Yes, exactly. And this is the same as any audio system running on a non-real-time OS - samples are passed to the audio thread in blocks, and the control thread has no insight into what sample is currently being rendered with any resolution better than <1 block. You could do something with interpolation on the control side if you did want granularity better than that. |
Say I wanted to draw a moving playhead on top of a buffer waveform visualisation, how would I do that?
The text was updated successfully, but these errors were encountered: