I think even if webassembly compilation would fail then the whole segmod source with includes etc. is around 300 lines long so it should be fairly straightforward to port? I haven’t worked before with creating raw audio buffers in JS but from the quick skim it looks like plain WebAudio AudioBuffer should do the trick. Another idea that I had for segmod extension was to allow users to draw waveforms which then could be used alongside inbuilt sine, triangle etc.
And if I had to chose my favourite Clojure library I think Instaparse would be the choice :smiley:

1 Like

I’m currently learning Rust, mostly for use with WebAssembly. Not sure if I’m already familiar enough with it to port the code, but sounds like a nice project for the upcoming days of isolation :slight_smile:

2 Likes

Almost done with the webassembly integration! Tomorrow morning I’ll do the last bit (playback) and hook it up to your DSL editor! :smiley:

3 Likes

Oh I think this would be very fun to do in Rust!

1 Like

Just took some time to listen through the compilation, really good stuff! I was actually quite surprised by the diversity of sounds, considering the restricted approach to sound design and composition.

I really like those snappy percussice sounds on FREQUENCIES III:

Does anyone have an idea how something like this can be done with segmod? The album description on BC says:

Here, all the used frequencies are octaves of one another. They are arranged in such a way that the sum of their wavelengths equals the wavelength of the lowest fundamental frequency used. This arrangement gives rise to a rhythmic structure that is indeed danceable, especially since beats repeatedly emerge whose timbre is strongly reminiscent of a bass drum.

Not sure what exactly this means though. Maybe some kind of multi-layer technique, mixing several individual tracks created with segmod? Also, at least some of the percussive hits sound like having a frequency envelope - I guess this could be emulated by continuously lowering the frequency of the waveform…

Fascinating stuff - just the kind of rabbit hole I’ve been waiting to fall into! :rabbit2:

Ok! I’ve managed to get the audio playback working! Now working on adding the missing features and adding wave-dsl in :smiley:

https://jellea.github.io/segmod

code’s here

Quick UI idea, inspired by Orca:

10 Likes

Nice work! :slightly_smiling_face: I really like the minimal UI design. Do you already have plans on how to implement it? Text editors can be quite a pain, even with sophisticated libraries like draft.js

This WASM port of Vim looks pretty interesting, seems like they are rendering everything directly into a HTML canvas. So no broken by default <textarea> here :wink: Haven’t figured out yet where the framebuffer’s data is coming from though…

twenty characters of appreciation of minimal UI idea <3 Now I am starting to think this would look really nice as terminal app built using ncurses or something similar :smiley:

2 Likes

Hah yeah that has crossed my mind as well. Would be fun with trikl, but I don’t know much about cross platform audio.

1 Like

This is absolutely wonderful. Endless gratitude!

2 Likes

This reminds me of how SID Wizard for the C64 handles ‘instrument tables’ by allowing you to switch between waveforms inside an instrument!

2 Likes

If I recall correctly one of the things that gave SID chip its distinctive sounds is that the fastest that any updates could happen (changing waveform, filter frequency etc.) was at TV refresh rate (so 50Hz for PAL region).

1 Like

UI is online and waveforms now also work, next up wave-dsl (so the two bottom left text areas part aren’t working yet) :slight_smile: Can’t wait to add a simple sharing functionality so we can start sharing patches :smiley: Oh and you can drag and drop different themes on using @neauoire’s theming system.

https://jellea.github.io/segmod/

7 Likes

I checked it again and I see that you already implemented sharing patches, that’s really cool!
I won’t comment on internals because I see that you are still working on it, but on UI side there is this weird thing that on safari the row with frequency, controls and scope has a height of 0. Setting flex-basis to auto for row class style fixes this.
And while we are on topic maybe someone could shed some light why following behaviour was implemented in css:
default values for flex are 0 1 auto but if you set it to single value like flex: 1 then the two latter values become 1 0 so effectively when you type flex: 1 you define flex: 1 1 0. That is totally not what I would expect. I would expect the values that were not defined to default to default values which seems to not be the case with flex-basis.

1 Like

Hi, thanks for porting this, looks awesome! :smiley:

Does this iteration produce sound or is it just a UI concept?
Can’t get any audio playback or download functionality to work. :confused:

Here’s my console output: image

It should work, but the defaults are a bit broken at the moment. :innocent: Here’s a link which should work, just add a space to the waveforms formula (left text field) and hit play.

edit: Screenshot didn’t load before, it seems like something else is going wrong. What browser/os are you using?

1 Like

Thanks fixed it! :raised_hands:

Would it be possible to add a random seed parameter to wave-dsl? That way I can make the share links for determinate? I’m hashing the wave-dsl strings now, but they get different random values applied; I think it may be nicer to have idempotent links :slight_smile:

2 Likes

Managed to get it working… sometimes. Sorry, I know it’s not the most helpful answer! :neutral_face:

Currently tested on Chrome and Microsoft Edge between two different windows machines.

Here’s what I’ve encountered:

  • Inconsistently I mange to get audio to play and download to work (although scope never works).
  • When audio is playing back, eventually editing the code will have no effect on the audio output.
  • Adding whitespace at the end of the DSL code causes the output to change in unpredictable ways.
  • Browser refreshes the page on code change; my browser history is now a long list of ‘Segmod’ :laughing: Is this intended behavior?

Let me know if there’s anything you want me to test/do from my end. :slight_smile:

1 Like

Sure, I think it should be doable so I will try to add it in the evening. Maybe I will also improve a parser a little.

mac seg faults when i run it from terminal