Heyo! This is my first time posting here so I hope I’m doing this correctly. I’ve spent the better part of the last two days putting together a proof-of-concept thingy in the style of a modular synthesizer. Here’s a screenshot of it in it’s current state:
It essentially uses an array of global audio channels in order to communicate between each of the modules. However, everything defaults to N/A just so there isn’t a cacophony the second you start it up (and also so modules can be left inactive). I simplified a lot of the in/out code so that each module just imports the signals from the array, and can output them directly back into it. I also had to get a bit creative in terms of clearing the audio channels when there was nothing set to them, as it seemed that leaving the channels stuck at anything other than “0” would result in a pitch of random frequency/amplitude. I imagine this is probably just some aliasing issue, though, and was able to solve it pretty simply and involve that code in the custom “output” opcode so that things didn’t get too messy.
One thing that does make me sad (although this is more Csound-specific and I may just not know that there is a solution to this) is that my custom “input” opcode can only provide things in a-rate, whereas most official opcodes in Csound will let you have an option to have it provide values in a-rate or k-rate. I got around this by simply following the “input” line with a new variable of k-rate and equaling it, but it still feels a bit clunky to me. I imagine I could also just simply do k() around the input opcode, albeit I am still not very well versed in when Csound allows nesting and when it doesn’t.
One of the cooler parts of this project was the realization that I could have external audio (microphone / line input) and have that modulate things in the exact same way as an LFO (for example). This led to me immediately making some absolutely insane sounds involving modulating the frequency of the VCO and convincing myself I had somehow accidentally invented a new wonky form of synthesis (lol). Still want to add more modules so I can fiddle with this live input further. Maybe even have triggers based on amplitude? Who knows.
I have not considered what I am going to do once I run out of space on the screen yet, albeit that is somewhat a worry of mine. I imagine I’ll be able to come up with some workaround with having “pages” (aka just enabling and disabling groups of modules) but I will cross that bridge when the time comes.
I also am having some issues getting the Oscilloscope to update more than, like, two times a second. I modified the “updateRate,” but it didn’t seem to make much of a difference.
Oh also, the “de_dust2” is just a play on the name of the dust/dust2 opcode names and the map from the game Counter-Strike, just so people don’t get confused.
I have not implemented it yet, but my plan for if multiple modules use the same “output” channel is to simply add them and divide them by the total number.
But uhh yeah, that’s everything for now. I expect to be adding some more modules over the coming days. Here’s everything I have planned so far:
- Gain & Bias
- Sample & Hold (Maybe also a separate bitcrusher?)
- Slew limiter
- MIDI Support
- Sampler player
- Soundfont player
- Sequencer
- MIDI Player??? Maybe???
Anyway if you think of anything more in terms of modules that could be added feel free to let me know! This is a fun little project for me and it’s (relatively) easy to add most modules on the fly (especially if it’s really just running things through a single opcode LOL).
Current version (Freeverb and Envelope non-functional):
ModularTest.csd (14.8 KB)