how to make an intelligent playlist?

ugh leisner's icon

Hi.

I'm working on a max app, that will function like an adaptive media player. It contains about 100 audio tracks. Ten of these tracks is the main tracks and the rest is various small interludes.

The ten tracks will appear in a playlist in the user interface, and the interludes will be concealed for the user.

The track-list is adaptive (it uses various rules i.e. time, date etc.).

The player should appear as organic as possible, so I don't want to construct the possible playlist's in advance. I want to use the rules to determine which track is gonna follow a track.

I need some way to tell my player that it shouldn't play a track, that has already been played in "one round of listening".

Any ideas?

jko's icon

A combination of a coll with all filenames and urn maybe?

ongo73's icon

Yes coll and urn with filenames will make sure no repetitions are made.

Is you playlist always the same or will it be fullly customisable (ie load in your own main and snippet tracks ?)

I think the dificullty of this would be what probability rules should be used each time (maybe if different tracks are used . they would require different set of rules)

ugh leisner's icon

Quote: ongo73 wrote on Wed, 07 January 2009 14:40
----------------------------------------------------
> Yes coll and urn with filenames will make sure no repetitions are made.
>
> Is you playlist always the same or will it be fullly customisable (ie load in your own main and snippet tracks ?)
>
> I think the dificullty of this would be what probability rules should be used each time (maybe if different tracks are used . they would require different set of rules)
>
>
----------------------------------------------------

Thanks for your advice both of you. I'll try it asap.

The playlist is constant/static. My 10 tracks and 90 snippets always;)!

ongo73's icon

I just hope that one of the Max/msp gurus who often brows the forum might be of more help (ie chris Muir and Stefan Tiedje , would have a much better insight on the subject than I would !)

Gregory Taylor's icon

There's no such thing as an intelligent playlist, since one cannot infer agency to a mere list. That said, colls and urns would be the way to go, with some judicious routing and list processing potentially thrown in.

Andrew Benson's icon

Most "intelligent playlist" type applications rely on manipulating and extracting metadata from a database. Coll and urn work just fine for this, but you might find switching to a more robust SQL database setup to be more fulfilling.
Check out this article:
https://cycling74.com/story/2008/9/5/16230/12047

It would be a cinch to adapt the example given to your purposes.

Best,
Andrew B.

mesa.elech/tele's icon

i wish you would give us more specific "rules."
for exmaple, no main track repetition, or no more than four interludes in a row or so...

this kind of reminds me of generative diatonic chord progressions,
so that type of references might help you...

ugh leisner's icon

Quote: mesa.elech/tele wrote on Thu, 08 January 2009 07:07
----------------------------------------------------
> i wish you would give us more specific "rules."
> for exmaple, no main track repetition, or no more than four interludes in a row or so...
>
> this kind of reminds me of generative diatonic chord progressions,
> so that type of references might help you...
----------------------------------------------------

The specific rules for the playlist is:

- A full playback is always: main - snippet - main -snippet.... and so on... until you reach the 10th main track which will be the last track of that specific playback.

- No main or snippet track repetition at all per playback.

- It is important that the user can choose the first track and go from there but the user should also just be able to hit play and see what happens, letting the software choose the first song.

f.e's icon

How to make an intelligent playlist : Buy good records ?

f.e

f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> | film soundtracks, sound art, music |

ugh leisner's icon

This looks like the best solution at the moment.... BUT: I've been advised to stay away from sql stuff due to cross platform issues.

My app must be able to run on both windows and os x. It's no problem to demand that the windows users must download quicktime, but is there any other potential platform issues when using sql?

Quote: andrewb@cycling74.com wrote on Thu, 08 January 2009 06:09
----------------------------------------------------
> Most "intelligent playlist" type applications rely on manipulating and extracting metadata from a database. Coll and urn work just fine for this, but you might find switching to a more robust SQL database setup to be more fulfilling.
> Check out this article:
> https://cycling74.com/story/2008/9/5/16230/12047
>
> It would be a cinch to adapt the example given to your purposes.
>
> Best,
> Andrew B.
----------------------------------------------------

pdelges's icon

On 12 janv. 09, at 15:53, ono wrote:

>
> This looks like the best solution at the moment.... BUT: I've been
> advised to stay away from sql stuff due to cross platform issues.

It is embedded in Max5, and accessible via [js], so it is cross
platform.

> _____________________________

Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl
http://www.crfmw.be/max

Synthesizer Patel's icon

sqlite is omni-platform and doesn't require the installation of a
server -- you would need to utilize some sort of runtime in an
external, but you could do it without a lot of hassle.

On Jan 12, 2009, at 6:53 AM, ono wrote:
> This looks like the best solution at the moment.... BUT: I've been
> advised to stay away from sql stuff due to cross platform issues.
>
> My app must be able to run on both windows and os x. It's no problem
> to demand that the windows users must download quicktime, but is
> there any other potential platform issues when using sql?

nick rothwell | project cassiel's icon

On 12 Jan 2009, at 16:35, Nathan Ramella wrote:

> sqlite is omni-platform and doesn't require the installation of a
> server -- you would need to utilize some sort of runtime in an
> external, but you could do it without a lot of hassle.

For what it's worth, there are numerous platform-agnostic databases
out there, and something like Derby or HSQLDB which is written in Java
and can run embedded would work as well. I have a Java package for Max
at

but in Max 5 you may well find that the embedded sqlite is easier to
get working - I've not tried it.

    -- N.

Nick Rothwell / Cassiel.com Limited
www.cassiel.com
www.myspace.com/cassieldotcom
www.last.fm/music/cassiel
www.reverbnation.com/cassiel
www.linkedin.com/in/cassiel
www.loadbang.net

Synthesizer Patel's icon

Just to clarify, my suggestion for sqlite is based in the foundation
that to include sqlite in your app only requires wrapping a shared
library/DLL. While I love Java (I love all languages except PHP and
Scheme), I'd wager that sqlite's footprint would be much smaller and
be contained in the runtime of the external, rather than necessitating
the fork of a new process.

huh. And, it's apparently built in already.

-n

On Jan 12, 2009, at 8:48 AM, Nick Rothwell wrote:

> On 12 Jan 2009, at 16:35, Nathan Ramella wrote:
>
>> sqlite is omni-platform and doesn't require the installation of a
>> server -- you would need to utilize some sort of runtime in an
>> external, but you could do it without a lot of hassle.
>
> For what it's worth, there are numerous platform-agnostic databases
> out there, and something like Derby or HSQLDB which is written in
> Java and can run embedded would work as well. I have a Java package
> for Max at
>
>     http://www.loadbang.net/space/Software/net.loadbang-SQL
>
> but in Max 5 you may well find that the embedded sqlite is easier to
> get working - I've not tried it.
>
>     -- N.
>
>
> Nick Rothwell / Cassiel.com Limited
> www.cassiel.com
> www.myspace.com/cassieldotcom
> www.last.fm/music/cassiel
> www.reverbnation.com/cassiel
> www.linkedin.com/in/cassiel
> www.loadbang.net
>
>

ugh leisner's icon

Yes, that's the article andrew referred to earlier in this thread;).

Quote: Synthesizer Patel wrote on Mon, 12 January 2009 18:05
----------------------------------------------------
> Just to clarify, my suggestion for sqlite is based in the foundation
> that to include sqlite in your app only requires wrapping a shared
> library/DLL. While I love Java (I love all languages except PHP and
> Scheme), I'd wager that sqlite's footprint would be much smaller and
> be contained in the runtime of the external, rather than necessitating
> the fork of a new process.
>
> huh. And, it's apparently built in already.
>
> https://cycling74.com/story/2008/9/5/16230/12047
>
> -n
>

Jean-Francois Charles's icon

And if you haven't done so yet, really try it. It's easier than it looks (js
and SQL may sound like intimidating things, but check the article...)
J-F.

> Most "intelligent playlist" type applications rely on manipulating and
> extracting metadata from a database. Coll and urn work just fine for this,
> but you might find switching to a more robust SQL database setup to be more
> fulfilling.
> Check out this article:
> https://cycling74.com/story/2008/9/5/16230/12047
>
> It would be a cinch to adapt the example given to your purposes.
>
> Best,
> Andrew B.

ugh leisner's icon

Yes, it does seem a bit intimidating but that's never stopped me before;).

There's a couple of details I want to be clear about that could be great with you guys' advice on before i proceed.

There will different versions of the 10 main tracks. The user will only see 10 track titles and have the option to choose a song. But the app should then be able to choose the correct track version according to the various rules i mentioned in my first post... How would you go about that? As suggested earlier an involvement of Coll and Urn in the SQL example patch perhaps?

Some of my questions may be rookie-like, hope you can live with that. I'm learning by doing and the app's deadline is too close to allow me to take the time to learn every Max/msp trick in the book first;).

- Kristoffer

Quote: jeanfrancois.charles wrote on Tue, 13 January 2009 05:00
----------------------------------------------------
> And if you haven't done so yet, really try it. It's easier than it looks (js
> and SQL may sound like intimidating things, but check the article...)
> J-F.
>
> > Most "intelligent playlist" type applications rely on manipulating and
> > extracting metadata from a database. Coll and urn work just fine for this,
> > but you might find switching to a more robust SQL database setup to be more
> > fulfilling.
> > Check out this article:
> > https://cycling74.com/story/2008/9/5/16230/12047
> >
> > It would be a cinch to adapt the example given to your purposes.
> >
> > Best,
> > Andrew B.
>
>
>
----------------------------------------------------

Andrew Benson's icon

To put it in SQL terms:
- You create a TABLE to store all of your information
- One column will be your track names
- For each category of metadata (tonality, mood,time,date,etc.) you will create a column.
- To add metadata, you will use INSERT and UPDATE statements to alter the contents of specific fields in the table.

In your patch you'll create a way to run searches based on metadata values in the database and select from the results.
A lot of the work has been done for you in the movieBase.js example provided with the article. Please read that, and come back with any questions you might have. If you are not familiar with JavaScript, there are some easy to read tutorials online that will get you going.

Best of luck,
Andrew B.

Jonathan Hallstrom's icon

I know that this is totally OT, but since this is an international list
I'm wondering if anyone can tell me what (if any) duty I'll have to pay
if I purchase a used piece of (musical) equipment from a private
individual living in the EU. If I am going to have to pay duty, how do
I find out how much it'll be?

Any info would be greatly appreciated.

Jon

ugh leisner's icon

Well that depends on where you live. If you live in the EU not duty is to be payed. Otherwise the laws vary from country to country. You'll in that case have to contact the local authority on taxes/duty to find out what the rules are.

Quote: Jonathan Hallstrom wrote on Thu, 15 January 2009 18:00
----------------------------------------------------
> I know that this is totally OT, but since this is an international list
> I'm wondering if anyone can tell me what (if any) duty I'll have to pay
> if I purchase a used piece of (musical) equipment from a private
> individual living in the EU. If I am going to have to pay duty, how do
> I find out how much it'll be?
>
> Any info would be greatly appreciated.
>
> Jon
>
----------------------------------------------------

Jean-Francois Charles's icon

I bought once a kind of expensive used musical instrument from an individual
living in the USA, to be delivered in France. When the instrument arrived,
the delivery company had me pay the VAT when they handled me the instrument.
The customs make sure that is done this way. Even if you send a gift from
the USA to France, if the declared value is substantial, the recipient of
the gift will have to pay the VAT before the delivery company gives the
good.
I never tried the other way (buy in Europe, have it delivered in the US).
Jean-Francois.

>
> Well that depends on where you live. If you live in the EU not duty is to be
> payed. Otherwise the laws vary from country to country. You'll in that case
> have to contact the local authority on taxes/duty to find out what the rules
> are.
>
>
> Quote: Jonathan Hallstrom wrote on Thu, 15 January 2009 18:00
> ----------------------------------------------------
>> I know that this is totally OT, but since this is an international list
>> I'm wondering if anyone can tell me what (if any) duty I'll have to pay
>> if I purchase a used piece of (musical) equipment from a private
>> individual living in the EU. If I am going to have to pay duty, how do
>> I find out how much it'll be?
>>
>> Any info would be greatly appreciated.
>>
>> Jon

ugh leisner's icon

Quote: andrewb@cycling74.com wrote on Wed, 14 January 2009 19:27
----------------------------------------------------
> To put it in SQL terms:
> - You create a TABLE to store all of your information
> - One column will be your track names
> - For each category of metadata (tonality, mood,time,date,etc.) you will create a column.
> - To add metadata, you will use INSERT and UPDATE statements to alter the contents of specific fields in the table.
>
> In your patch you'll create a way to run searches based on metadata values in the database and select from the results.
> A lot of the work has been done for you in the movieBase.js example provided with the article. Please read that, and come back with any questions you might have. If you are not familiar with JavaScript, there are some easy to read tutorials online that will get you going.
>
> Best of luck,
> Andrew B.
----------------------------------------------------

Allright, I've completed the w3 javascript tutorial and feel fairly comfortable with the language.

With no alterations in the Moviepicker patch I've tried to select my track folder of mp3's instead of selecting a movie folder without any luck. Is this because of the following file specifications in movieBase.js?

f.typelist = [ "MPEG","PICT","MooV","GIFf","JPEG","PNG","TIFF","SWFL","VfW","8BPS","BMP"];

I've tried adding "MP3" without succeeding in getting my files loaded in the umenu.

The first thing to do I guess is to write a .js file for my patcher.
I've started to write it taking whatever's useful from the movieBase.js. I would like to specify a file path for the database (in my patchers root folder). Can I do it this way (i've just changed the x in the first sqlite.open argument to a / as I would do in fx html)?:

{
sqlite.open(/,1);
get_all();
menuLoad;
}

In the setup database section I've made the following alterations according to your advice (as I understand them with my lack of experience on the subject anyways):

{
exec("CREATE TABLE IF NOT EXISTS dumpster(track name VARCHAR(256),time VARCHAR(256),user input VARCHAR(256), mic input VARCHAR(256), cam input VARCHAR(256), weather VARCHAR(256), cheat codes VARCHAR(256))");
add_column("color","style");
}

//this outputs the entire table for the cellblock display
function get_all()
{
exec("SELECT * FROM dumpster");
}

/*insert:
*track name
*time
*user input
*mic input
*cam input
*weather
*cheat codes
*/

function insert_entry()
{
if(arguments.length==7)
{
exec("INSERT INTO dumster ('track name','time','user input','mic input','cam input','weather','cheat codes') VALUES ('"+arguments [0]+"','"+arguments[1]+"')");
}
else
{
post("Wrong number of arguments");
}
}

I have more questions and doubts about the .js file, but I think this is enough to get me going for a couple of days.

Any help is greatly appreciated!

- Kristoffer

jko's icon

Max can not play mp3 files with it's standard play modules. Correct me somenone if I'm wrong. You can play mp3s with quicktime (jit.qt.movie) though (attention: Sound will not be handled by msp then but your system Sound module).

Before loosing yourself in finding out the filetype for mp3 you should convert your mp3 files to aiff or wav. That's what all DAWs do on the fly if you import mp3s. You might be able to do that converting on the fly with a combination of spigot~ and jit.qt.movie too, but that is just a guess... Or just convert them outside of max.

Luke Hall's icon

You can send the "import" message to a [buffer~] to read in mp3 files, have a look in the [buffer~] reference for details. Or you can load them into a [jit.qt.movie] and use [spigot~] to grab the sound, the [spigot~] helpfile has an example of this.

lh

Jean-Francois Charles's icon

In Max, you can import a mp3 into a buffer~. It's the standard way of
"uncompressing a mp3 on the fly" in Max. I believe quicktime does the same,
actually (when you open a large mp3 file, you can see the time quicktime
uses to un-compress).
J-F.

> Max can not play mp3 files with it's standard play modules. Correct me
> somenone if I'm wrong. You can play mp3s with quicktime (jit.qt.movie) though
> (attention: Sound will not be handled by msp then but your system Sound
> module).
>
> Before loosing yourself in finding out the filetype for mp3 you should convert
> your mp3 files to aiff or wav. That's what all DAWs do on the fly if you
> import mp3s. You might be able to do that converting on the fly with a
> combination of spigot~ and jit.qt.movie too, but that is just a guess... Or
> just convert them outside of max.

jko's icon

Sorry for the misinformation, I had sfplay in mind only...

ugh leisner's icon

The quicktime / spigot~ works fine with mp3, and if you've read through Andrews article on js/msq you would know that it relies on quicktime and therefore support whatever quicktime supports.

Agree?

ugh leisner's icon

No additional help available?