First time here? Check out the FAQ!
x

Bi-directional looping of a sample

+1 vote
405 views
When editing a wave in the editor and using a keyboard,  you can select between forward looping and bi-directional looping. So far i have not found a sample-playback prototype that actually remembers that selection or allows us to use bi-directional looping on the given loop points from a sample's header. I find it quite useful, since i tend to prefer for various reasons to set loop points before hand and not live. Am i perhaps missing something, a prototype or a way to set this?

 

And on a more general note it would be grand if we could "tap into" those loop points from within a prototype and mangle them somehow :)
asked Jun 30, 2019 in Using Kyma by greg-grigoropoulos (Practitioner) (810 points)

1 Answer

+2 votes
 
Best answer

If you use the TimeIndexForFileName Sound with a SampleWithTimeIndex (both set to the same sample file), then the TimeIndexForFIleName does read the loop markers when its loop mode is set to "Markers". 

If you set it's ForwardBackward parameter to true (greater than zero), then it will bounce forward and backward through the sample just as the sample editor does. 

 

If you want to make a Sound that starts looping with the loop markers in the sample's header but then lets you move them you could do that by extracting the markers with Smalltalk and putting them into the loop parameters of a sample player added to an !EventValue so you can change them at run-time. 

Check out this question from Cristian and its answer to see how to extract the loop markers with Smalltalk.

 

This is what the looping parameters in the TimeIndexForFileName could look like to extract the looping markers but allow you to move them:

 

Note that you have to set the LoopMode to "Live" for this to work. 

 

Here's an example Sound that does this. 

answered Jun 30, 2019 by alan-jackson (Virtuoso) (15,840 points)
selected Jul 1, 2019 by greg-grigoropoulos
Excellent, thanks for the help Alan!
This almost begs for a similar way to select a sample and it's details in a similar fashion instead of using the "open" dialogue.
...