@svanya said:
What I need to do is, for example:
Take soundfiles, aka. tabplay~'s of varying sizes/lengths and shrink them all so they play over the same amount of time.
I think cyclone/play~ is the easiest way to do this. Its "start" message is in the format:
- Time within the array where you want to start playing (ms);
- Time within the array where you want to stop playing (ms);
- Duration to play.
The playback rate is then automatically calculated from (end - start) / dur.
The problem with cyclone buffer~ / play~ is that (AFAICS) they don't handle the situation where the audio file being loaded is at a different sample rate from the soundcard. (Maybe they do, but if so, I don't see it.)
If you're sure that the sound files will match the DSP sample rate, then, no problem -- if one array contains 750 ms of audio and you want it to play in 250 ms, then:
[start 0 750 250(
|
[cyclone/play~ arrayname]
If you're not sure, then one solution would be some abstractions in my library (https://github.com/jamshark70/hjh-abs) that provide [value] variables with information about sound files loaded into arrays. [value xxxscale] is file's sample rate / system sample rate (btw DSP should be on before loading... I should fix that later).
(Edit: You may need to have "-lib cyclone" in the [declare] too.)
22-0810-sf-same-dur-play.pd
hjh