Petri Nets as a Music Sequencer (blog.stackdump.com)

60 points by m_kos 4 days ago

20 comments:

by Slow_Hand 6 hours ago

I see so many people try to reinvent sequencing as a circular diagram, as opposed to (say) a piano roll that loops, and I see little to no advantage to it. It's a cool novelty, but not the type of thing you'd like to work on.

Horizontal (left-to-right) sequencer displays like a piano roll or step sequencer are far more compact to display and easier to read. For drums parts, it's one dimensional until you add a second layer, and then the parts stack vertically, nicely on top of each other.

It's all to say that I don't really see much advantage in this petri nets paradigm. Even the trigger conditions and probabilities have already been incorporated into a large number of DAWs and hardware sequencers. This feels a little like someone who has discovered fire independently from the rest of civilization, but in this day and age I don't think that counts for much when all they had to do was observe the design paradigms that already exist.

In the end, the proof is in the pudding: How good is the music made with the tool? Does the technique allow us to more easily do something that was previously difficult or tedious? In this case, I'm not yet seeing it.

by jrajav 5 hours ago

I make beats with Patterning on iPad all the time. It's a fantastic sequencing surface. The main advantage over a traditional horizontal sequencer is that time at the measure level is represented much more naturally (as a loop), which makes polyrhythms and track offsets (both common when putting together more interesting sounding, swung beats) easier to visualize and manipulate with confidence. It's also arguably a bit easier to visually reason about symmetry / 'rhyming' across beats, when making step changes - a much more minor improvement but noticeable to me (I'm highly visual).

by m_kos 5 hours ago

I enjoy Patterning too. One limitation of that representation is that it doesn't seem to lend itself to working with loops that evolve over time. I don't know if it could be accomplished by some isometric view of stacked wheels (patterns) or a slinky, but maybe a Petri Net?

by kennywinker 4 hours ago

The only flaw i see in your reasoning is trying to optimize a creative process. Piano rolls may be technically better, but since the majority of music is made with a piano roll you can use other types of interfaces to break out of the mental ruts a piano roll creates in your thinking. Music making isn't about best - it’s about creativity and inspiration and lateral thinking.

by tessierashpool 5 hours ago

> In the end, the proof is in the pudding: How good is the music made with the tool?

hating on OP for being AI slop is fully legit imo (sorry OP) but don't judge the concept on this example. the rotary sequencer model's actually quite effective. there's lots of niche software and Eurorack modules which implement it, e.g., Moskwa (and Moskwa II) from Xaoc Devices.

here's a YouTube video which shows Moskwa II in action:

https://www.youtube.com/watch?v=C-6n_E9WIfQ

btw the first rotary sequencer was probably Raymond Scott's Circle Machine from 1958:

https://web.archive.org/web/20110927232227/http://raymondsco...

by anigbrowl 2 hours ago

I don't know why they refer to these as Bjorklund rhythms - everyone else in the industry calls it Euclidean sequencing, and the person who popularized it is Godfried Toussaint.

There are a lot of Euclidean sequencing tools out there already, in both software and hardware. The premium offerings in the latter category are Elektron sequencers/ samplers/ synthesizers and the Oxi One, a pure MIDI sequencer. but there are many others. Euclidean sequencing is generally combined with things like conditional triggering (playing a note based on probability or a specific iteration of a loop or doing some sort of logic operation on another note in the sequence) and parameter locking (anchoring other parameters like velocity or control data to specific notes). I have the impression taht the authors of this project aren't very familiar with the electronic music marketplace, given that Euclidean sequencing is found even on budget gear now because it's so easy to implement and intuitive for musicians to exploit.

Incidentally, on Vivaldi (built on Chrome) this renders as black text on dark grey, making it nearly unreadable - probably because it's following system defaults, but I think a lot of people have system colors set dark by default.

by andai 35 minutes ago

Looks pretty cool, but I couldn't get any sound out of this thing?

The demo video has sound though, and sounds pretty cool.

by testaccount28 4 hours ago

some candid feedback for claude:

    - the demo on the page makes no sound and is visibly off (triggers happen when the token is at the wrong location, or not at all)
    - the demo video is boring
    - it doesn't even _do the thing_? it's just a 1d piano roll in a circle? there's no fun petri net dynamics?
(who is upvoting this?)
by jarth9 7 hours ago

Compared to other ways of writing down musical rhythm, I've found this to be a very nice balance of simplicity and expressiveness. Standard notation and drum sequencers have a lot of ambiguity (at least to my non-expert ear) when it comes to swing, microtiming, groove, and the other little things that we think of that make a rhythm attractive. Godfried T. Toussaint has given this idea a full academic exploration. He calls these Petri nets "necklaces", a term borrowed from combinatorics.

by tleb_ 6 hours ago

Can you clarify how this better helps express swing compared to a piano roll?

by TheOtherHobbes 5 hours ago

You're not sequencing notes you're sequencing multiple parallel levels of musical information which are eventually rendered as notes.

One of those levels could be context-related microtiming - the context being position in the bar, or the actual shape of the phrase, the position in the phrase, and so on.

This isn't sequencing in the classical sense, it's generative composition.

It's not popular because it's much more abstract and harder to work with than "Play this pattern."

There's a lot of unexplored potential in deterministic systems that work with music at these more abstract levels.

by tleb_ 6 hours ago

So this is about visualisation more than different behaviour? There are still N static notes with a cursor moving from start to end, looping over. It's not clear from the blog. Still, I always enjoy experiments in that domain, thanks

by leothetechguy 3 hours ago

Music in the Field of Music should always come first. Sorry for the bluntness but I listen to the demo for 10 seconds and it sounds... shit. Really shit. Then I look at who made it and it looks like someone shoving a data structure into a field they know little about for the sake of the data structure itself?

by tlarkworthy 7 hours ago

Oh thats great and makes so much sense and you can see how it could be extended, brilliant abstraction

by fwip 6 hours ago

What's the value of modeling these as petri nets instead of a regular sequencer? I was expecting some sort of branching, or at least multiple tokens per ring, but I can't figure out how to set that up.

Also - is it just me, or is delivery weirdly off-beat sometimes? Like, isolating to just the kick drums in a standard 4-on-the-floor techno song, it has almost a disorienting amount of delay on some of the beats.

by ericwood 4 hours ago

Browsers intentionally add jitter to timing methods like setTimeout and setInterval to avoid fingerprinting and other side channel style attacks. When I've messed with building in-browser sequencers in the past you had to use a webworker with the clock that sends messages back to the main event loop, although I'm sure there's reasons that won't work these days either.

by m_kos 5 hours ago

> is it just me, or is delivery weirdly off-beat sometimes?

I played with it for a while and implementation is perhaps not the strongest aspect of this project.

by embedding-shape 6 hours ago

> Also - is it just me, or is delivery weirdly off-beat sometimes?

Is just browser jank I think, with JS in browsers it is infamously hard to get the timing right and consistent, sequencing make this painfully obvious.

by ghurtado 5 hours ago

The fact that it's the job of the browser to mix the channels in real time is a huge design flaw.

Everyone else does this on the server and then sends you the results.

If my computer is going to do all the work, then I want all the knobs and sliders too.

by fwip 5 hours ago

Gotcha, that makes sense. The LLM-written article said something about a "humanize" setting, so I thought it could have been something about that, so I spent a while looking for such a setting to disable.

Data from: Hacker News, provided by Hacker News (unofficial) API