Hacker Newsnew | past | comments | ask | show | jobs | submit | errozero's commentslogin

I've just added a wav export feature. Currently it only exports with the knob positions as they are when the pattern first generates. You can choose how long the exported audio is.

It's a bit of a hack that re-opens the app in an iframe in the background using an offline audio context.

I'll come back to it at some point and make the export pick up the knob positions but I don't have time right now.


Thanks


Thank you! It's been a few years so I can't remember exactly without reading through the code but it's something like this:

It uses notes from the selected scale and octave (from the dropdowns). If the pattern is of an even length, say 16, it will split it into 4 chunks of 4, then randomly decide if it should generate new data for the chunk or copy the previous chunk. It uses the repeat slider for the probability on this.

It randomly applies the 303 modifiers (up, down, accent, slide) using probability set with the sliders on the pattern tab.

There's also an 'empty' slider which sets the probablity of an empty note appearing in a chunk.


Awesome, love it! You could consider adding some randomness from random.org so that natural electromagnetic phenomena (or a supreme being) influence the output - for the pro service perhaps ;-)


I wish I could attend! I'm in the UK.


No, but the timekeeping part of it is. I put that code into a small library to use in my music apps: https://github.com/errozero/beatstepper


Hey, I made this a few years ago. I'm suprised to see it posted here today.

It was never finished and I was meaning to add a polyfill for the missing cancelAndHoldAtTime function for Firefox.

Edit: I've just hacked in a quick polyfill


Sorry, I'll implement it, I had forgotten we didn't do it for erm... 9 years.

https://bugzilla.mozilla.org/show_bug.cgi?id=1308431


For a while I have been curious about the intended uses for xAtTime functions (like cancelAndHoldAtTime) in Web Audio. As far as I understand it, calls to them suffer from lag due to main JavaScript thread and audio thread communication, which makes sample precision unachievable—and precision is quite important in music.

Is it mostly for emulating slow-moving changes on fixed timelines, a la automation tracks in traditional DAWs like Logic and Ableton? Is design rationale documented somewhere?


Those methods are sub-sample accurate, granted you call them a bit in advance to account for the cross-thread communication, as you say. But yes, in general this was designed (prior to me becoming an editor) with scheduling in mind, not with low-latency interactivity. That said, it goes quite far.

Other systems go further, such as Web Audio Modules (that builds on top of AudioWorklet) implement sample-accurate parameter change from within the rendering thread, using wait-free ring-buffers. That requires `SharedArrayBuffer` but works great, and is the lowest latency possible (since it uses atomic loads and stores from e.g. the main thread to the rendering thread).


This is the best thread


Thank you!


This is really lush. Instantly it brightened up my evening. This kind of experimentation is always amazing to see.

As many seem to have mentioned below, it brings back memories of Rebirth in some ways. What it also reminds me of is the beautiful results you could have by plugging some simple modules together to create soundscapes. The limits are the things that provide some semblance of freedom and this is no different. Greetings from a fellow UK acid (techno) head! :P


I've just updated this to make it a little bit easier to use on a phone. The knobs are now a bit chunkier and should respond better to touch and the instruments sit vertically instead of horizontally.


I was randomly going over my past HN activity and bumped over this gem from here https://news.ycombinator.com/item?id=38624968 and posted :)


Ah, I was wondering how it ended up posted here. Thanks!


this brought a little more joy to my day, thank you


Hey if you don't mind updating this, can you please allow the tempo to be as high as 150 bpm?


Hey, sure! I forgot it was limited to 130, it's been a few years! I've just updated it.


That might tickle your tinrib. If you want to stay up forever, maybe go to 160 bpm. Or even some industrial strength 200 bpm.


And also, different tempos per instrument :)


this is awesome. would suggest not randomizing the tempo on regenerate, and if it was already playing, when hitting regenerate, keep it playing. that would make it easy to quickly audition loops at a given tempo with a single click


This is fantastic errozero nicely done! It's very musical, the drone is a nice touch and really glues it all together in a subtle way.


@errorzero - if you have the time would you be able to give more information on the Scales? This section is very interesting.


Hey, the scales are just an array of numbers like this

    ['Darkness', [0, 1, 3]],
    ['Darkness2', [0, 1]],
    ['Single', [3]],
    ['Locrian', [0, 1, 3, 5, 6, 8, 10]],
    ['Aeolian', [0, 2, 3, 5, 7, 8, 10]],
    ['Mixolydian', [0, 2, 4, 5, 7, 9, 10]],
    ...
A scale is randomly selected at the start and then notes are randomly selected from that scale in the pattern generation, plus the root note number is added to each one.

So if you had the 'Darkness' scale selected and had the root dropdown set to 0, the notes in this scale would be C, C#, D# which is 0, 1, 3 if you count the keys on a keyboard. If you changed the root to 2, then it would become D, D#, F (2, 3, 5).

Hope that makes sense.


That does make sense, thanks! Very simple and effective.


This is amazing. Thanks for making it.


Are you interested in open sourcing? I'd love to learn about how this was done.


Update: The wav export feature now renders with all parameter changes, and I've fixed a bug that excluded the drone from the export.


How do I export/save a pattern I like?


Currently, all you can do is save the url which contains all of the initial randomisation settings when a pattern generates. It doesn't update when moving sliders or anything, it's just the intial settings.

I'll look into adding a wav export feature.


Yes. Export please!


It now has a simple wav export feature. Details here: https://news.ycombinator.com/item?id=44824142


Update: wav export now added


this thing is great. you got a version that can run as a vst or plugin?


I created this scheduler library which can be used to play a sequence of notes, create a metronome, drum machine etc. https://github.com/errozero/beatstepper


Here's a couple of web audio things I have worked on and not really shared with anyone. They will both work best in Chrome.

https://303-gen-06a668.netlify.app - A tool to generate randomised 303 acid loops (Chrome only)

https://metronic-studio-0d0680.netlify.app - Unfinished web daw project started a few years ago


Quite cool !!


I have been searching for a new phone for months, looking for something small and with a headphone socket, it's literally impossible.


Unihertz has got you covered: https://www.unihertz.com/products/jelly-star

Disclaimer: I've never owned any of their phones so I can't speak to their quality.


The quality is ok but their update policy is terrible.

I have a jelly one but it never got the promised upgrade. They were just like 'hey it's very difficult due to the limited storage so we're only going to upgrade the pro version' :(

And later models have been getting 1 upgrade at best too.


I own one of their original Jellys and I still find it amazing. I never used it as my daily driver though since it really is a bit _too_ small.


Thanks, that's a cool device but I think maybe a bit too small to be useable.


Typing this on Asus Zenfon 8. The best phone I have had in years, I have it for almost 2 years now. No bloat, small, records voice calls. There's nothing more I want from a phone.

Battery isn't great but afaik it improved in the newer models.


Still waiting on Asus to turn the bootloader unlock servers back on so I can use my Zenfone 8 with LineageOS :(


Galaxy J3 2016, tiny phone does all that I could ever need


Sony Xperia 5v and 10v are two current phones that reasonably sized and still have a headphone jack and memory card slot. Not the flagship Xperia 1v though, I think that one's a bit bigger.


I was very against losing headphone socket but just accepted the iPhone SE 2020 and actually using thunderbolt to headphone jack adapter is not that bad. But the ultimate realization is when you finally try Airpods Pro and you are converted.


There's the Light Phone if you can live with e-ink. Don't know how capable the music player is though.


Typing this on an Asus Zenfone 9. Small, headphone jack, good battery life.

I think there's a Zenfone 10 now?


Asus Zenphone 10. You’re welcome.


As stated in the article, the Zenfone 10 isn't actually small, it's the same size as a standard iPhone or galaxy S23


I made a library based on this article which I use as a starting point for all my music app projects. It's useful as the main timing code for things like drum machine and sequencers etc. https://github.com/errozero/beatstepper


Interesting!

The way I understand it, Web Audio API only lets one schedule audio source nodes with start and stop methods. As I needed to schedule something that was not audio related, I ended up creating silent oscillators of almost zero length and relying on the 'ended' event.

But running a scheduled callback is better! It's not immediately clear to me how you do it. Can you maybe explain your code a little?


Hey, sure I'll try... if you mean usage of the library:

It runs your callback every 16th note, slightly before it is actually due to play, this can vary by a few milliseconds each time but that doesn't matter as the actual audio context start time for the note is passed in to the callback, and you use that to actually schedule the events for that 16th note, eg: osc.start(time).

You can schedule 32nd notes etc too by using the stepLength property that is also passed in, time + (stepLength/2) would be a 32nd note.

Hope that makes sense? I do need to write a better description on the github page of what it actually is.

The inner workings of the library itself are mostly just as described in the article with a few tweaks.


Are there any model or texture files included? I can't seem to find any.


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

Search: