-
Notifications
You must be signed in to change notification settings - Fork 7
Description
TODO:
- determine when the next loop point of each track is coming, if it is now or somewhere very close say in 100ms in future or past. then update the buffer and play it now. otherwise if it's end is in future, start a timeout, end it then, and then update the list with null. this might lead to some empty space. (time waiting for next loop point to come).
- rather than updating a certain fraction of the number of loops each time, we cycle through all loops that could be updated and only update ones based on a probability. Let's set that to 50% for now as that might be convenient for testing, though I will want it lower in deployment live most likely.
This is a feature add for the looping playback system, newly built to handle recordings made using the looping recording method.
Would it be possible to change some (non-base) loop lengths to fractions of the base loop length? In other words, could we play another loop at half the length so that the first part of that loop played twice while the base loop played once?
Or is there something fundamental about this playback method that requires all loops to always be the same length and sharing the same consistent loop point?
SJ - yes, its possible. if the some speaker is exactly half the length, then every 2nd loop point of this speaker would be at the same time as loop point of base speaker.
FYI, only the loop points of base speakers are considered for invoking the algorithm. (other than location change).
all the speakers are started at the same time, but they are looping individually. so if there’s requirement for same loop point for all speakers then i would say its necessary to have them of same length.
although nothing is stopping us from passing different lengths of loops. the but if lengths are different and doesn’t even have any common multiple, it will also sound to be out of sync musically. currently there’s no mechanism that prevent this. if thats what you wanted to know.
Thx for this. What we want to enable is to change the length of the loops to common fractions of the original loop size so they come back together at the same loop point eventually. It’s easier to think about in terms of musical measures/bars rather than time. If we have a base loop of 8 bars, it would be really great if we could playback other loops at 4 bars and 6 bars and maybe even 5 or 3 bars as well, but not any other random lengths, all common fractional lengths.
Glad to hear that this is possible without major changes to how you have built it. I’d love to hear your thoughts on introducing another parameter to our playback engine that modifies the loop lengths like this. I think limiting it to [3/8, 1/2, 5/8, 3/4] fractions is a great place to start. I’ll think more about it, but some randomization mechanism where each time new speakers are added to the mix, there is a chance that they play back at one of these different lengths instead of their full length.
Do you have any concerns about the loops drifting out of sync over time if we do this?
SJ - OK… sure. we can add the param. i think there was a length param earlier but it would not be helpful for the approach suggested here.
limiting it to[3/8, 1/2, 5/8, 3/4]fractions is a great place to start
So, if a new loop is selected, and random selection comes as 1/2 then i set the length of that loop to0.5 * originalLoopLengthor0.5 * baseLoopLength?
Do you have any concerns about the loops drifting out of sync over time if we do this?
i don’t think so. although i can’t guarantee, there can be few milliseconds if played for hours, it depends how code is executed on low level, but i guess it should be reasonably accurate.
if the it is not something like 0.333333… chances are less
Shouldn’t originalLoopLength and baseLoopLength be the same, so this would make no difference, at least initially? I guess maybe you are asking if it happens more than once to the same loop? In this case, we definitely want to use the static baseLoopLength so we don’t keep on getting shorter and shorter. In other words, each time a loop is shortened to one of the available fractions, the resulting length is that fraction times the static baseLoopLength . If a loop has been reduced to 0.5 for a little while, if it is to have its length changed again, the new length will not be a fraction of the 0.5 length, but rather will reset and then take the new fraction fresh from the full base loop length.