MusicIP: Support for "recipes"
MusicIP has the concept of a recipe file where you can specify constraints and rules for generating the automatic playlists. The recipe file is an XML file called recipes.xml with one or more recipe elements, example:
genre contains 'Christmas'
genre contains 'Comedy'
This recipe definition would take care that no tracks with the genres Christmas or Comedy were included in the suggestions.
To apply a recipe, the URL parameter 'recipe' with the recipe's name as its value has to be added to MusicIP's /api/mix URL call, 'recipe=default' would select the example recipe definition from above.
Constraints:
A constraint lets you impose extra conditions on the songs which will be included in a mix. The general form is:
expression
Supported options:
cond - Condition under which this constraint should be applied - you may refer to the seed songs in this expression.
max - Maximum percentage of songs in the list which should match the constraint (default scale is 0 to 1).
min - Minimum percentage of songs in the list which should match the constraint (default scale is 0 to 1).
cutoff - Number of songs which should be skipped trying to enforce the constraint (default 50, 0 means unlimited).
scale - Choose a different scale for min/max. Typically you might set the scale to 100 to express min and max as more traditional percentages.
Modifiers:
A modifiers lets you nudge certains songs to show up more or less often in a playlist. The weight attribute controls how gentle or strong the nudge is. The general form is:
expression
Supported options:
cond - Condition under which this modifier should be applied - you may refer to the seed songs in this expression.
weight - Roughly speaking, how much more likely this song should be to show up in a mix. A value of 2 would mean twice as likely, and a value of .5 would mean half as likely.
genre contains 'Christmas'
genre contains 'Comedy'
This recipe definition would take care that no tracks with the genres Christmas or Comedy were included in the suggestions.
To apply a recipe, the URL parameter 'recipe' with the recipe's name as its value has to be added to MusicIP's /api/mix URL call, 'recipe=default' would select the example recipe definition from above.
Constraints:
A constraint lets you impose extra conditions on the songs which will be included in a mix. The general form is:
expression
Supported options:
cond - Condition under which this constraint should be applied - you may refer to the seed songs in this expression.
max - Maximum percentage of songs in the list which should match the constraint (default scale is 0 to 1).
min - Minimum percentage of songs in the list which should match the constraint (default scale is 0 to 1).
cutoff - Number of songs which should be skipped trying to enforce the constraint (default 50, 0 means unlimited).
scale - Choose a different scale for min/max. Typically you might set the scale to 100 to express min and max as more traditional percentages.
Modifiers:
A modifiers lets you nudge certains songs to show up more or less often in a playlist. The weight attribute controls how gentle or strong the nudge is. The general form is:
expression
Supported options:
cond - Condition under which this modifier should be applied - you may refer to the seed songs in this expression.
weight - Roughly speaking, how much more likely this song should be to show up in a mix. A value of 2 would mean twice as likely, and a value of .5 would mean half as likely.
Leave a comment