Hacker News new | past | comments | ask | show | jobs | submit login
Generative.fm – Endlessly unique ambient music (generative.fm)
735 points by dmit 37 days ago | hide | past | web | favorite | 102 comments

Hey folks, I'm the creator of the site and the music on it. I'm happy people are enjoying the music.

I see some people are having a rough time on mobile devices so I wanted to help with that. I have found that iOS Safari will mute the site if you have your iPhone in silent mode (there might be a way for me to fix this but I haven't explored it much yet). However, you'll probably find that many of the pieces snap crackle and pop a bit on mobile devices. I'm looking into ways to improve that but for now unfortunately the best advice I have is to try it on your desktop or laptop or to try some of the less complex pieces towards the end of the list. I really appreciate the feedback; I've only done so much testing with the devices I have available so hearing from more people with a larger range of devices is super helpful. Feel free to open issues on Github as well: https://github.com/generative-music/generative.fm/issues

I just left a top-level comment, but this is an old topic now so I don't know if you'll see it -- I wanted to thank you for making this and releasing it for free; it really helped me to find the kind of calm concentration that usually eludes me.

You're very welcome, I'm glad you're enjoying the music and thank you for commenting. I'm excited some people are offering to pay for the site but I intend to keep all of the music free so as many people can enjoy it as possible. I also like to listen when I need to concentrate. That's really the reason I made the site, so I have something to listen to while I work.

You could keep the site free while still allowing people to pay for it if they want to.

(A service like Liberapay might make this easy for you to do.)

This is fantastic. I love that it is a progressive web app. It would be nice to have a feature to populate the cache in one tap, so I can take it with me in the underground without having to play each song first.

Really nice design, was there any inspiration? I would like to use something like those squares to illustrate an ebook.

Thanks, I have to admit I really just ripped off Google Play Music's interface. The square icons were inspired by the album art for Ryuichi Sakamoto and Alva Noto's "Virus" series of albums. I made a program which generates them for me. The way it works is to split the square into squares, rectangles, and triangles, and then randomly choose which to stroke and fill.

This sounds really interesting. However if you do want to distribute this widely, I would check if they have any patents on their devices because stupid American IP laws.

Thanks! Your reply is much appreciated.

Does everyone hear the same unique piece or is the generator client side and random per device?

It is generated client side, so each time you click play the music will be unique to that performance.

Any thoughts about making the client-side "seed" saveable?

Would love to be able to save/replay/share sections that I really enjoyed (e.g. bookmark the seed(s) + offset/range).

Do you have any plan to make this works as a progressive web app? Would really enjoy having this on my phone, and optionally have it works while offline (with cached files, etc).

Thanks for this, I've been using it since yesterday :)

Thanks, glad you like it! Have you tried using it offline? It should already work as you described, though I have to admit I've only tested in Chrome. The caveat is that you can only play songs offline if they were played online once before. I realize none of this information is communicated in the app, I need to do a better job of that.

Really loving it. I think on iOS it’s possible to have a Safari tab keep playing audio in the background. listentothe.cloud at least does this. With your site, audio stops as soon as I close Safari.

As stated in other comments, if this was an app (in my Mac menu bar and/or on my iPhone) this would be the quickest $3-5/month I’d spend.

This is a fantastic piece of software. I’ll use it a lot while programming. The generated performances are great.

Thanks for explaining how to make it work on iPhone. Adding a notice message for iPhone users to disable silent mode on their phone would be good since I would have never guessed.

Agreed, I'll either be fixing it or including some explanation in the next release. Thanks!

Cool! Love the music btw, awesome work!

Is there a meaning to the colors and shapes in each the rectangles?

Interesting project, enjoying it a lot!

Came here just to say how clear your website is. The music itself is great - been listening for quite a while. Thanks for this.

Great job. I'd pay $5 a month for this.

Great stuff. Look into Fourier transformation / inverse Fourier transformations and clipping to remove the crackling sound.

Can you elaborate? Why would a transform be needed only on mobile devices? Why wouldn't the OS handle whatever's needed to produce audio in a platform-agnostic way, especially on the web? Very interested to know more.

I suspect the commenter meant that when the buffer runs empty because the device can't compute new samples quickly enough, the last seen power spectrum (power versus frequency) is briefly maintained in the output. This filler is computed by a cheaper process.

The crackling is probably due to missed buffers. Additional processing of the sound would likely only serve to exacerbate the problem.

This is wonderful! Thank you

A heads up. Your site seems to be fingerprinting my device through audio (firefox addin for audio fingerprint blocking).

Have you confirmed that the add-on doesn't simply trigger if a website uses the WebAudio API? All fingerprinting techniques also have legitimate applications. If they could be reliably distinguished from non-malicious uses, browsers would have blocked them long ago.

So a website designed to play sound is accessing your sound information?

...yes, otherwise, how would it play sound?

I'm a big fan of procedural/generative music, and have created some of my own. I tend to take a very different approach from Alex, embracing determinism rather than infinite variations, trying to make something more musically complex rather than ambient. If you're interested, the most recent piece I've made is here, accompanied by a visualization of what's happening and a detailed writeup explaining how the system works: http://ivanish.ca/diminished-fifth/

This is very cool!

Some things were broken for me(On Firefox 65.0.1, Ubuntu 18.04):

* Pause button doesn't immediately pause, the current note(?) ends over a period of time before pausing

* Fullscreen, and a few other buttons don't work. Also, I can't tell if my mouse click even registered on the button

Very interesting project nonetheless, and the music generated is quite nice to listen to. I particularly like how well placed the silences are. The percussion does need some tuning, like you've mentioned.

Thanks for that feedback!

The pause button is actually an interesting design decision. The way it works currently allows the system act more like a physical instrument — if you hit a bell three times and then stop, the bell keeps ringing. This has some utility when the piece is being used in a public setting, or when being accompanied by human musicians playing live. That's why there's a mute button. Though you raise a good point. For the web, I should probably change that so it's in keeping with digital expectations, and pause the sound as well as the performance.

Simple, but pleasant. This is how it starts. It might take some time, but I think most ambient music in video games will eventually be procedural.

EDIT: Just want to say that these are better than I expected. As good or better than about half the ambient music recommendations I get on Spotify.

A lot of (or most) music in video games already is procedural.

• Disasterpeace's most famous soundtracks all incorporated some measure of procedural music happening at runtime — Fez, Hyper Light Drifter, The Floor Is Jelly, Mini Metro... this ranged from simple mixtures of tones and textures at random intervals to very advanced, tightly integrated (re-) composition systems.

• Most games will dynamically mix different "stems" together based on the action in the game. Amon Tobin's soundtrack to Splinter Cell: Chaos Theory is a great example of this, but it happens in pretty much every AAA game now (and most indies, if not something more ambitious like the above). Another great example was Banjo-Kazooie on the N64. In simpler cases there are 3 or 4 different variations of each piece of music, but it's not uncommon to find a game with many more. Couple that with Fmod to apply filters at runtime (like a lowpass when diving underwater) and you have a very lively, dynamic soundtrack that adapts to the gameplay.

I could list a ton more examples, but that'd be tiring. A key point is that while this music is procedural, it's not generative. In other words, while it's common to find games where existing music is remixed dynamically, you rarely find games where the music is being composed on the fly.

Another interesting aspect to consider is the relative rarity of generative or procedural sound effects. Most sound effects are played back as-recorded, with perhaps some Fmod filtering. Mario Odyssey one-upped this by playing different sound effects depending on the moment-to-moment chord changes in the music, so that the sound effects would harmonize and "play along" with the music — to beautiful effect. But rare is the game that fully dynamically generates sound effects at runtime.

What I want is this for driving. Empty twisty roads? Play exciting music. Dangerous turns ahead? Add up the tension so the driver slows down. Traffic? Play something soothing...

Very insightful comment, thanks!

Background music in games has had weird dynamic elements for decades. Lucas Arts adventures that used iMUSE occasionally had variants of tracks that they would blend between. Early versions that relied on MIDI hardware could also incorporate tempo changes anywhere in the track in sync with the on screen transitions. The graveyard in Monkey Island 2 is a good example: it has one track that shifts its mood slightly between screens.

A more generative example is the music in Portal 2. There are several aspects to its music that are subtle, purely generative and integrated with the gameplay. For example, the each receiver for the laser beams start playing an additional, random voice over the background music track as long as it is hit by a ray. It is a bit faint, bit it is there. It becomes cool in those levels where you have several of them next to each other They are starting to play a randomized concert while you are solving the puzzle. Someome made a long and elaborate writeup about this and other aspects of the game's music, but I can find it now.

It is a but funny because games shifted away from using sound synthesis amd sampling for music to studio recorded tracks over time as they started to have enough storage space for it. But this now limits how you can process the music to make it dynamic.

This is also what Brian Eno did for Spore. If I'm not mistaken you could configure the parameters of the music yourself from an in-game menu.

Yeah, the first thing I thought of when seeing this was video game BGM. Ideally you would want some way to smoothly change the parameters over time as the player moves from one zone to the next, although you could probably cheat it pretty well just by having a separate track for each zone and cross-fading between them.

This was supposedly something that No Man's Sky was doing, was it not?

Yes, their sound designer Paul Weir did a GDC talk on the sound engine that they built for the game. It included things like procedural riffs on an existing non-procedural soundtrack, advanced spatial SFX, and had a demo of the engine in action.

Edit: here's the talk: https://www.youtube.com/watch?v=zKJ_XuQjjiw

And Monkey Island 2—though that wasn’t generated, it was just a large pile of musical glue that let the music flow from one area to the next.

We did a similar thing with System Shock 2 for ambient sounds/music. We had zone triggers which fed into a DSL for queuing up/randomizing/looping audio segments. I built the runtime on top of an existing virtual-machine style audio playback system which had been developed for flight sims, where it was used to stitch together voices for ground control. I was a fairly junior dev at the time, and IIRC I was not able to implement the requested cross-fading feature in time to ship. Fortunately, the silence between tracks worked pretty well with the desired atmospheric effect.

The source code is available on GitHub: https://github.com/generative-music/generative.fm

With this and other generated music, often it feels like you are only capturing local information about what it means to be a song, and maybe missing something global.

For example things can feel a bit disconnected, chords and progressions that don't "transition" properly. To me, that is a bit unpleasant. I feel like that means you need to give it some extra constraints, but this might depend on the style.

Agreed, and I think that speaks to the difficulty of being sufficiently grounded in both worlds — music and programming.

To make generative music that is rich in detail and follows the thousands of conditioned expectations of listeners and that has a narrative arc ("global connectedness") at multiple time scales, you need that grounding, interesting & unexpected constraints, and a lot of practice.

I make generative music (sometimes professionally), so I'll share what constraints I've found helpful. None of these are rules, just battle scars.

• Embrace determinism, especially at first. It can be tempting to lean-in to the essence of generative music and have randomness reign supreme ("it goes on forever and never repeats, different every time"), but that makes it very difficult to track the consequences of your decisions as you're composing the system. The stability of determinism really helps you build up a system that can produce minutes or hours-long narrative arcs within the music, and avoid that "lack of global connection". It's this stability that allows conventional musicians to compose music that holds listeners' interest for hours. Hang onto that, and then slowly release it in small, controlled increments.

• Pick a genre, reverse-engineer it, write down its rules, and then turn those into systems. Don't just start blue-sky inventing systems that make music, or it won't scale up to a high degree of intricacy, and the result won't be able to hold listener interest.

• The tones and textures matter more than how you use them. So if you're using samples, make sure you have samples that can elicit and maintain interest and attention. That means variety — multiple instruments, multiple aesthetics, variations of every sound. If you're using synthesis, spend a good portion of your effort making sure the sounds are lush and varied and convey the right aesthetic. It's powerful to mix both samples and synthesis, and to apply dynamic filtering like reverb or EQ, and that too should be driven by a procedural system. Ultimately, tone and texture are your signifiers of quality and maturity, sophistication, professionalism, so pay them special attention.

Absolutely agree with all of this.

The sonic part comes down to production values.

The problem with most generative art is that it's treated as a programming exercise, not as a tool for producing the best and most polished work.

It's fairly easy to hack together a music generating system, but producing tracks or output to a professional standard is a harder problem.

If you see using samples as cheating, you will get stereotypical generative music. You can get very convincing [0] results by driving virtual instruments with MIDI, or even loading samples directly for playback.

[0] https://youtu.be/3Lo7yyZcSzU

If you like this type of thing and want to go darker/heavier, Iron Cthulhu Apocalypse and Cryo Chamber are personal favorites of mine for “music” while programming.

The Red Strings Club OST and the calmer Deus Ex soundtracks are really excellent for programming too. The mood I attribute it to is "competent thoughtfulness with light pressure toward action". I know that is a silly way to put it, but that is music for you.

Similarly good are parts of the Fallout OSTs and Minecraft OST. I have listend to a bunch of game and movie OSTs for films and games I haven't even watched, it's a great source of programming backing tracks.

> competent thoughtfulness with light pressure toward action

I am definitely stealing this for my twitter bio.

“Human music. I like it.” ~ Jerry Smith

It seems to generate the elements of certain styles, but there is no ligature or movement in the overall music at all. I suppose this meets the definition of "ambient" but it is not really suitable for the genre.

Looks like it's been generated client-side. While impressive, it's also CPU demanding. Unfortunately, muttering fan on my (quite dated) notebook kind of ruins the experience.

Is this currently working on mobile? I’m not getting audio but seeing indications that it is playing, so maybe it’s just not accounted for.

I love Brian Eno, so I’m super excited to see something like this pop up. Would love to contribute generative systems!

Try flipping your ringer switch. For some reason that silences the music for me.

Are you on iOS? I’ve had a ton of problems with iOS and WebAudio (really anything that uses Webkit, but the issues aren’t as bad on macOS).

Didn’t play for me either on this device, but I wasn’t surprised given previous experience.

Was able to get it to play in iOS, but Safari crashed after 1m or so. Not sure if that's cause I let the device lock or what.

Worked for me on Firefox Focus.

Which is kinda surprising, considering how often media doesn't work...

Working for me on Android Chrome.

Doesn't work for me at all on Safari, so it might be an issue with WebKit?

This is absolutely fantastic and exactly the kind of music I love to hear while working. It has already conquered a rare spot as one of my pinned tabs! Wouldn't this be a great usecase for a tiny OSX tooolbar-app that lets you use your media-controls to play/pause and move between songs?

Offer that with a free tier of one or two songs and upsell the rest for a few bucks (with a 1min demo-tune-in for unpurchased songs).

Oh, and throw in a few subtle but noticable war drums when ever a new email arrives, that would be brilliant! ;)

Thanks for sharing this! I just spent, I'm not sure, maybe an hour and a half listening to it ('Trees', to be specific) while reading. I usually struggle to concentrate for extended periods, but this really seemed to help. Just the right balance to be calming and undistracting, but interesting enough to occupy the part of my mind that would normally jump out every 10 minutes and suggest a change of focus.

This is great.

It would be nice to have a way to auto-play each piece (something like https://somafm.com/player/#/now-playing/dronezone) so that I can start the music automatically (e.g. from a script) without having to click.

I'd use this too :)

We use contextual cues to help in recalling memorized information. If I learn/study about ABCD while listening to music FFF, I'll more easily recall ABCD while listening to FFF.

This is why I don't see "endlessly unique" as something inherently good. It would be cool, however, to play it for 1h (or so), save it and then re-play it whenever.

This is wonderful! I've been listening a few minutes and I think I'm going to hold onto this link for writing. Well done.

Any recommendations for a textbook or scholarly work on generative music?

This is great, I paid for a lifetime membership to brain.fm but the app is still broken on iOS. If these can play for longer then 25 minutes (where brain.fm dies on mobile for me) then I’ve found my go-to.

myNoise is good on iOS, it's not exactly like Brain.fm but has a whole bunch of different sounds. I think the author is a member here and that's where I heard about it a few years ago.

Edit: and it absolutely does play more than 25 mins, I quite often leave it on overnight playing rain noises and it's fine.

Came here to mention mynoise. Absolutely love the website (plays all day in my home, I've spent an embarrassing amount of time curating my tunes) but think the app needs some work.

If the author does indeed peruse HN, I've got a few suggestions for sounds, but I'm sure you're completely inundated by such things :) Thanks!

Yikes. Also have a lifetime membership, don't recall the 25-minute hiccup. Probably haven't used the app in the last 30 days, did it become broken recently?

Also I've had nothing but positive experiences when emailing for help / support / suggestions, have you tried that?

You probably did the lifetime membership when the intro / debut post was on HN a few years back... not sure if the app developer(s) are still active on HN (probably?) but you could probably contact / post / follow up that way too.

Unfortunately, it has never worked for me on iOS with Bluetooth headphones. I recall submitting a support request and then seeing a fix in the App Store update but it just never worked for me, even if I download to my device.

Ah well.

Damn how'd you get that lifetime membership? Seems they don't offer that any more.

It was a special offer 3years ago to celebrate brain.fm hitting the HN front page. https://news.ycombinator.com/item?id=11148896

I imagine someday you'll be able to tie this to a neural sensor for a feedback loop that enables machine learning to generate the exact music for the exact mood you want.

You don't actually need a neural sensor for that, right?

For targeting general levels of physiological stimulation probably not. You might be able to get away with basic vital signs, maybe some sort of stress detection. With a neural sensor though it might be able to lead you into deep meditative or even lucid dreaming like states.

I like it, but could there be some more instrumental elements? Ie, not just a piano, or a droning synth, but a piano with a droning synth!

I'm really excited for where this can go. I'd love for it to be possible to feed a generator like this with the style of music I like to have on in the background and then it interpolate an "infinite stream" from there–naïvely, I feel like certain genres (e.g. progressive house) would be ideal for this kind of treatment since they seem to be inherently quite structured and recurrent.


Recommend removing “never played” and using something like “popular” on more played. This way new content doesn’t look like no one likes it.

I believe it means you "never played" it yet

I love `Trees`.

Listening to this along with the clicking sounds of my coworker's keyboards makes me feel like I am in a rainy forest.

I can't believe how good those songs are and it's all computer generated. Thank you for creating this.

Well...no...it's definitely not "all" being computer generated. The human creator made all the sounds and then gave the program some rules for combining them and manipulating them based on the human's aesthetic and compositional preferences. On the spectrum between human-generated and computer-generated this is very close to the human side.

It is very good! Tried it yesterday, and opened again today.

Now I want is as a soundtrack for my life :D You should totally publish a Desktop app which loads on system boot!

Also, did you think of partnering with one of these relaxation or meditation apps?

btw, I can help build and publish a small iOS app, if you're interested

Can’t wait to try it out on my desktop.

On my mobile (iPhone), I get clicks and other artifacts on playback, which increase when scrolling the view, which I guess indicates samples not being generated fast enough.

Please add cast support (google/Amazon) and it's something's I would live running all the time in my house

Delightful! Do you accept submissions?

Excellent execution. I could easily see this used with contextual seeds/triggers in a VR experience.

Wonderful project.

Beware: my top of line android phone rebooted itself after a minute or so of music.

The content is amazing. Concentration, insomnia, etc.

Is it difficult to build systems?


Difficulty? hard to say, looks like knowledge of the various libs used is pretty critical, but pieces look to be between 100-200 lines.

Awesome job mate, I'm loving this!

This is an amazing project! Kudos

Wow, that's really amazing!

This is really cool!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact