
Show HN: Nighthawk: A stealthy, simple, unobtrusive music player - quantummkv
https://github.com/quantumkv/nighthawk
======
tambourine_man
As a developer I completely understand the appeal of Electron. I love web
technologies and targeting 3 platforms at once is amazing.

As a user, I simply won’t accept it. Platform integration is suboptimal at
best and resource usage is preposterous.

If this is the future of desktop software, and it seems like it is, we have
got to find a better solution.

There has to be a way to share the rendering engine and Node process among the
many Electron apps that are proliferating on the user’s machine.

~~~
jbergens
The rendering engine in Windows is accessible. It has not been as advanced as
V8 but it is getting better and that means you can, or will soon be able to,
create an app with html+css+js and run it on Windows without downloading a
full engine.

For the more common solutions I think computers already have enough memory to
handle this. The boot time is a bit too long but if each app uses 200-300 MB
does not mean _that_ much when the computers have 8 GB or more.

~~~
roryisok
> you can, or will soon be able to, create an app with html+css+js and run it
> on Windows without downloading a full engine.

Actually this functionality has existed on windows for about 15 years or more.

[https://msdn.microsoft.com/en-
us/library/ms536496(v=vs.85).a...](https://msdn.microsoft.com/en-
us/library/ms536496\(v=vs.85\).aspx)

HTAs, or HTML applications, almost forgotten, have been available as far back
as xp and possibly windows 98. They still work in windows 10, though they only
support html4 and very limited JavaScript, and obviously aren't cross platform
like electron.

Microsoft saw the potential in html for building apps way back in the late
90s. You used to be able to use html as a wallpaper back in windows 98,
something I dearly miss.

It's also worth pointing out that uwp / windows store apps can be built in
html/js, which are very small to distribute and use a global rendering engine

~~~
tambourine_man
Yeah, the more I think about it, the more it seems like Apple's neglect is
responsible for Electron's success.

If they exposed Webkit and JavaScriptCore in a friendlier way, things could be
different.

------
roryisok
I'm typically the defender of electron on these threads. I think its a great
way for devs to get an MVP out there quickly. But there is a time and a place
for electron.

 _electron good_ \- IDEs, markdown editors, visual git clients, things that
are front and center

 _electron bad_ \- music players, tray notifiers, app launchers, things that
work in the background

On windows and mac I use foobar for music and greenshot for screen grabs
because they use minimal resources.

~~~
quantummkv
The main reason I went with electron is that fantastic system tray
integration. System tray integration with the native .Net is an unholy mess.
The windows 10 UWP apps do not have a way to integrate with the taskbar. WPF
requires interop with win32 code or a half baked 10 year old depreciated
WinForms component.

And none of the native solutions allow me to shape and design the UI like I
want to without compromises.

Electron may not the best in every aspect. But it was the only sensible and
feasible choice for what I wanted my app to behave like.

For me, a small performance hit is justified for being able to make _exactly_
what I want.

~~~
roryisok
I'm going to try your app, despite my post, because I also believe in giving
things a chance and leaving my mind open to change.

~~~
roryisok
I have tried nighthawk, and though it shows promise it needs a little work.
Settings is not an obvious place to add music from and when I did add my music
folder it didn't seem to look in any subfolders I had.

I was quite surprised by the CPU and memory usage though. Surprisingly lean. I
ran a bunch of music players along side it and it averaged the same memory and
CPU as colibri, vlc, foobar, and swinsian. Clementine stood out from the pack
as an absolute hog, burning up my desk with 33% cpu usage, where nighthawk and
the others stayed below 1% most of the time.

That's pretty impressive performance.

------
anotherevan
I'll stick with [https://www.clementine-player.org/](https://www.clementine-
player.org/)

~~~
themodelplumber
My needs are simple...
[http://qmmp.ylsoftware.com/](http://qmmp.ylsoftware.com/)

(Need 1: Player must remind me of WinAMP)

~~~
mrweasel
The WinAmp interface is fantastic, most other media players simply take up to
much screen space. Everyone seems to build iTunes like clients and media
library managers. My files are already managed just the way I like them, in
folders, there's no need for additional management.

~~~
KozmoNau7
I like having a solid tagging scheme. I don't go deep into subgenres, re-
release dates and all that jazz. But having an easy filter mechanism to select
music that can have multiple tags for a particular category is very handy.
That doesn't work so well with folders, unless you go mad with symlinks
everywhere.

------
zabana
I see a lot of negative comments on these electron threads (rightfully so,
especially if one cares about resources / performance). Question is: what
other frameworks would you recommend for developing cross-platform desktop
apps ?

~~~
ms013
I don’t have a good answer to the framework question, but I do have an opinion
about cross-platform. Why make cross-platform a priority over efficiency and
user experience? I bounce between Mac and Windows daily, and my least favorite
apps are those that try to run on both. They are often resource hogs and
provide a UI experience that feels worse than native apps. Electron apps have
the least bad UI experience, but are resource hogs. One app I use for work,
Mendeley, uses Qt for its UI I believe, and it’s garbage on both platforms- so
I use the web interface instead. Give me a good native app instead of a
suboptimal cross platform one.

I often think the issue isn’t cross platform though: it’s that there is a
cohort of developers who know a toolchain (JS+web), and use frameworks that
let them live in that instead of investing the time and effort to learn how to
write an app well using a toolchain not built for those focused on web/browser
models of programming.

~~~
iaml
Electron does not magically make your app work like shit - if you treat it
like any other framework and actually invest resources into architecture and
optimization it (surprise!) results in a good software, eg: vs code. Problem
is it also allows to disregard all that and quickly prototype a solution that
works good enough for some, and forget about all the optimization. That's real
problem, but it's not tied in any way to electron. Same people would go and
make a shitty app in qt if there was no electron, or just wouldn't make
anything.

------
Something1234
Has anyone else tried deadbeef? It's one of the lightest players I've ever
used. It's very bare bones.

[http://deadbeef.sourceforge.net/](http://deadbeef.sourceforge.net/)

~~~
snovv_crash
Don't forget Billy, from back in the day:

[https://www.albinoblacksheep.com/download/billy](https://www.albinoblacksheep.com/download/billy)

~~~
signa11
or cmus ([https://cmus.github.io/](https://cmus.github.io/)) for that matter.

------
cift
Something something electron bad

~~~
designcode
One of it's key features listed is 'Highly Efficient.'

~~~
bestnameever
I saw that too...How can something using Electron be highly efficient? Maybe
they are talking about the interface and not the system resources the app
uses.

~~~
wst_
Clementine doesn't use Electron and consumes more of my memory and UI is ugly.
Before we start talking about resources maybe we should compare other music
players on the market.

~~~
catach
The observation that there's a music player resource tax just makes me less
inclined to combine it with the Electron tax.

~~~
jchw
There isn't really one inherently; a music player like foobar2000 only takes a
few MB of memory even with many plugins. That doesn't mean Clementine and
Winamp haven't found ways to waste resources that aren't loading a full
Chromium instance (after all, Chromium is pretty efficient considering what it
actually brings to the table.)

------
dmitrygr
WinAmp can hide in the tray too, and uses 3 (!!) orders of magnitude less RAM
than this. I know it is not new and shiny, but it still works well.

------
gilmi
Nighthawk looks very nice!

However, I found out that for me tui is where it's at for music players. Using
cmus combined with a drop down terminal such as tilda or a tiling windows
manager is the most comfortable i've been with music players.

------
giorgosts
You can't throw folders with subfolders at it to make a playlist out of them.
The music files have to be in the same folder. Where's the unobtrusive in that
if I have to create my playlist first?

~~~
quantummkv
Thanks for pointing that out. I tend to curate my library as a playlist itself
without sub-folders so I never gave a thought to it. I am working on a
playlist system after all the feedback i got. Will definitely look into the
sub-folders way.

Oh, and unobtrusive is for the fact that the player stays completely in the
background without a single notification or interruption to your work.

------
v-yadli
hey is anyone interested in building a modern frontend for Foobar2000?

edit:

I think from the Foobar2000 sdk alone, you'd see how advanced that thing is..
I mean, extension points everywhere, dsp plugin support, built-in query &
library management, codecs, gapless processing, all of that written in a
scalable & native architecture.

It truly lacks a proper UI toolkit though. The current options are quite
outdated that I'd rather fall back to the default Win32 UI.

So, Electron frontend + C/S communication with Foobar2000? I'd totally buy
into it.

~~~
quantummkv
Internally, both foobar2000 and Chrome/Electron use ffmpeg for audio
processing and codec support. The web audio api allows for writing all sorts
of equalizers and audio processing effects.

Extensions and query and library management can be coded in JS easily, like
VSCode, Hyper and others do.

Electron frontend communicating with foobar2000 sdk for every little
interaction will lead to a huge mess of performance and latency issues. It's
better to rebuild the whole thing in electron instead.

~~~
v-yadli
> both foobar2000 and Chrome/Electron use ffmpeg for audio processing and
> codec support

not quite true. for example, the ZXTune plugin brings support for a dozen of
chiptune formats which is obviously out of scope of ffmpeg. It'll be possible
to incorporate webaudio api for codec but that's a resource hog. Also if
you're doing decoding work and the GC jitters, you're going to run out of
audio buffer (stuttering). If we take one step back and rely on some audio
playback API, then gapless play and other issues would be difficult to deal
with.

> The web audio api allows for writing all sorts of equalizers and audio
> processing effects.

maybe, but that's reinventing the wheel. foobar2000 supports VST plugins, the
professional tools used in the audio production industry. there are a few dsp
components for webaudio but that's far from satisfactory.

> Extensions and query and library management can be coded in JS easily, like
> VSCode, Hyper and others do.

Yes I agree. That way we can make a neat package manager for an audio system.
Some Digital Audio Workstations(DAW) have already begun to move this way
(Bitwig Studio etc.)

> for every little interaction will lead to a huge mess of performance and
> latency issues.

Not quite sure.. Think about how NeoVim is built. But my concern is that,
foobar2000 is not built for tightly interacting with a frontend, so yeah,
better rebuild a native audio core, and use a modern communication protocol
(msgpack maybe?) to do the roundtripping. But again, that protocol could be
implemented as a foobar2000 plugin...

The downside of using foobar2000 is also obvious. It's close sourced and Win32
dependent. So I'd think about this:

```

Electron frontend <\-- msgpack --> Native audio core <\--> JackAudio, RtAudio
or alike, whatever that bypasses the middleware and directly access the
hardware audio buffer

```

------
dvfjsdhgfv
> Finally after months of development, procrastination and a complete rewrite,
> the First stable release is out

It's a good occasion to change the "Hello world" window title.

------
antihero
Is there a subsonic interface/client that integrates nicely natively? Having
to have it in a browser tab and not having music hotkeys is kind of a bitch.

------
Dolores12
I just tried it and compared with Winamp 5.666 - 10mb download, 14mb memory
footprint.

------
rootlocus
It doesn't seem to work with flac and wav files. Tried on windows.

~~~
quantummkv
It currently only works with mp3, wma and ogg files. Flac had some codec
issues when I checked it in the beginning. Might have changed as I recall
chrome having done something in this regard.

Will definitely check if the new versions of electron support it. If it does
support flac, I'll get it working on the next release.

------
johnwheeler
gorgeous UI

------
Rjevski
> Unobtrusive

Well besides eating half your RAM and melting down your battery.

