Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Use MusicIP inside foobar2000 (Read 11257 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Use MusicIP inside foobar2000

ok, I try to explain how I get MusicIP Mixer working with foobar2000, without opening MusicIP Mixer.
means, select a seedtitle to generate a playlist based on this title.

You should know what MusicIP mixer do and maybe you got it running on your computer.
If not, download it here > http://www.musicip.com/mixer/index.jsp and read about it > http://www.musicip.com/mixer/help.jsp.
You need foo_run too - download and install it > http://www.hydrogenaudio.org/forums/index....showtopic=45223

If you got MIP running and your library is analysed you normaly select titles and send the generated playlist to foobar. To make this obsolete MusicIP Mixer provides an API to quere playlists.
The API is accessable over http, means MusicIP Mixer comes with a small Serverapplication.

So lets start:

1. Install MusicIP Mixer Server as Service
Open a Command Prompt and change directory to "C:\Program Files\MusicIP\MusicIP Mixer" and type "MusicmagicServer install"

read more about that and about configuration of MIP Server here > http://www.musicip.com/mixer/server.jsp

MIP should now running as service to try that, open http://localhost:10002
you should see a simple webpage with elements to control MIP (nearly the same like in preference dialog of MIP app).
If you type http://localhost:10002/api/mix?artist=your+artist in browser you should get a mixed list of mp3. this is our basic.

Find out more about API calls here: http://www.musicip.com/mixer/httpprotocol.jsp

A good tutorial to setup MIP Server > http://spicefly.com/index.php?option=com_c...5&Itemid=32
And a replacement of the standard API Interface of your Server, with more API calls is here: http://spicefly.com/index.php?option=com_c...3&Itemid=32

2. connect MIP via foo_run with foobar2000
Now go to foobar2000 open File/Preferences/Tools/Run Service
Set a new Service property like this:
Label: MIP Playlist
Path:
Code: [Select]
C:\Programme\foobar2000\foobar2000.exe http://localhost:10002/api/mix?artist=$replace(%artist%, ,+)&$replace(%artist%, ,+).m3u

Now you are ready to call a generated Playlist from MIP over http, when you rightclick on a title in foobar2000 and choose Run Service/MIP Playlist and the selected title will be used as seed to get an random playlist based on your "mood" however.
Short explain about the call: I call the standard listing for mix, which is similar to a m3u playlist - But foobar2000 cannot recorgnize this Location as Playlist: http://localhost:10002/api/mix?artist=your+artist, so I just add a fake parameter which makes this look like a playlist file: http://localhost:10002/api/mix?artist=your...ist&foo.m3u and voila, it works.

OK, this is a quick and dirty basic.
You can play with the MIP API and add/try out other parameters or use playlists as moods.
like this http://localhost:10002/api/mix?playlist=name||fullpath

Maybe this all is possible with Command Line options of MIP
http://www.musicip.com/mixer/commandline.jsp
http://www.musicip.com/mixer/mipprotocol.jsp
I didn't try this out, because I read about that just right now ^^

Ok, If you find out more, at example, how to choose more tracks as seed for MIP* or some customcalls for foo_run, let us know here.
I'm not so much in foobar2000 scripting stuff.
greetings marcus

*EDIT 1: APIcall for multiple artists as seed, should look like that: http://localhost:10002/api/mix?artist=arti...;artist=artist2
> http://forums.musicip.com/index.php?showtopic=1324
How can I make this work in foo_run?

Use MusicIP inside foobar2000

Reply #1
Worth noting that MusicIP Mixer is data-mining software which, IIRC sends details of your entire music collection to some marketing executives in California. Unlike foobar2000, MusicIP Mixer is not a "something for nothing" deal; the cost is your data.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

Use MusicIP inside foobar2000

Reply #2
Worth noting that MusicIP Mixer is data-mining software which, IIRC sends details of your entire music collection to some marketing executives in California. Unlike foobar2000, MusicIP Mixer is not a "something for nothing" deal; the cost is your data.

C.



I don't have any objective information about that musicIP data mining, but it looks more or less the same than audioscrobbler or discogs, no?

Use MusicIP inside foobar2000

Reply #3
musicip mixer is a playlist generator, which use some songs that you select from your analysed library, as seed for a mix of more or less similar "mooded" songs and you get back a playlist.
I like to use that program sometimes, because it brings up songs into my player which i nearly forgot to have them in my (CD) collection. (a random playlist of my entire collection would be the same, but not really)
To make this happen (generating playlist on "songmoods") musicip mixer analyse the audio (means how it sounds) and store that fingerprint in a database, online and local on your HD. That is because analysing the audiostructure for a song takes ca 80% of track playtime and if you add new tracks to your library, mip shows online if they still fingerprinted. and that is the point that carpman bring up. You send the data of your collection to someoneelse. (and that is similar of using last.fm, right).
to prevent sending data to MusicIP Online Service could be to set false proxy settings, so no connection is possible. MusicIP Mixer will analyse your data and it takes a long time, but no informations are exchanged. (That's my point of view, I am not 100% sure about that).

greetings m.

Use MusicIP inside foobar2000

Reply #4
Thanks muzack - I love MusicIP and use it alot for background listening on my Squeezebox along with the Spicefly.

i had to edit your Run Services properties to the following to get it to work:

Code: [Select]
"C:\Program Files\foobar2000\foobar2000.exe" [url=http://localhost:10002/api/mix?artist=$replace(%artist%]http://localhost:10002/api/mix?artist=$replace(%artist%[/url], ,+)&$replace(%artist%, ,+).m3u

After that it works a treat.

It would be nice if this could generate a new playlist rather than replacing the current one - I'll try and look into this myself when I have time.

Cheers.

Use MusicIP inside foobar2000

Reply #5
you added the quotes to the program path?
I think foobar.exe alone is enought...

anyway...
when I am right, your playlist problem is related to your settings.
check Preferences > General > Windows Shell Integration check Always send files to playlist: Default

That should work.

Oh and here are some more commands, I've played around:

This takes a special song as seed and not only an artist. I prefer this, because the selected tracks matches the mood of the seed track much more.
And I can change the @size parameter for playlist size.
Code: [Select]
D:\Programme\foobar2000\foobar2000.exe http://localhost:10002/api/mix?size=30&song=$replace(%_path%, ,+)&$replace(%artist%, ,+).m3u


This take an album as seed, with some parameters to play with (variety, style - take a look to API doc of MIP)
Code: [Select]
foobar2000.exe http://localhost:10002/api/mix?size=20&variety=1&style=200&album=$replace(%artist%, ,+)@@$replace(%album%, ,+)&foobar2000.m3u



I've found a limited way to select more than one seedsong (the default behaviour of the MIP Application) - but it's limited if your folders/filenames contains special chars. maybe someone find a way to solve that.
But first what I did:

I've wrote a cmd mip_song.cmd script and plce it in foobar2000 program folder:
Code: [Select]
@echo off
REM echo http://localhost:10002/api/mix?size=%1^&song=%2^&.m3u >> mip_song.txt
foobar2000.exe http://localhost:10002/api/mix?size=%1^&song=%2^&.m3u
REM pause

(the echo command was for debugging)

Then write in run_cmd Preferences the command and set the Simultaneous Runs Slider to Unlimited?! whatever higher than one.
Code: [Select]
mip_song.cmd 50 $replace(%_path%, ,+)

50 is the mix size you can change

Now (if you set Always send files to playlist: Default) you can select more songs in foobar2000 and run the command.
All playlists generated by each song will merged into one new Default Playlist.
Say you select 3 Seedsongs which generate a playlist with 50 Tracks you will get one new Default Playlist with 150 Entires in foobar.

As I said before, this method breaks on special file/foldernames. I found no way to convert chars like ( ) öüä etc.
cmd is very limited and it takes some time to found out that I need to escape "&" char in the query with "^&".
I thinked about writing a vbs script in hope this handles such specialchars in filenames/paths, but I stuck on this ugly scripting language. I had no idea how to do this... maybe some one else?

hope that helps a bit.
greetings m.



Use MusicIP inside foobar2000

Reply #6
Worth noting that MusicIP Mixer is data-mining software which, IIRC sends details of your entire music collection to some marketing executives in California. Unlike foobar2000, MusicIP Mixer is not a "something for nothing" deal; the cost is your data.


and that is the point that carpman bring up. You send the data of your collection to someoneelse. (and that is similar of using last.fm, right).

Yep, that's correct. The question you have to ask is why did CBS (owned by National Amusements) buy Last.fm?

Was it:
a) because they want you to have a better listening experience, or
b) because they want your data

These companies have a legal duty to profit their shareholders/investors, which means that such (data mining) ventures have to yield fiscal returns. Which in turn means that Last.fm users (via their preferences, passions, and whatever else  their data uncovers) are a commercially viable resource. Which in turn means that it's not really your data that is being mined, it's you. Which means the cost of using such services is the cost of selling yourself as a commodity in return for additional playlist functionality.

Please don't take this as an attack on your creative implimentation of MusicIP in foobar2000. However, I do think it's helpful to have a little context to actually weigh up the cost-benefit of using such services (Last.fm included).

C.

ps. If a mod thinks this is off-topic perhaps it should be split to a seperate thread entitled Audio Data Mining Services (the Costs and Benefits).

[EDIT: Typo]
PC = TAK + LossyWAV  ::  Portable = Opus (130)

Use MusicIP inside foobar2000

Reply #7
anyway...
when I am right, your playlist problem is related to your settings.
check Preferences > General > Windows Shell Integration check Always send files to playlist: Default

That should work.



Yep - that worked. Thanks.

 

Use MusicIP inside foobar2000

Reply #8
...

As I said before, this method breaks on special file/foldernames. I found no way to convert chars like ( ) öüä etc.
cmd is very limited and it takes some time to found out that I need to escape "&" char in the query with "^&".
I thinked about writing a vbs script in hope this handles such specialchars in filenames/paths, but I stuck on this ugly scripting language. I had no idea how to do this... maybe some one else?

hope that helps a bit.
greetings m.


Thanks for your help. I found a way to use special chars in filenames/path. I am still working on tweaking it. Short version:
- install wget for windows
- create a mip_song.cmd in your foobar dir. Make sure file file-encoding is ANSI.
add:
Code: [Select]
@echo off
wget http://computer:10002/api/mix?song=%1^&.m3u8 -O default.m3u8
addbom.exe default.m3u8
foobar2000.exe default.m3u8

- I could not find a tool that adds the UTF-8 BOM to a file without modifying characters (MS notepad would, but cannot be executed on a command line). So I created such a tool with AutoIt3. Compile the following script (addbom.au3) (as a command line application!):
Code: [Select]
If $CmdLine[0] = 0 Then
    ConsoleWrite("ADDBOM adds an UTF-8 byte order mark (BOM) at the beginning of an unmarked text file." & @CRLF & @CRLF)
    ConsoleWrite("Usage: ADDBOM <FILENAME>" & @CRLF)
Else
    $fileName = $CmdLine[1]
    If StringRegExp($fileName, '\w+') Then
        $fileRead = FileOpen($fileName, 16)
    ; Check if file opened for reading OK
        If $fileRead = -1 Then
            ConsoleWrite("Unable to open file for reading:" & $fileName & @CRLF)
        Else
            $chars = FileRead($fileRead)
        ; Read first Three bytes
            If BinaryLen($chars) >= 3 Then
                $start = BinaryMid($chars,1,3)
                If $start == '0xEFBBBF' Then
                    ConsoleWrite("Allready found BOM Signature. Exiting." & @CRLF)
                    FileClose($fileRead)
                    Exit
                EndIf
            EndIf
            FileClose($fileRead)
        ; Check if file opened for writing OK
            $fileWrite = FileOpen($fileName, 18)
            If $fileWrite = -1 Then
                ConsoleWrite("Unable to open file for writing:" & $fileName & @CRLF)
            Else                
                $bom = Binary("0xEFBBBF")
                If FileWrite($fileWrite,$bom) = 1 Then
                    ConsoleWrite("Succesfully wrote BOM (0xEFBBBF)." & @CRLF)
                Else
                    ConsoleWrite("Could not write BOM." & @CRLF)
                EndIf
                FileWrite($fileWrite,$chars)
            EndIf
            FileClose($fileWrite)
        EndIf
    Else
        ConsoleWrite("Invalid Filename." & @CRLF)
    EndIf
EndIf
Exit

- in Foobar execute the following command:
Code: [Select]
mip_song.cmd "%_path%"

If someone wants to know more details, then let me know.