
Generative.fm – Endlessly unique ambient music - dmit
https://generative.fm
======
alexbainter
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](https://github.com/generative-
music/generative.fm/issues)

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

~~~
Pyxl101
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.

~~~
amelius
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.

------
spiralganglion
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/](http://ivanish.ca/diminished-fifth/)

~~~
kkaranth
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.

~~~
spiralganglion
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.

------
rovyko
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.

~~~
spiralganglion
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.

~~~
netsharc
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...

------
dmit
The source code is available on GitHub: [https://github.com/generative-
music/generative.fm](https://github.com/generative-music/generative.fm)

------
foxes
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.

~~~
spiralganglion
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.

~~~
TheOtherHobbes
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.

~~~
Archit3ch
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](https://youtu.be/3Lo7yyZcSzU)

------
vcavallo
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.

~~~
ehnto
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.

~~~
jlborxes
> competent thoughtfulness with light pressure toward action

I am definitely stealing this for my twitter bio.

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

------
ubu7737
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.

------
ComodoHacker
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.

------
jcutrell
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!

~~~
nchase
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.

~~~
jaquers
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.

------
Lerain
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! ;)

------
retsibsi
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.

------
jamestomasino
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.

------
gregknicholson
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](https://somafm.com/player/#/now-playing/dronezone)) so that
I can start the music automatically (e.g. from a script) without having to
click.

~~~
psteinweber
I'd use this too :)

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

~~~
XnoiVeX
[http://euterpea.com/haskell-school-of-music/](http://euterpea.com/haskell-
school-of-music/)

------
muvek
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.

------
intopieces
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.

~~~
joshschreuder
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.

~~~
kylek
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!

------
edoo
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.

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

~~~
edoo
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.

------
saagarjha
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.

------
zengid
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!

------
eismcc
Cool!

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

~~~
O_H_E
I believe it means you "never played" it yet

------
cuddlecake
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.

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

~~~
TaupeRanger
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.

------
bykhun
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?

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

------
danra
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.

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

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

------
kirbysnacks
Delightful! Do you accept submissions?

------
pryelluw
Wonderful project.

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

------
irln
The content is amazing. Concentration, insomnia, etc.

Is it difficult to build systems?

~~~
jaquers
[https://github.com/generative-music/pieces-alex-
bainter/blob...](https://github.com/generative-music/pieces-alex-
bainter/blob/master/packages/piece-observable-streams/src/piece.js)

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

------
matthewhartmans
Awesome job mate, I'm loving this!

------
vaastav
This is an amazing project! Kudos

------
g3ol4d0
Wow, that's really amazing!

------
deanalevitt
This is really cool!

