Max 8 Playlist object- I am unable to get more than 1 file to play. Is this a buggy object?

cappy2112's icon

Hi,

I'm going through some beginner tutorials on Max 8. It seems like the "Hello World"

patch for Max is having 3 or more wave files in a playlist with the output of a playlist~

going to an ezdac.

The tutorial shows that clicking on the playlist button for the wave file starts that file playing. However, when I drop more than 1 wave file into the playlist~ object, only 1 file will actually make audio

go to the ezdac. Can anyone see what I'm doing wrong with the playlist~?

Regarding the playlist- if I'm not careful when I drag and drop wave files onto the playlist, one of two things happen.

  1. The first file expands and takes up all of the slots in the playlist so that only 1 file can be added.

  2. The wave file doesn't actually get added to the playlist, it just sits in front of the playlist looking like it's been added. If I move the playlist object, the wave file stays where it was dropped it doesn't move with the playlist.

The playlist object is a real pain to get working- it actually feels buggy to me.

In the attached screenshot, Audio is on, The patcher is locked, in this particular example, neither of the two wave files produce output. When I move the playlist object, the wave files do not move with it.

thanks

ShelLuser's icon

The playlist is indeed quite picky about how you use it, if you drop a file directly on top of another then it gets replaced, you really need to be near the bottom (or top) to append it.

But always keep in mind that you can control (most) objects and don't always have to interact directly. In this case you could consider adding a [dropfile] object where people can drop their files, after which you add 'm to the playlist.

cappy2112's icon

Dropfile? That's new to me too, I'll check it out.

Thanks

ShelLuser's icon

So... I wanted to have some fun too, so I did something ;)

Hope you can use this as an example as well. You drop a file onto the dropfile area and it'll get added to both the playlist and the menu object. Select the file from the menu and it'll make the playlist, well, play it. Assuming that you turned on the audio of course. ;)

So how does this work?

Here you see a dropfile in action: you drop file(s) on it and that will trigger an output: the filename. Now, if you check the playlist reference page you'll see an overview of messages that it supports. A message is something you can sent to an object in order to make it 'do' something, think of it as a command.

"Append" is used to add a file to the playlist. So "append filename.wav" (for example). As such I need to add "append" in front of the filename I just got, which is why you see [prepend append]; the prepend node can add something in front of a list, in this case that's "append" and then the whole list gets sent to the playlist. As a result it gets a new entry.

And now things become a bit tricky... maybe a bit too much for you right now, but ...

If something changes in a [playlist~] then it sends its output as a dictionary. A dictionary is basically a large collection of values. Add a file to the playlist, then double click on the [dict songs] object and you'll see what I mean.

The structure of a dictionary is basically "name = value". But to make this even more complex... those values can also be bundled, thus having one name (or "key") contain a multitude of values. In essense a dictionary is basically a database where each key is basically the definition of a table.

Not sure if you're familiar with databases yet, so I'll keep this somewhat brief.

[dict] has 2 inlets: hot (left) and cold (right). If you sent input in the cold inlet then the values only get stored, but if you sent them into the left inlet this will trigger an output.

So I'm using that mechanic in order to get the contents of the "clips" key. This is sent as an array. Fun fact... you can iterate through all its values, which is where [array.iter] comes into play. So now I'm going over all the individual entries, and I focus on the filename.

Thing about dictionaries... they store their data in a binary format. Try using a [message] object (use its right inlet) or use [print] to look at the output of [dict.unpack] and you'll see what I mean.

Anywhoo... this is why I need to change the string object into a list so that I can actually use it. Once that's done I use the same tactic as with the playlist: I place "append" in front of the list, then it gets sent to the unmenu node so that you get a list of all filenames to pick from.

All that's left to do now is select an entry from the menu, and watch the magic happen ;)

Hope this can help!

Max Patch
Copy patch and select New From Clipboard in Max.