
What is a music player? - phreeza
https://github.com/albertz/music-player/blob/master/WhatIsAMusicPlayer.md
======
jbk
Disclaimer: VLC main developer here.

I would love to tell you that VLC (or mplayer or xine or whatever-video-
engine) is great to play music, but it is not. And yet, a lot of person use
VLC to play music, to our own astonishment.

Therefore, we are working to make the audio part getting better, and we are
working hard on that part (next hackdays topic, in December, is only the audio
core).

However, except gapless and a correct media library (which we have but is not
activated), all the things listed from this article are done in VLC, including
resampling, equalizer, loudness, fingerprinting, software amplification... VLC
has also a compressor, a parametric equalizer, a spatializer, pitch
correction, scaletempo and many downmixers / headphones enhancers. We have
also Karaoke support...

Moreover, libswresample is far from being the best quality ever.

So, why don't we have gapless in VLC? Well, because to get correct gapless
(not the 50ms you can have with VLC) or cross-fading, you need to have 2
inputs at the same time. And this needs quite a bit of work, notably to be
sure to detect correctly EOF.

~~~
albertzeyer
Hey, the dev of this project here,

Thanks a lot for the feedback! I didn't knew that VLC has advanced so much in
such functionality like loudness normalization and dynamic range compression.
How does it analyze the loudness? Does it also use the ReplayGain spec? What
about album-loudness?

It sounds like besides gapless playback and a database, VLC already has
everything what a music player needs to have - or what you need that VLC
becomes great to play music.

Or is anything missing on the list?

For me, the intelligent automatic queue is, besides the audio quality, a very
important element (because it is the way I listen to my music).

~~~
dsirijus
Sorry for derailing the discussion, but what do you think of foobar3000?
Ideally, VLC guys would answer to this question too. :)

~~~
albertzeyer
Foobar2000 is proprietary and Windows-only (thus I cannot even try it).

~~~
Evbn
Wow, how is it even monetized? And if not, why bother with proprietary?

------
AndyKelley
Interesting emphasis on intelligent DJ mode. I have been using Groove Basin[1]
as my music player for about a year now and have loved the crap out of its DJ
mode ("Dynamic Mode").

The way we made it work is that every song goes into a list sorted by date
last queued, and then we use a parabolic curve which means that any song could
theoretically be queued next, but songs that have not been queued the longest
have the greatest chance of being queued next.

This is something that is hard to test without trying it out for a long period
of time, but I think after one year it is safe to say that it's a pretty damn
good algorithm.

The added benefit of using "last queued date" instead of "last played date" is
that if Dynamic Mode queues a song, and you skip it because you don't want to
hear it, it still moves to the end of the list and becomes less likely to be
queued again.

[1]: <https://github.com/superjoe30/groovebasin>

------
cientifico
Talking about the screenshots found in <https://github.com/albertz/music-
player>

* A music player should show the current song info like title or artist. There is no way to know which is the current song. * A music player should have a clear interface. * Where is the volume? * What is fillUpTo and why it doesn't have spaces? * What is addSome and why it doesn't have spaces? * Why a clear button? * Why the format, time, and more things is being show in the interface. I am a user. Don't worry about that details. * Why input boxes to show the time and current song. Can I change that? * ...

Sorry for not testing but since more than 3 years I was using spotify so I
just remove all my files.

~~~
albertzeyer
Oh, it seems that many things aren't that obvious as I thought they would
be... Maybe they become a bit more obvious when you use the player, though.

To answer some of the questions: The current song is always the blue entry.
All the grey entries above it are the recently played songs. Everything below
is what comes next. In addition, the artist and title of the current song is
displayed at the head. Those aren't input boxes (although they might look as
such). The clear button clears the queue. The volume is the slider on the
right.

But I agree: The GUI needs much improvement...

------
r080
My answer to that question is simply 'mplayer'. I organize my music in
folders. I use cd, find and others to navigate. I have never been happy with
players with databases - it somehow always gets in the way. I don't like
last.fm recommendations, due to the simple fact that I like as diverse music
as possible. I discover new music via radio. Mostly wfmu. For me, interesting
bit is information about resampling. Thank you for it.

~~~
randomchars
If you already have a diverse taste in music the last.fm recommendations will
be diverse too.

------
rmk2
I, personally, am very much in love with DeaDBeeF[1] on openSUSE. When I was
still using windows, I was using foobar and continued to do so in wine on
Linux. However, I _did_ want an open-source alternative that would integrate
better with my DE, so I had a look at deadbeef, which is foobar-ish. Highly
recommended, as it is by far the best of the lot for my needs, even
considering some of the bigger players out there, like Banshee, Amarok etc.

It ticks most of the boxes and supports plugins and DSPs, Bauer stereophonic-
to-binaural DSP[2] amongst others, and can be extended to suit pretty much
every need. :)

[1]: <http://deadbeef.sourceforge.net/>

[2]: <http://bs2b.sourceforge.net/>

------
conradfr
I still use Winamp. I particularly dislike using the same player for audio and
video as I would often pause one to play the other and don't like losing my
music playlist.

One thing I always wanted is for a playlist which have ended to start over if
I hit play instead of playing the last song again. Like a cd player would.
Never found a solution to that.

------
rheide
Killer features for me in a music player are global keyboard hotkeys that I
can use from inside other programs (or games), and a playlist queue that will
continue playing randomly inside the same playlist after it finished playing
the songs I've queued.

Foobar2000 is the player on Windows that I'm still in love with. You can run
Foobar on MacOS using Wine, and there's plugins that will use the foobar's
http control service to add global hotkeys on Mac.

~~~
antihero
Global hotkeys are easy if you have a decent command line client.

For instance, I can use xbindkeys to bind "mpc toggle" to my play/pause key.

------
pratyushmittal
One thing often missed is the default sorting order of the library. The
library should be sorted on date by default to show the new songs and albums
right on top (or atleast provide an option for it). Currently most of the
players sort the library in alphabetical order.

"Intelligent automatic queue" sounds great along with other features.

~~~
lhnz
I always assumed that because no music players seem to support this right out
of the box, that I must be the only person in the world who listens to my new
music before listening to my old stuff...

~~~
onli
I guess there now are two of you. I doubt there are many more.

Seriously: A completely different behaviour than normal which would lead to no
one finding the music they want to listen to (but finding newly added music
easily) should only be the default if you have enough usertests to confirm
that they want that. At least if your aim is that many people use your
software and not only you plus the two exceptions who like that too.

~~~
lhnz
Isn't it intuitive to you that music you have just been shared or have just
bought is the music you are both (a) unfamiliar with and (b) most likely to
want to listen to in the near future. My experience has been that being
unfamiliar with music will make it difficult to search for, and that after
being shared or buying something I go through a patch of listening to this
music more frequently.

Either way, I don't think I am one of two people, and I think the tone of your
last comment was very poor. As a rule: think first, then post.

~~~
onli
No, it is not intuitive. Or it is: Of course it can be helpful to have such a
view available. But having that as default order for a music-library(!) is not
intuitive at all. Especially not for people who don't even remember the last
time they added music to their collection.

I'm sorry if one could interpret my writing as poor tone. I indeed think that
only a very small minority of people would like that, but that is totally ok
and it was not meant as an attack. The point was that you have to determine
such things, find out wether your potential customers would like that, if you
are targeting people at all. If not, it doesn't matter.

>As a rule: think first, then post.

Spare me the bullshit. To say I didn't think before writing is a totally
unnecessary attack - I clearly made a legitimate point.

~~~
lhnz
>> I'm sorry if one could interpret my writing as poor tone.

Yeah, well, just because it's the internet and you can't see people's
reactions, it doesn't mean that it suddenly becomes acceptable to imply that
people are selfishly only thinking about their own user experience...

>> I indeed think that only a very small minority of people would like that
[...] The point was that you have to determine such things, find out wether
your potential customers would like that, if you are targeting people at all.
If not, it doesn't matter.

Right, well the problem here is that you haven't heeded your own advice.
You're sitting here telling me about "very small minorities" with no evidence
to back up your claims. And I tend to think: absence of evidence, intuition
should trounce mere opinion. (That said, I agree that if somebody hasn't added
music to their collection for a long time, a time-ordered view would make less
and less sense. I think that's intuitive, too.)

------
crb
Here's one I would like. Shuffle, but with an awareness of sets of songs that
should be played together. For example, if shuffle ever hits on "Brain Damage"
from Dark Side Of The Moon, it should always proceed to "Eclipse" before
resuming any other song. This could be achieved with an online database like
MusicBrainz - there was a Reddit thread recently which suggested another few
songs which are often played together.

Alternatively, a manual approach would be that if I hear a song I know should
segue into another, I'd like to be able to suspend shuffle and have it instead
pick up from the song that would generally follow that song in the track order
of the source album.

~~~
albertzeyer
In the intelligent queue algorithm, you could easily add such functionality.
Maybe I'll add that as an option later.

Code is here: <https://github.com/albertz/music-player/blob/master/queue.py>

Look at `MainQueue.calcScore` and others.

For the manual approach, maybe some button next to a song like "add follow-up
songs to this song below" would do (not sure how I would insert that into the
GUI, though).

------
Aardwolf
XMMS (for those using Windows: Winamp) is still the best music player out
there. Not XMMS2 or the slow Audacious though, and the newer Winamp versions
or skins also aren't that great anymore.

~~~
arketyp
I've never seen a GUI age so well as the Winamp classic skin. Even old Apple
OSes can look hideous today, but with Winamp I still find myself switching
back to the classic mode.

~~~
rplnt
Or you can use the Winamp Lite[1] which I think is almost identical to Winamp
2.x.

1\. <http://www.winamp.com/media-player/all> (on the bottom)

------
shocks
I like the bit where iTunes is a "professional music player". xD

Good post, interesting read. :)

~~~
albertzeyer
I would say iTunes is. They certainly have invested a lot into the core
playback engine of iTunes and its quality.

For example they have their own loudness analyzing specification called Sound
Check. A music player having its own loudness specification and analyzing
algorithm is very rare! Most players don't have support for analyzing at all
and if they do, they usually use the original mp3gain algorithm to calculate
the ReplayGain value (but as that one is GPL, this is only for GPL players).

The overall audio playback quality is quite good.

Also they have a lot of other advanced features.

E.g. the iTunes DJ mode is actually not so bad. The algorithm behind it works
quite good.

They also have a remote interface where users could vote for different songs
and the song with the highest votes will get played next.

------
wreckimnaked
What about MPD? Most of the describe features/requirements are already there.

~~~
albertzeyer
See here: <http://news.ycombinator.com/item?id=4772713>

Or directly here for a previous discussion:
[http://www.reddit.com/r/opensource/comments/1224ux/experimen...](http://www.reddit.com/r/opensource/comments/1224ux/experimental_partyshufflebased_music_player/c6shx4c?context=3)

Actually it lacks many of the most important features.

~~~
wreckimnaked
just read the reddit discussion. I'd say that MPD is more UNIX-y than your
approach for a music player; still I appreciate your effort to build well
defined requirements for your project

------
whit537
P.S. albertzeyer is on Gittip:

<https://www.gittip.com/albertz/>

and Flattr:

[http://flattr.com/thing/49143/Projects-artworks-writings-
of-...](http://flattr.com/thing/49143/Projects-artworks-writings-of-Albert-
Zeyer)

Consider supporting him financially, if you like his work.

------
antihero
Honestly I don't know why the author didn't go with the client/server model.
Running a music player as a daemon and having a client that connects is
awesome, and allows things like remote control (android apps, etc) to happen
much more easily.

In fact, why they didn't just use MPD escapes me.

~~~
albertzeyer
I had this discussion a while ago, in particular here:
[http://www.reddit.com/r/opensource/comments/1224ux/experimen...](http://www.reddit.com/r/opensource/comments/1224ux/experimental_partyshufflebased_music_player/c6shx4c?context=3)

MusicPlayer is already highly modular. Adding a server interface listening on
some TCP port is trivial at this point. Full control via an IPython shell or
just the console is already possible. (In the beginning, while it didn't had
any GUI, the IPython shell interface was how I used it.) There is nothing
really complicated in developing some remote control.

The way MusicPlayer manages the queue, i.e. the intelligent automatic main
queue is not trivial/straight-forward to emulate in MPD and it would be hacky
- that is the first and main reason I didn't used MPD. Then, using MPD
wouldn't really have made it simpler, only more complicated. Forking MPD
itself and extending/changing it in the way I intended would maybe have been a
solution but I thought it would be simpler to just code the player engine from
scratch. Despite that, MPD does not support many of the current features of
MusicPlayer, like the builtin loudness analyzing algorithm, etc.

------
hnriot
Increasingly for me the music player is the browser. I don't know which
library is used when a browser plays audio, but where once I was protective of
my music collection, now I find the web playback through pandora and
grooveshark to be far more frequently used. For the next generation, my
daughter only knows youtube as a music player; the separation of music from
video seems to be a concept only readily grokked by those currently over the
age of 12.

------
pippy
I love his in depth passion for the quality of his music, though the
application UI is suffering from some "programmeritus". Nitpicking: tt should
have the song name as its title, "addSome" button should be removed and
replaced with drag and drop, you probably don't really need the wave form and
the time field looks like and input field. I'm a big fan of foobar for the
reason its interface is simple and clean.

~~~
Nick_C
> "addSome" button should be removed and replaced with drag and drop

Please, no. Some of us don't use desktops and don't want drag-n-drop
dependencies. (I know this is currently built for Cocoa, but the project's
goal is cross-platform.)

------
louischatriot
Very interesting explanation, I knew playing media files wasn't a trivial task
but didn't imagine there was so much going on behind the scenes.

------
jamesrcole
Nice article. I like these kinds of explanations that go into all of the
difficulties of a task that aren't obvious from the outside.

------
Derbasti
Can't get it to work on OS X. The provided app bundle does start, open the
Last.fm website, then does nothing. No window, no dock dropping, no
(meaningful) menu bar.

------
lmm
Just delegating to ffmpeg fails with many TTA files, so I'll be sticking with
VLC for now.

