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: 1 instance, 2 outputs - Why we need it (Read 3900 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

1 instance, 2 outputs - Why we need it

Hi everybody,

This is one of the long-missed features of foobar : to be able, with one single instance of foobar, to assign 2 components (e.g. playlist viewer 1 and 2) or 2 playlists (e.g. playlist 1 and 2) to 2 different audio outputs (e.g. soundcard and headphones).

Of course I'm talking about prelistening purposes, but NOT necessarily in a DJing environment. For example sometimes me and a group of friends host listening sessions at each other's homes, where the host picks music for the others to listen and comment. During these sessions, the host would like to prelisten to the next track, to decide if it will fit nicely after the previous one or if he'd better pick another one. That looks like a reasonable request, right ?

Right now to achieve prelistening I'm using two portable instances of foobar with different audio outputs. It works fine, but since the instances and the playlists are different it gives me a lot of work. For example :
- I'm playing song A on instance 1 of foobar
- I want to prelisten to song B which is in the same playlist (maybe the next one, maybe not)
- I need to go to instance 2, then find song B in all music, since the playlist isn't shared between instance 1 and instance 2
- Then I can prelisten to song B
- Then I have to go back to instance 1 and eventually change song B order in the playlist

You could answer me to go with some DJing software, although that would clearly be overkill for my purposes (I don't need 99% of their features, only prelistening). Just know that I've already tried about every DJing softwre on the market (Virtual DJ, Traktor, Serato, Rekordbox, DiscoXT, you name it). None of them even comes close to foobar in music management / custom tag handling, etc.. And if I can't even handle all my custom tags and filter my music accordingly, they're useless to me.

Or maybe there is another foobar-like software with multiple output support. Any suggestions ?

Personally I'd love to stick with foobar. I'm just missing some functionality like this "multiple outputs" thing. And I think it's more realistic to hope that foobar will one day have "multiple output support", than to hope that any DJ software will start handling custom tags like foobar does so well. Don't you think so ?


Re: 1 instance, 2 outputs - Why we need it

Reply #2
I suppose drag/dropping files between 2 instances is far too simple?

Instance 1, output permanently set to speakers. Start with blank playlist and add a track. Start playing.

Instance 2. Myriads of playlists, library viewers, whatever. outputs to headphones. Preview tracks on headphones. Drag it directly to instance 1 and insert it after the currently playing track. Rinse and repeat. Added bonus is that instance 1 keeps a history of everything you've listened to.

Re: 1 instance, 2 outputs - Why we need it

Reply #3
Right click item (or make a hotkey)

Run Services
Play to instance2 (set to headphones output)

command
instance2.exe "%path%"


Re: 1 instance, 2 outputs - Why we need it

Reply #4
@marc2003 : you obviously haven't tried much drag/drop between instances, especially with a laptop and a trackpad. FYI by doing so you have a substancial chance of :
- Accidentally playing the song you're trying to drag/drop (thus interrupting the currently playing song - belive me, I've tried)
- Accidentally altering foobar layout (e.g. columns/components width - believe me, I've been there too)

I appreciate the intent, but in my case it's like telling me "foobar is a perfect swiss-army knife, so just use the existing 'fork' attachment to eat your soup, rather than asking for a new 'spoon' attachment. With a little practice you'll get used to it". It's typical of some foobar power users in these forums : "try by all means to find a workaround to the asked question with existing means, rather than resorting to any new coding. Nevermind if such coding could result in a much cleaner result, because why improve foobar since it's already perfect, right ?" :D Now I agree that in some cases the workarounds can be an acceptable solution. But in other cases they don't, sorry.

@zeremy : thanks, I've installed foo_run and created a new service "Prelisten Track", with the following path : C:\Program Files (x86)\foobar2000 (instance 2)\foobar2000.exe "%path%" . Right now it doesn't work. What am I doing wrong ?

Re: 1 instance, 2 outputs - Why we need it

Reply #5

@zeremy : thanks, I've installed foo_run and right-clicked on a file. I see the "Run service" context menu, with the following options : Open Directory / Explore Directory / OpenAs... / No link available / Google Artist / Google Artist + Title / AllMusic Artist / AllMusic Album / AllMusic Song. I don't see where I could enter a custom command and select the "Play to instance2" option. Any hints ?

From foobar2000 menu.

File > Preferences >  Tools > Run Services.

Press Add Button

Label
Play to instance2

Path
instance2.exe "%path%"

Re: 1 instance, 2 outputs - Why we need it

Reply #6
I appreciate the intent, but in my case it's like telling me "foobar is a perfect swiss-army knife, so just use the existing 'fork' attachment to eat your soup, rather than asking for a new 'spoon' attachment. With a little practice you'll get used to it". It's typical of some foobar power users in these forums

What the fuck are you dribbling on about? Who knew using a mouse was "power" usage.... :/

One more idiot to put on the ignore list.

Re: 1 instance, 2 outputs - Why we need it

Reply #7
"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" "%path%"

Re: 1 instance, 2 outputs - Why we need it

Reply #8
@marc2003 : so now you're cursing and insulting me ? I haven't insulted you, I've only said things that happen to be right. Maybe you're having a bad day, but you should definitely apologize. I appreciate your long-term contributions to foobar like everybody else, but that doesn't give you the right to behave like a(n) [put here what you want, I'm too polite for that]. So now please behave. Thank you.
BTW I didn't know that foobar's requirements included the use of a mouse. Could somebody add that ? "The use of a mouse is MANDATORY for foobar2000, because @marc2003 said so". Thanks.

@zeremy : thanks, you noticed that I was editing my post while you were typing your answer. ;) Anyway, it doesn't work. Here's a screen cap (see attached file). Selecting the "Run Service > Prelisten Track" option just results in nothing happening... :(

Re: 1 instance, 2 outputs - Why we need it

Reply #9
If I want to be more specific, ideally I would need a foo_run command tnat would :
- Send the currently selected song to instance 2 (path in my previous image),
- [Option] Add it at the end of an existing playlist (even if that playlist is not selected in instance 2),
- Start playing it immediataly.

Can this be achieved ? How ? Thanks.

Re: 1 instance, 2 outputs - Why we need it

Reply #10
You should only have one standard installation.
Your main installation (instance1) can be a standard installation.
Your preview installation (instance2) should be a portable installation not a standard installation.

These is no need for instance2 to be in Program Files (x86) folder , but if you want to do it , in your path use the example as I posted.

"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" "%path%"

with ' ' around parenthesis () and enclose with  " " if you have spaces in the path.

To add to end of playlist use
"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" /add "%path%"

edit:
foobar2000 console will report any error.

Re: 1 instance, 2 outputs - Why we need it

Reply #11
Thanks @zeremy ! Finally making some progress here :)
- Good news : the syntax with the ' ' around parenthesis and /add works ! The selected song gets added to the end of playlist in instance 2.
- Bad news : it doesn't start playing automatically. Why ?
Console doesn't report any errors.

For the record, I have 3 foobar installations, but AFAIK all 3 are portable installations. I don't know if that changes anything.

[Bonus Question] Once we can get it to play automatically, coud it be possible with the same shortcut key to make it Play/Pause  ?
- First press = send the selected song to instance 2 + play it,
- Second press = pause,
- Third press = resume playing, and so on.
All that without leaving instance 1.
I suppose this could be achieved with two separate shortcut keys, but it would be more ergonomic with only one, right ? ;)


Re: 1 instance, 2 outputs - Why we need it

Reply #13
We're almost there @zeremy , but not there yet unfortunately :)

Here's the command lines I have tried :
"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" /add /play "%path%"
"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" /add "%path%" /play
"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" "%path%" /add /play
(all the same apparently, order makes no difference)

Step 1 : Let's say I "Prelisten Track" for Track 1
=> Result : Track 1 gets sent to instance 2, but it doesn't start playing

Step 2 : I "Prelisten Track" for Track 2
=> Result : Track 2 gets sent to instance 2, right after Track 1, AND Track 1 starts playing ! Yes, Track 1 ! :o

Step 3 : I "Prelisten Track" for Track 3
=> Result : Track 3 gets sent to instance 2, right after Track 1 and Track 2, AND Track 1 starts playing again ! It's like %path% was always pointing to Track 1.

Console shows absolutely nothing...

Re: 1 instance, 2 outputs - Why we need it

Reply #14
Try this

"C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" /add /immediate /command:play "%path%"

Re: 1 instance, 2 outputs - Why we need it

Reply #15
Yes ! A new progress ! :D Now here's what's happening :

Step 1 : Let's say I "Prelisten Track" for Track 1
=> Result : Track 1 gets sent to instance 2, AND it does start playing immediately :D

Step 2 : I "Prelisten Track" for Track 2 while Track 1 is playing
=> Result : Track 2 gets sent to instance 2, right after Track 1, AND Track 1 starts playing again !

Step 3 : I "Prelisten Track" for Track 3
=> Result : Track 3 gets sent to instance 2, right after Track 1 and Track 2, AND Track 1 starts playing again !

I don't know : maybe /command:play causes instance 2 to play its playlist from the beginning each time, instead of playing the last song added ?
PS : if I delete the "/add" part it doesn't change anything (songs still get added to the relevant playlist), so I don't see its point...

Re: 1 instance, 2 outputs - Why we need it

Reply #16
In instance2 from the Playback menu enable

Playback follows cursor
and
Cursor follows playback

 ;)

 

Re: 1 instance, 2 outputs - Why we need it

Reply #17
How could I have forgotten that ? Thanks @zeremy for sticking with me : it sort of works now ! :D Not 100% of the time, but most of the time, which is pretty OK.
Most of the time "Prelisten Track" works, and sometimes it results in adding the song but playing the previous song again, so I have to "Prelisten Track" a second time to make it work.
Anyway, it's pretty OK as a workaround for the moment.

That being said, I hope I have also proved my point, which is still that foobar2000 would clearly benefit from the "1 instance, 2 outputs" feature. Everything we've been doing in this very topic has only been a workaround, a fix for a missing feature in foobar. And what have we done to make it "sort of work" ? Create a 2nd instance, install an additional component (foo_run), script it, assign key shortcuts, and hope it works reliably. Which it does... most of the time.

If foobar allowed for 2 outputs, we could assign output 1 to playlist 1 (or playlist component 1), output 2 to playlist 2 (or playlist component 2), and easily play tracks just by double-clicking on them, without all of this complicated stuff. :) Is it really too much to ask, that some forum mod/admin sees this topic and adds this to the Requested Features List ?... :( An advanced player such as foobar should definitely allow users to assign 2 outputs to 2 playlists (or playlist components). Why wouldn't it ? Because some guru has decided that it wasn't necessary, when at the same time users like me are consistently looking for it ? (I have found many past topics on this issue already, on HA and elsewhere).

And nevermind what @marc2003 says, he's a power user who has forgotten what it is to be on the regular users side. ;) Ease of use should be at foobar's core, and when we need to go through all this stuff only to "sort of" achieve dual output, well, that's not what I would call ease of use. Voilà, the defense rests. ;)

Re: 1 instance, 2 outputs - Why we need it

Reply #18
Additional feedback : actually the given command ( "C:\Program Files '('x86')'\foobar2000 '('instance 2')'\foobar2000.exe" /add /immediate /command:play "%path%" ) doesn't work completely when instance 2 of foobar isn't launched yet : it launches instance 2, it adds the song to the playlist, but it never starts playing it. Seems to be 100% reproducible. Any hints ?