Creating playlists#
Creating a playlist#
A playlist contains all the sound files used in an experiment, stored as Section objects. 
The attributes of these sections can be edited in the admin interface or processed from a CSV file.
These attributes can be used in your rules file to distinguish your sections for different purposes.
Each time the playlist is saved with Process csv checked, the sections are updated with the attributes from the Csv field.
CSV Format (comma separated):#
artist_name [string], song_name [string], start_position [float], duration [float], "path/filename.mp3" [string], tag [string], group [string]
Uploading sound files#
Uploading Sound files through the admin interface:#
- Click Add playlistatlocalhost:8000/admin/section/playlist/ 
- Give your playlist a name. Note that this name will also be used to name the folder where the sound files will be stored on the server, so make sure this name is unique.
- Leave the Csvfield empty,Process Csvunchecked and clickSAVE. Your playlist will now appear in the list when you click on “Playlists” on the left. 
- Click Add sectionsnext to your playlist. 
- You can add some attributes for your sections now, or leave these blank.
- When either the artistor thenamefield is filled aSongobject will be created for these sections.
- The Tagandgroupattributes can be used as identifiers in your rules file. 
- Click Add sectionsto upload your files to the server and add the sections to the database.
Click on the name of your new playlist and notice that the Csv field is now filled with the attributes of the sections and the metadata of its sounds.

Manually uploading sound files#
When running a local MUSCLE development installation you can just create a folder with your sound files at backend/upload/
Running a production server you can use SSH or FTP to upload your sound files to a server, then adjust your apache / ngnx config to point to the location from which the sound files will be served.
Generate a CSV file:#
- 
Run the compileplaylistcommand on your server container:docker-compose run --rm server ./manage.py compileplaylist <path-relative-to-upload-folder>. This will create a file namedaudiofiles.csvin the folder of your sound files.
- 
Click Add playlistatlocalhost:8000/admin/section/playlist/ 
- Give your playlist a name
- Paste the (edited) content of audiofiles.csvinto the csv field.
- Check Process Csvand clickSAVE
This will create section objects for your sound files with the attributes from the CSV file.
Editing the section attributes#
Through the admin interface#
- Click Edit sectionsathttp://localhost:8000/admin/section/playlist/ 
- Now you can alter the information of the sections in a table:

Through the Csv field:#
- Copy the Csvfield of your playlist in your CSV editor and make the necessary changes.
- Paste the content of your CSV file back into the Csvfield of your playlist.
- Check Process csvand clickSAVE