Event driven state machines: GUI+sound+network

Hi, here is yet another example of using edsm:

This time it is (primitive) software synthesizer.

  • GUI is X11 based
  • sound is ALSA based
  • you can play chords on your computer keyboard! :slight_smile:
  • sound is… not very nice :frowning:
  • note for for musically inclined people - just intonation is used
1 Like

Woohoo! :upside_down_face: I’ve turned this plaything into network plaything, just for fun.
Now it can be run in two modes, server mode and client mode.
In server mode it does what it did before, but in addition it can can serve clients (3 max).
In client mode it operates as remote keyboard.
The protocol is one-way, client sends “tone pressed”, “tone released” commands and that’s all.

2 Likes

also adjusted for zig 0.11

note: the most recent variant of the engine is in xjiss2 subdir of the repo (as far as I remember) and this variant is not adjusted for 0.11 yet.

already

Cool stuff! Are you looking for feedback on your work?

What kind of feedback do you mean?

I just like to make concurrency this way (opposed to async-await/fibers/coroutines/greenlets/whatever) - it does not require special support on compiler side (I have some variants in C#/D/Rust/Nim) and naturally structures your code (for each state of a machine you have a function for each event plus optional enter/leave functions). I’ve been using this design methodology for years (data acquisition systems basically) and feel quite happy with it.

Cool - makes sense. When people post their work, I like to be supportive in what ways I can and sometimes people are looking for feedback or commentary, other people are looking for contributors, and some are just demoing their projects. All of them are perfectly fine. For instance, I like feedback on my work once it reaches a certain point - sometimes, if it’s too early in the process, I can’t really integrate what people recommend even if it’s ultimately a good idea.

Just wanted to show support and appreciation for your work - it’s always good to see what people come up with :slight_smile:

Well… ok, if someone could inspect the code and point me to possible rubbish I did, that would definitely make me glad :slight_smile:

adjusted for zig 0.12