Customizing Your Recipes
Every great chef needs a great set of tools to help create the perfect set of recipes. Now that Mixer 1.8 has been out a bit, with the new recipes feature for customizing playlists to your own taste, I’d like to show you one of the tools we use internally to help tweak our own recipes. In order to use this feature, you will need to be comfortable creating and editing recipes.
Note that this is more of a hack, and may not be supported in future versions, especially in this form. It is still a useful tool for now.
First off, one of the main requests we frequently get is being able to tweak playlist options from the main user interface. Although this hack doesn’t cover all of that, it does do some of it. To get this hack to work, you’ll need to pass -playlistcontrols on the command line when you start the mixer. (If you need help passing command line arguments, check out the command line options for MusicIP Mixer).
After starting the mixer with the -playlistcontrols option, you’ll have a new option on the View menu - Show Playlist Controls. Select this, and you’ll have a new window to customize the current recipe. You can keep this window up while you use the mixer, or hide it from the View menu whenever you’re done. Note that you can press the Remix button to update the current mix after you change the recipe.
If you’ve jumped ahead and followed the above instructions before getting this far, you might have noticed the default Playlist Controls window has nothing but a Remix button. In order to get some controls there, you need to build them into your own recipes - the existing recipes do not have any controls. These controls are expressed in your recipes as “inputs”. An input is basically a parameterized setting to a recipe. Most of the places where you have previously used hardcoded values, you can use instead put the text “param foo” to refer to a user-settable option. The name is up to you, foo is just a placeholder name developers like to use.
Inputs can currently be mapped to either checkboxes or sliders. If it’s a checkbox, the parameter will evaluate to 1 if the box is selected, or 0 if it is not. If it’s a slider, you can choose the range of values, and the user will pick one by moving the slider. This way, you can make the values in your recipes customizable on-screen.
A checkbox input looks like this:
<input param=”lock” type=”checkbox” label=”My Option” value=”on”/>
A slider input looks like this:
<input param=”foo” type=”slider” label=”Foo” minLabel=”Low” maxLabel=”High” min=”0″ max=”9″ value=”0″/>
In each case, param is the name of the parameter, type is the type, the labels will show up on the playlist controls, and value is used for default settings. The slider has additional options for the range it allows.
Once you have created and selected a recipe with inputs, you’ll be able to adjust the parameters using the playlist controls. Just adjust the spice, press the Remix button, and see how your playlist changed.
Checkbox controls can be useful in combination with the cond setting of a constraint or modifier to allow you to turn parts of your recipes on and off at will. Sliders might be useful for making the effect of a modifier stronger or weaker.
Here’s a sample recipe to get you started:
<recipe name=”Restrict Mixes by Era”>
<input param=”restrict” type=”checkbox” label=”Restrict mixes from different eras” value=”on”/>
<input param=”numyears” type=”slider” label=”Allow this many years:” minLabel=”1 year” maxLabel=”10 years” min=”1″ max=”10″ value=”5″/>
<constraint cond=”param restrict != 0 and seed year != 0″ cutoff=”0″>abs(year - seed year) < param numyears</constraint>
</recipe>
This recipe defines two inputs, restrict and numyears, which are used in the constraint as parameters. The checkbox can be used to enable or disable the constraint, and the slider controls the range of the condition in the constraint (how many years separated matching songs can be from the original song). The controls for this recipe look like this:
Have fun, and make sure to clean the counter when you’re done.
October 5th, 2007 at 3:54 pm
I copied and pasted this into the recipe.xml file but it gives me errors when loading:
abs(year - seed year) < param numyears
abs(year - seed year) < 5
rating = 5
rating = 4
rating = 2
rating = 1
playcount = 0
lastplayed
> now - 7 days
0″
weight=”2″>seed artisttype = artisttype
overlap(seed genre, genre) > 0
overlap(seed title, title) > 0
October 5th, 2007 at 4:33 pm
You have to make sure the XML is valid - if you want, you can email it to me at whicken at musicip dot com. As you can see, the version you pasted here got corrupted by the blog software.