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

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

4 Likes

Really cool! When you talked about the aliasing problems, I was reminded of this passage in the manual of the Noise Engineering BIA:

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?

2 Likes

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.

1 Like

While messing around with some Daisy projects I had a bit of a dig into Faust.

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 using some of the built in drum synths.

Cheers

1 Like

I put it on github for those interested.

Cheers

1 Like

Here’s something new I built.

Like I mention in that post, there is the nifty eurorack-blocks 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

3 Likes

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 - Diode ladder, moog Ladder, Korg35, 2nd order SallenKey, Oberheim SVF, plus some stuff from the physical modelling 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. I jammed a delayed pitch shifter with feedback onto the front-end to get some shimmer vibes:

Cheers

5 Likes

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.

3 Likes

I have a couple of pi pico’s floating about here and a 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

4 Likes

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!!

3 Likes

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.

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_193316|375x500, 50%

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.

Reverb: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

VCO: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

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.

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.

6 Likes

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

3 Likes

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

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.

DMA and PIO

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

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 :slight_smile:

4 Likes

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

Check out the Adventure Kid Waveforms. I also found https://waveeditonline.com/ which provided some inspiration.

Cheers

2 Likes

Got it mostly working and published it here:

2 Likes

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…

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:

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

Cheers

6 Likes

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

Cheers

5 Likes

I like this , excellent !!! :slight_smile:

1 Like

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

Cheers

2 Likes

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

2 Likes