how to make an intelligent playlist?

Jan 7, 2009 at 11:52am

how to make an intelligent playlist?

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?

#41572
Jan 7, 2009 at 12:28pm

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

#148098
Jan 7, 2009 at 1:40pm

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)

#148099
Jan 7, 2009 at 3:39pm

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;)!

#148100
Jan 7, 2009 at 10:34pm

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 !)

#148101
Jan 7, 2009 at 11:55pm

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.

#148102
Jan 8, 2009 at 5:09am

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:

http://www.cycling74.com/story/2008/9/5/16230/12047

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

Best,
Andrew B.

#148103
Jan 8, 2009 at 6:07am

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…

#148104
Jan 8, 2009 at 9:14am

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.

#148105
Jan 8, 2009 at 9:45am

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 |

#148106
Jan 12, 2009 at 2:53pm

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:
> http://www.cycling74.com/story/2008/9/5/16230/12047
>
> It would be a cinch to adapt the example given to your purposes.
>
> Best,
> Andrew B.
—————————————————-

#148107
Jan 12, 2009 at 3:08pm

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

#148108
Jan 12, 2009 at 4:35pm

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?

#148109
Jan 12, 2009 at 4:48pm

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
http://www.cassiel.com
http://www.myspace.com/cassieldotcom
http://www.last.fm/music/cassiel
http://www.reverbnation.com/cassiel
http://www.linkedin.com/in/cassiel
http://www.loadbang.net

#148110
Jan 12, 2009 at 5:05pm

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.

http://www.cycling74.com/story/2008/9/5/16230/12047

-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
> http://www.cassiel.com
> http://www.myspace.com/cassieldotcom
> http://www.last.fm/music/cassiel
> http://www.reverbnation.com/cassiel
> http://www.linkedin.com/in/cassiel
> http://www.loadbang.net
>
>

#148111
Jan 12, 2009 at 5:21pm

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.
>
> http://www.cycling74.com/story/2008/9/5/16230/12047
>
> -n
>

#148112
Jan 13, 2009 at 4:00am

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:
> http://www.cycling74.com/story/2008/9/5/16230/12047
>
> It would be a cinch to adapt the example given to your purposes.
>
> Best,
> Andrew B.

#148113
Jan 13, 2009 at 9:49pm

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:
> > http://www.cycling74.com/story/2008/9/5/16230/12047
> >
> > It would be a cinch to adapt the example given to your purposes.
> >
> > Best,
> > Andrew B.
>
>
>
—————————————————-

#148114
Jan 14, 2009 at 6:27pm

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.

#148115
Jan 15, 2009 at 5:00pm

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

#148116
Jan 15, 2009 at 5:10pm

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
>
—————————————————-

#148117
Jan 15, 2009 at 6:08pm

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

#148118
Jan 20, 2009 at 6:25am

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

#148119
Jan 20, 2009 at 11:15am

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.

#148120
Jan 20, 2009 at 2:15pm

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

#148121
Jan 20, 2009 at 3:49pm

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.

#148122
Jan 20, 2009 at 4:25pm

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

#148123
Jan 20, 2009 at 6:35pm

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?

#148124
Feb 9, 2009 at 7:43pm

No additional help available?

#148125

You must be logged in to reply to this topic.