# Audio DSP - Csound/Pd/MAX/Octave/C++ etc

**URL:** <https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469>\
**Category:** Uncategorized\
**Created:** [September 17, 2022, 9:06pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469 "2022-09-17T21:06:44Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Krakenpine](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/krakenpine/32/3263_2.png) [@Krakenpine](https://lookmumnocomputer.discourse.group/u/Krakenpine)\
**Post date:** [October 17, 2022, 9:36am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/21 "2022-10-17T09:36:33Z")

</div>

[![](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/a/3/a3978fa41d4f2ea94ba48354debcbb17a329c810.jpeg "4-voice additive oscillator / synth module with Arduino Nano") ](https://www.youtube.com/watch?v=9hooPyHGNRU)

> **[GitHub - Krakenpine/Harmoniqs: 4-voice additive harmonics oscillator with...](https://github.com/Krakenpine/Harmoniqs)**
>
> 4-voice additive harmonics oscillator with Arduino Nano - GitHub - Krakenpine/Harmoniqs: 4-voice additive harmonics oscillator with Arduino Nano

I made a video about that oscillator I’ve been making. The code still needs some bugfixes and refactoring, but it’s something.

---

<div class="post-metadata">

**Author:** ![sebastian](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/sebastian/32/39_2.png) [@sebastian](https://lookmumnocomputer.discourse.group/u/sebastian)\
**Post date:** [October 17, 2022, 10:35am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/22 "2022-10-17T10:35:56Z")

</div>

Really cool! When you talked about the aliasing problems, I was reminded of this passage in the [manual of the Noise Engineering BIA](https://cdn.shopify.com/s/files/1/0552/0923/0485/files/BIA_manual.pdf?v=1622230180):

> Basimilus Iteritas Alter uses a sample rate that is a multiple of the fundamental (lowest)  
> oscillator frequency. This moves alias power that is a multiple of the fundamental to be  
> mapped to a multiple of this tone, therefore making the aliasing align with the harmonics  
> of the tone. This works well for settings with a strong harmonic structure (spread fully CW  
> or fully CCW) and adds unique aliasing character for other tones.

I don’t understand enough of the topic, but I was wondering if something like this could help? It can of course not help with the higher notes (because the max. sample rate of the Nano is limited to 16kHz), but maybe for the lower registers?

---

<div class="post-metadata">

**Author:** ![Krakenpine](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/krakenpine/32/3263_2.png) [@Krakenpine](https://lookmumnocomputer.discourse.group/u/Krakenpine)\
**Post date:** [October 17, 2022, 10:47am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/23 "2022-10-17T10:47:19Z")

</div>

That could work on other platforms, but basically the sample rate of Arduinos are tied to the counter that also controls the pwm-rate, and rate of the interrupts generated by the counter cannot be defined arbitrary. But that would be a fun way to do things. Instead of changing the speed you go through a wavetable you instead change the speed of the whole thing.

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [October 18, 2022, 9:42am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/24 "2022-10-18T09:42:40Z")

</div>

While messing around with some Daisy projects I had a bit of a dig into [Faust.](https://faust.grame.fr/)

It seems interesting because you can do some virtual prototyping in one of the IDEs (web based or on your PC) and then have it compile to different targets, such as C++.

This is me messing around trying to put together a mini [drum machine](https://tinyurl.com/mr2z8a7h) using some of the built in drum synths.

Cheers

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [October 26, 2022, 10:28am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/25 "2022-10-26T10:28:44Z")

</div>

> [@jaradical](#):
>
> but once I have it I’ll share it somehow

I put it on [github](https://github.com/jazamatronic/morphing_wavefolder_bela_csound) for those interested.

Cheers

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [October 27, 2022, 2:16pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/26 "2022-10-27T14:16:34Z")

</div>

Here’s something new I [built](https://lookmumnocomputer.discourse.group/t/my-build-progress/345/5415).

Like I mention in that post, there is the nifty [eurorack-blocks](https://eurorack-blocks.readthedocs.io/en/latest/index.html) virtually prototyping environment. You can build some DSP, compile it as a VCV Rack plugin and quickly iterate on it until you’re happy. Once you are ready you can build an image and flash it directly onto the hardware. I’ve already run through a flanger example, and I’m hoping to get a reverb into my rack by going this route…

Edit: I have a spare PCB and panel if anyone is interested.

Cheers

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [November 5, 2022, 5:58pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/27 "2022-11-05T17:58:41Z")

</div>

I’m quite pleased with the outcome here. I built two daisy patch.Init()s

On one I have raided a bunch of Faust [filter models](https://faustlibraries.grame.fr/libs/vaeffects/) - Diode ladder, moog Ladder, Korg35, 2nd order SallenKey, Oberheim SVF, plus some stuff from the [physical modelling](https://faustlibraries.grame.fr/libs/physmodels/#pmformantfilterbankbp) libs, like the Formant Filter bank and finally some comb filters.

All of them run in parallel, and I can change the model by a push button or via CV, which I think is neat. Here’s a quick run through of the sounds:

On the other module I’m running something called the greyhole verb which looks like it was cribbed from [Super Collider](https://doc.sccode.org/Classes/Greyhole.html). I jammed a delayed pitch shifter with feedback onto the front-end to get some shimmer vibes:

Cheers

---

<div class="post-metadata">

**Author:** ![Dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Dave](https://lookmumnocomputer.discourse.group/u/Dave)\
**Post date:** [November 5, 2022, 6:57pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/28 "2022-11-05T18:57:55Z")

</div>

That daisy project looks really really good, has nice specs, and so flexible on the ways it can be programmed.

If I had not just spent the last few months working on a similar concept budget system using pi pico’s I would probably be buying a couple of these.

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [November 5, 2022, 7:15pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/29 "2022-11-05T19:15:02Z")

</div>

I have a couple of pi pico’s floating about here and a [EuroPi](https://github.com/Allen-Synthesis/EuroPi) kit to build. I looked into doing some DSP on them when I first got them, but the lack of FPU turned me off, and I’m not sure I’m hardcore enough to go down the fixed point route.

Cheers

---

<div class="post-metadata">

**Author:** ![sebastian](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/sebastian/32/39_2.png) [@sebastian](https://lookmumnocomputer.discourse.group/u/sebastian)\
**Post date:** [November 5, 2022, 8:09pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/30 "2022-11-05T20:09:56Z")

</div>

Wow! That sounds really great! I am very interested in both of your approaches, daisy and pi pico (I have a pico flying around somewhere) please keep us updated!!

---

<div class="post-metadata">

**Author:** ![Dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Dave](https://lookmumnocomputer.discourse.group/u/Dave)\
**Post date:** [November 15, 2022, 10:00pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/31 "2022-11-15T22:00:32Z")

</div>

I mentioned above that I had been working on a pi pico module system, it’s still in the early stages, but I have reached a stage where I have a few modules running okay-ish, and feel now would be a good time to demonstrate what I have so far.

When I started this project, I had a few years of experience writing dsp, a couple of old vst’s, some VCV Rack plugins, and an android synth and contributed to LMMS an open-source daw. I also had a few pico’s left over from another non-audio related project. What I wanted to make, was a framework, both software, and hardware to run modules for my synth, I knew the pico was maybe not the best of choices, no floating point maths, dodgey ADC, no DAC, but hey this is a hobby not a commercial product.

I produced a pcb that I use for all the modules, with a scatting of op-amps to sanitise the inputs, and filter the PWM output. I also added some multiplexers to allow for eight analog knobs, and CV inputs, two audio inputs, two audio outputs, and four cv outputs.

I put one of these boards on a ply panel and added the maximum number of exteral componets to use as a develpment module, this one had two picos on the pcb to allow for debugging using gbd. Unless you need to debug, only a single pico is required.

 ![20221115_193403](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/8/4/84384513aa553dce51882dba078e9715b1b3d0c1.jpeg)

It quickly became apparent that two channels of audio were going to be too ambitious, something to remove for the next iteration of boards. My First attempt at the software framework worked ok, and I was able to get a few simple modules working, a basic sine VCO, attenuverter, sample and hold, an FM RM AM dual VCO. I was regularly running into performance issues, and read that fixed point maths was the way to go. I have started the process of converting to fixed point, and have all the existing modules running, but I still need to do some more work to get the audio analysis on my unit tests to work, something I must rectify before I make the repo public.

I have also added reverb and delay to the collection and made some more plywood modules. They definitely get used in my rig, and perform well for the build cost, but better is available if you wish to spend cash. Talking of costs, for me to build a single PCB is around £18 + pots, jacks and panel.

 ![20221115_193321](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/b/e/be294fd728c0149207f64fbaa69a6e997ea43eae.jpeg) ![20221115_193356](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/f/b/fb89e28461e1025da9fc73a990aa90da35a16ecf.jpeg)!  
[20221115\_193316|375x500, 50%](https://lookmumnocomputer.discourse.group/uploads/short-url/x8uCVIo4oEm2MdGnxUkntwqBKRc.jpeg)  
 ![20221115_193342](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/2/a/2af5e86ea2aae1421e5256f80dc6c6cbdeb56bf1.jpeg)

 ![20221112_175755](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/7/1/71d6b210093caf6a1b5c3ba01a0e9165b6ab8adf.jpeg)

I also have some audio samples of the delay, verb and vco, I have uploaded wav files, yes any noise you hear is from the module, not some compression.

Delay, a synth line followed buy a drumbrute: [Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.](https://1drv.ms/u/s!Ag9Z3-tKkzcpj4N5Hs4_5cM42DVxDQ?e=Hfi5cm)

Reverb: [Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.](https://1drv.ms/u/s!Ag9Z3-tKkzcpj4N3ZR8wXg5XS0207Q?e=oiUGHA)

VCO: [Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.](https://1drv.ms/u/s!Ag9Z3-tKkzcpj4N48nkAGJxh89nAtw?e=DoeRmt)

So, where to go from here? I don’t plan on using only digital modules, but I do see a place for them in my synth. I want to develop some more modules using this, and I shall be moving onto a full pcb construction, no more ply, and flying cables. I am intending to get the front panel made with drill marks on the rear, so I can make modules with varying numbers of UI elements. I shall also be removing the second audio channel, this allows for 1 less TL074 and 1 less multiplexer. I am also intending to rearrange the pin headers, to give the possibility of eurorack-sized modules, but this will require surface mounting to reduce the size, as the current board is 100 x 100mm very wide for a eurorack module. I am not intending to do this for the next batch of boards.

I hope I have made a system that anyone with experience of C++ audio development is able to use to create their own modules. I have written a very simple sine vco, designed as an introduction, with excessive comments, as a demo.

> <https://gist.github.com/curlymorphic/a413010dea449b66808ecf98b24e2c4d>

Once I have the next revison of PCB’s and finished the current “FixPoint” branch I intend to release the designs on github. I welcome questions.

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [November 16, 2022, 8:11am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/32 "2022-11-16T08:11:26Z")

</div>

Super interesting!

I have loads of questions.

- What kind of PWM resolution and max output frequency are you getting?
  - Are you using the PWM peripheral or the PIO?

- Are you using both cores on the RP2040?
- Have you looked into using the fast math functions included in the bootrom for floating point?

Thanks for sharing.

Cheers

---

<div class="post-metadata">

**Author:** ![Dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Dave](https://lookmumnocomputer.discourse.group/u/Dave)\
**Post date:** [November 16, 2022, 9:06am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/33 "2022-11-16T09:06:36Z")

</div>

Thanks for taking an interest, a few quick answers as I am about to leave for work, I will be happy to elaborate later.

> [@jaradical](#):
>
> What kind of PWM resolution and max output frequency are you getting?

I have overclocked the cpu by a factor of 2, giving 270Mhz, this has allowed me to get a samplerate of just short of 44k, The resolution I have used after some trial and error is 8 bit, with each sample being repeated 8 times. This gave to my ears the best result, I can incresase the bit depth at the expense of the oversample repeats, giving nicer looking specs, but to my ears inferior audio.

> [@jaradical](#):
>
> Are you using the PWM peripheral or the PIO?

DMA and PIO

> [@jaradical](#):
>
> Are you using both cores on the RP2040?

Both cores, core0 handles input, outputs and conversions, core1 audio dsp, but I do have some profiling to do.

> [@jaradical](#):
>
> Have you looked into using the fast math functions included in the bootrom for floating point?

hmm, now you are making me think, I would like to say yes, I am / was thinking these were used by default, but I shall have to relook at this. I was impressed by the speed of the implementation, but using Fixed Point gives a speed increase of about 2.5 times, and I have implemented lookup tables for functions I have required, sin, cos, pow2, pow10, etc.

Thanks for making me think about the floating point 🙂

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [January 6, 2023, 10:54pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/34 "2023-01-06T22:54:05Z")

</div>

Been a while since I touched any of this, but wanted to get a wavetable prototype done:

Check out the [Adventure Kid Waveforms](https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/). I also found [https://waveeditonline.com/](https://waveeditonline.com/) which provided some inspiration.

Cheers

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [January 8, 2023, 5:48pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/35 "2023-01-08T17:48:11Z")

</div>

Got it mostly working and published it here:

> **[GitHub - jazamatronic/wavetable\_banks\_bela\_csound](https://github.com/jazamatronic/wavetable_banks_bela_csound)**
>
> Contribute to jazamatronic/wavetable\_banks\_bela\_csound development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [February 5, 2023, 10:12am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/36 "2023-02-05T10:12:14Z")

</div>

Looks like ~~it’s~~ was just my cake day, so I figured I should at least post something!

As gas prices are nuts, and it makes sense to show restraint, I’ve not been heating my garage at all this year, so it’s too cold down there to enjoyably spend more than a few minutes. That means most hardware projects have been put on hold. But, at least I can mess around with software, and have mocked up these digital oscillator prototypes that should make it into my rack via a Bela Pepper:

**Warning** : _Some nasty sounds come out - check your volume…_

[![](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/2/a/2a9e81f601e47c96d15d7062ce9191e73de795c8.jpeg "CsoundQt Experiments destined for a Bela Pepper") ](https://www.youtube.com/watch?v=09EE0ApuF9Y)

Since I’ve gone a bit digital, I wanted to start looking into granular style synthesis and to that end I grabbed a textbook on the subject:

 ![_20230205_110723](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/e/1/e1d1b6820000f2a28c3d0cd89d5f57b9a8952662.jpeg)

I hope everyone’s doing well and enjoying their respective projects!

Cheers

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [February 13, 2023, 9:38am UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/37 "2023-02-13T09:38:11Z")

</div>

Stayed up way too late last night getting this first granular prototype working:

Cheers

---

<div class="post-metadata">

**Author:** ![Dud](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/dud/32/610_2.png) [@Dud](https://lookmumnocomputer.discourse.group/u/Dud)\
**Post date:** [February 13, 2023, 6:41pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/38 "2023-02-13T18:41:11Z")

</div>

I like this , excellent !!! 🙂

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [March 25, 2023, 3:58pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/39 "2023-03-25T15:58:35Z")

</div>

The garage has warmed up enough to spend evenings in without getting chillblains, so I managed to get all the Csound patches I had developed over the winter onto the Bela Pepper. Here’s the wavefolder all fixed up, running into some shimmer verb running on a Patch.Init():

Csound patches are all here: [GitHub - jazamatronic/bela\_pepper\_patches: Patches for bela Pepper](https://github.com/jazamatronic/bela_pepper_patches)

Cheers

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [December 17, 2023, 12:57pm UTC](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469/40 "2023-12-17T12:57:20Z")

</div>

Life eh?

Been somewhat occupied recently, but here’s the latest software tinkerings. I built a Norns Shield and have been working my way through some of the Supercollider tutorials:

Cheers

[Previous page](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469.md?page=1)

[Next page](https://lookmumnocomputer.discourse.group/t/audio-dsp-csound-pd-max-octave-c-etc/5469.md?page=3)
