Implementing simple audio playlist

Hi - I need to implement a song playlist playback feature as part of an overall project; I thought this would be really straightforward in touch but it surprisingly isnt’! All I want to do is specify a folder and have it play all the songs in the folder. The audio play chop seems pretty buggy when specifying a ‘dat list’, and the volume control on the chop isn’t able to be smoothed.

Is there a way to know when an audio file is done playing with the ‘audio file in’ chop? Or is there a way to smash a bunch of chops together so it preloads all song files and creates a single chop with all songs sequenced? Or am I better of simply mixing down this playlist to a single audio file and not worry about any touch based sequencing?

Thanks!
B

Well as usual in TD, all the Lego building blocks are available, but you’ll have to build the final application yourself :wink:

First, I can’t reproduce the DAT list playback being buggy on the Audio Play CHOP.
If you read its help page you’ll see when working in DAT list mode, you can give commands to start/stop each file separate by the play() and stop() methods of the audioplayCHOP_Class. But if you use the trigger button it will start all files simultaneously (!).

Second, the Audio Play CHOP has a channel called state. Whenever this is 1, a file is playing, when it is 0 the file has finished. But to see info per file, you can place an Info CHOP and drag the Audio Play CHOP to it, which will give you extra channels of information. You can use the sample_time[123…] channel , when that reaches 0 the file has finished playing.

Attached an example, if you execute the scripts you see you can control playback of multiple audio files simultaneously.
audio_play_control_example.tox (1.3 KB)

Does this help?

And for the other option, if you prefer to use an Audio File In CHOP: you can place an Info CHOP and drag the Audio File In CHOP to its operator parameter. This will give you several channels of extra information. You can use the fraction channel to see when a file is done playing. Then you can build an A/B deck which loads all files in your Folder DAT in order.

Thank you, yes this is helpful! I think the thing that through me off with the audioplayCHOP_Class is that it triggers everything if ‘index’ isn’t specified. It’s mentioned in the docs but I missed it! Also trying to call play with the ‘start’ parameter to ‘False’ in order to fade a track that is currently playing produces some unexpected behaviors, and the volume parameter on the chop isn’t very responsive.

Thank you for calling out the ‘fraction’ channel on the info of the audioFileIn CHOP - I missed that! Exactly what I need. I’ll probably take this a/b deck approach to avoid the black box of the audioPlay chop.