Additive VCO with Arduino (Hagiwo)

[ $6 ] DIY modular synth Additive VCO with arduino mozzi / additive synthesis for ambient music

Additive VCO , total 8 sine wave synthesis with mozzi library.
It can produce sounds like a pipe organ, metallic sounds, and floating sounds with virtual pitch.

Infos, code … here :

https://note.com/solder_state/n/n30b3a8737b1e

7 Likes

Awesome stuff again!! I wonder where to get Arduino Nanos for 2$! I bought 3 more last week and they were more like 6 or 7€ each… I bought a few half a year ago and they did only cost half as much back then.

2 Likes

I bought arduino on aliexpress.
The quality is not good, the shipping is slow, the packaging is sloppy, and often I get something different from the picture, but it works fine.

Recently, it seems that the price has risen due to a shortage of semiconductors.

3 Likes

I notice in this schematic the pulldown resistor on the V/oct input has been moved to before the series resistor, but not on the other two CV inputs. Since those aren’t V/oct the resulting 1% voltage drop is not critical but I’d still put the pulldowns on the other side of the series resistor on those inputs too.

1 Like

I have a liitle problem with this build.

All works fine except when i plug a CV source in 1V/oct input jack.

there some little “clic” or “cric” on the sound (and for an ambiant module sound is not good at all :unamused:)

I tried differents CV source but allways the same “clic”

an idea someone ?

i precise that mine is build with a TL071

I think that the problem is with the Mozzi library. When an oscillators frequency is changed, it changes immediately. Or to be precise, the “phase increment fractional” of phasor changes. With a sinewave without any harmonics it generates a small corner with harmonics, which is probably usually almost inaudible, but here we have stacked 8 sinewaves on top of each other, and all of them have that corner at the same time, so it’s much more audible.
Or that’s what I think about the reason.
Solutions would need changes in the code. Easiest I can think of would be to implement some kind of slew rate to the change in the frequency. Depending on how often the updateControl() function is called, it could instead of immediately saving the new frequency just to add a small change to the previous until it matches the new, changing the frequencies of the oscillator every time, but with much smaller changes. Or if this doesn’t use too much processing power, it could be done in the updateAudio() function with even finer resolution. If it is the case, that any change in frequency with sine wave produces an audible click, these of course don’t help.
Also, if changing frequency of only one harmonic doesn’t produce audible click, they could be staged such as they don’t change at the same time, but for example few milliseconds apart.

2 Likes

thx @Krakenpine

I just tested with the “Chord” code and the CV works fine, so I think it is not my circuit.

what is strange is that the click is regular like a timer, and not necessarily when it changes note …

and also @HAGIWO don’t seems to have this problem in his vid

1 Like

Well I tried the code for the “FM” and no problem either.
I really liked the “Additive”, but I really didn’t want to bother with it.
A little paint on the panel and hop on the FM instead !

goodbye Additive :disappointed:, hello FM :slight_smile:

4 Likes

Metamorphose :slight_smile:

6 Likes

I build this finally, and I think that the popping sound was either not setting this to hifi -mode or some weird glitch. I managed to get it much worse by putting some division calculations to the audio output -part. They are really slow on 8-bit processors.
Anyway, then I changed all the code and all the electronics to have it much less jumpy and make this actually a full synth voice with ADSR-envelope. And as the v/oct -input is quite stepped, to have adjustable “slew rate” or portamento to use in ambient stuff.
It’s actually quite challenging to program this with 8-bit processor that really doesn’t have much processing power as you want to maximize sound quality. Floating point numbers are slow, but using integers quickly loses information when dividing. And dividing is so costly anyway, so you want to replace that with bit shifts, so only divisions by powers of 2. And if you do multiplications and divisions in the wrong order, you have interger overflows.
A nice change of thinking from my real jobs way of “code is getting slow, let’s throw more money to the cloud service provider to have more power”.

5 Likes

I remember learning about fractional fixed point arithmetic when I first encountered DSPs back in the day. Does ones head in, but quite powerful stuff with limited compute resources.

That said, dibs on the first “cloud capable” distributed eurorack module, I’m sure the hipsters would dig it.

Cheers

2 Likes

“fractional fixed point arithmetic”, yea, I know about this from NES-programming stuff. Usually in context of sub-pixel positions.

3 Likes

In an audio context, where things are bounded by [-1,1] fixed point is pretty good for doing resonant IIR filters, because by assuming that the integer portion is 0, you can more or less guarantee that the filter is going to be stable, as every multiplication is guaranteed to have a result < 1.

1 Like

Yes, floating point arithmetic can be highly accelerated in processors like Intel 80386 (1985) and onwards but even now it’s common for embedded chips, microcontrollers and whatnot, to support only fixed point arithmetic in hardware, to keep the transistor count low enough for high quality control and thus cheaper production runs.

In the late 1960s a guy called Charles Moore pioneered a unique style of programming that came to be known after his most successful version: Forth. He’s still around and his minimalist language family Forth is one example of a programming system that still gives priority to fixed point arithmetic. Forth doesn’t make you ditch floating point, but it does host many excellent alternatives that enable you to find a solution using fixed point arithmetic.

Here’s an example from the Forth standard in which a crucially important arithmetic operator is defined. This produces a temporary double-precision integer multiplication result which is then divided by a single-precision integer to produce a single-precision result. This enables the programmer to arrange an appropriate scale to the result and maximize its precision. If the same operation is performed by an integer multiplication followed by an integer division, without expanding precision for the intermediate result, the result is lost precision (floating point is another way to maximize precision but this method can work better and potentially much faster if the coder is well trained.)

https://forth-standard.org/standard/core/TimesDiv


Here’s currently how this completely rewritten and reimaged additive oscillator sounds now. ADSR is internal and first output is raw from this module, then with the triple splashback delay. Lot to improve, but this can become a nice pseudo-organ -type thing. Squeezing polyphony out of one Arduino Nano may be a bit though one, but what if I design a pcb that can be stacked with smaller ones to get more voices…
Stupid, unpractical and so funny that I probably must.
But I don’t have polyphonic midi-to-cv. Will the midimuso-module ever be available again, or do I just need to make my own.

4 Likes