News for hackers. Stuff that matters.
Re:Show HN: I made some ambient music generators that run in... by bambax on Tuesday July 19, 2022 @07:38AM (#32150145)
This is really good! Congrats!

I make algorithmic (infinite) music in a DAW (Reaper) and have been thinking about porting some of it to the browser, but didn't actually do anything about it :-(

Can you describe the architecture a little? Are you using the Web Audio API for the instruments (and timing)? Are tracks static/looping, or dynamic (created on the fly based on random parameters)?

Re:Show HN: I made some ambient music generators that run in... by printscreen on Tuesday July 19, 2022 @07:48AM (#32150216)
Yeah sure - you're right, it's using a lib built on top of the Web Audio API called Tone Js. This handles scheduling and some instruments, but the sounds themselves are mostly samples which I record myself from VSTs, then do things in the browser such as filter modulation so that they sound different over time. When a track loads for you, that's the samples being loaded in from cloud storage.

As for static vs dynamic, it's a mix of both. Some tracks are more static than others, and I have learned it actually seems better to try and use randomness sparingly. Almost all tracks will use probabilities of loops firing, and some watch for the status of other loops to create sections (e.g, always fire A if not firing B). Note / Chord selection also often contains randomness, such as a probability to pick each note from a list, then a probability that note itself to fire.

Hope that makes sense!

Re:Show HN: I made some ambient music generators that run in... by tgv on Tuesday July 19, 2022 @09:49AM (#32151386)
I quite like the way it sounds. Randomness is difficult, indeed. If you ever want to look at something less random: 1/f noise generates more interesting sequences than white or pink noise.
Re:Show HN: I made some ambient music generators that run in... by bambax on Tuesday July 19, 2022 @08:02AM (#32150329)
Yeah thanks, it does! I use Tone.js also.

(Are "tracks" simple MIDI files or some combination of JSON/JS?)

Anyway, nice work! ;-)

Re:Show HN: I made some ambient music generators that run in... by printscreen on Tuesday July 19, 2022 @08:07AM (#32150358)
Each track is it's own JS file! With a folder of corresponding samples, which the JS file pieces together as I mentioned before. There's no MIDI, it's all done with the Tone.js scheduler. :)
Re:Show HN: I made some ambient music generators that run in... by mortenjorck on Tuesday July 19, 2022 @10:57AM (#32152419)
I'm looking for a good tool and stack for this too, along with algorithmic visuals.

I have a synesthesia-themed project (https://testfixture.presteign.com) where I currently make all the audio with generative synthesis in a DAW and the visuals by hand in a design package, but I'd love to branch out into fully-procedural at some point.