sample_paths might provide the path details you’re looking for, and you can use Ruby’s file I/O to write the file – parse the parts you’re interested in from sample_paths YOUR_SAMPLE into path_stuff in the sample code below…
Thank you!
With this, it is possible to print out the complete filepath.
Is it even possible to only print the filename? like “sound.wav”?
And a second question. (Sorry, but i am not so firm with Ruby and the Stringmanipulationthings…)
Is it possible to sorround the filepath with other text? like “The file sound.wav was played at time: 2:32, with amp 2 and a panning of -0.3”
Sorry for my questions. But …
is there a way to print out the time?
When i play a sample the console puts out a
{run: 1, time:1.234}
Can i access this time value?
Thanks!
sample_duration only gives me the duration of the current sample.
I want the complete past time… or i had to make an addition of all sleeps before the point i want to know the time…
Found a way, even if its not very stable.
At the beginning i set
t = Time.now
and in the moment is use it i do
puts (Time.now - t)
But this gives slightly different values each time. But i can live with it