A new version of the clojure tools is now available (https://clojure.org/releases/tools#v1.10.1.754)
• New, more informative tree format for clj -Stree
/ clj -X:deps tree
• Added https://clojure.github.io/tools.deps.alpha/clojure.tools.cli.api-api.html#clojure.tools.cli.api/tree for use with clj -X:deps tree
• Use https://github.com/clojure/tools.deps.alpha/blob/master/CHANGELOG.md 0.9.857
https://github.com/genmeblog/soundsynth Wavetable sound synthesizer. It's a study project which helps me to understand DSP needed to implement similar thing on STM32 chips. It contains minimal path for subtractive synthesis. It works, plays a nice piece, allows live patch changes, consists of: wavetable oscillator, state variable filter, adsr envelopes, wave shaper, phase modulation, sequnecers with bpm timer. Listen to the song generated by it and defined in sound.patch
namespace: https://soundcloud.com/tsulej/lost-woods
The javax.midi stuff isn't hard to use, just a little tedious because of the amount of classes and interop involved. Here's an example of getting key presses from a midi controller https://gist.github.com/plexus/27dfe6a69cda7ec90dab479d37b7b1cc#file-obs_controller-clj this uses a defwrapper
macro to sweeten doing interop, I posted that also on ClojureVerse a while ago and someone ran with it and turned it into a library: https://github.com/emlyn/tortilla
Sorry I don't have a cleaner example handy right now, but find some java examples, they should be straightforward to port.
Are you using a midi keyboard to control OBS? 😈
@plexus Thank you, I think this is enough material to digest. As I said previously I'm not sure if I want to add midi controller support, since I achieved what I wanted, ie. dsp path works and can be used to implement target synthsesizer on STM 🙂 (btw. I remember and forget about defwrapper
- great idea and I happy to see this as a library)
@ordnungswidrig doesn't everyone? 😁 I use the pads on the keyboard to switch betweens scenes like camera, share screen, etc
Hehe, as one of the nerds that build their own keyboards I would rather create custom keyboard or use a “macro pad” to trigger some key combinations… Or use a wifi enabled chip to directly manipulate OBS, now that I think about it 🙂
@tsulej looking forward to checking this out! Wavetable synthesis has made so many interesting advances in the past few years...
@eggsyntax I relied on Mutable Instruments source code. Their products sound pretty awesome.
Have you seen that there are free ports of the Mutable Instruments devices to the (also free, and awesome) VCV Rack virtual modular environment? Although I haven't used the physical modules, reviews suggest that the ports are a pretty close match. Tons of fun to play with 😀 https://vcvrack.com/AudibleInstruments
Yes!!! I know VCVRack and played with Audible Instruments. Actually, this a wrapper to the MI source, which helped me to find entry point to the Plaits instrument and their wavetable oscillator I've stolen the idea from. I want to say that code is highly readable and it was really fun to port some parts to the Clojure.
@ghadi I haven't seen this before! Lovely stuff. Mostly based on overtone/supercollider rendering though. Here I render sound purely in clj.
Ace! I'm giving it a spin. So you foresee giving it support for accepting midi inputs? (I have no idea of how hard that would be).
Yes, we are (I'm helping my 16yo son with this project) after tests on STM32 and MIDI is quite simple there. You just receive note on/off events with note value and velocity. I don't know yet if add MIDI in Clojure but looks like it's a straightforward java interop.
Overtone has MIDI support - maybe you can take some inspiration from it: https://github.com/overtone/overtone/blob/master/src/overtone/midi/file.clj
This is probably more useful: https://github.com/overtone/overtone/blob/master/src/overtone/midi.clj
Oh lovely! Thanks.
It's not as easy as I thought.
DSP, that takes me back...
Hopefully you’ve seen Rich’s conj talk about additive synthesis https://youtu.be/bhkdyCPYgLs