Showing posts with label XM8. Show all posts
Showing posts with label XM8. Show all posts

Friday, November 13, 2026

Testing filter fixes

I've implemented my intended fixes on a breadboard and combined them with the two current versions of the SVF and juno filters. 

All voltages noted here is to be read as the +/- voltage of a signal swinging around 0V.
 

Changes 

That should be implemented in the updated software/hardware

Max input 2.5V

Set input to 2.5V max (in reality, the input used during testing was a single square wave which currently has an amplitude closer to 2.2V). In hardware these will be the result of making the output from the pre filter mixer peak at 2.5V. Summing two 5V signals will result in an output of max 2.5V.

No BP Gain

Removed band-pass post filter gain for both cells, and updated AP and notch circuits to take this into consideration.  

Changes to AP and notch circuit when removing BP gain (op amp is still there to keep phase)


Reduced Juno post filter gain 

Gain is reduced in hardware from 100/18 = 5.56 to 100/39 = 2.56. We have measured the output from the Juno filter directly, not post gain, so the filter is expected to clip when its core output is 10.3 / 2.56 = 4.02V

Limit max SVF resonance

Set max resonance to 80% for SVF and also measuring both resonance at 0.51 and 1 for Juno. This is a software change.

Limit max Juno cutoff and/or resonance

Set max cutoff for Juno to 0.68, which gives a self-resonating sine of around 20kHz, this should be the highest audible signal. Higher than this and the self-resonation should go silent for humans (poor dogs though). Tests were primarily done with resonance at 1. If it turns out that we need a higher cutoff we should reduce the max resonance. We've also tested max amplitude with a resonance at 0.51. These are software changes.

 

Testing

Circuit used for testing

I have not used the voice card's input selectors, instead moving wires on the breadboard. All cell 1 and cell 2 outputs are fed through the voice card's LP2 input which has a 47k input gain resistor. To get correct gain for the cell 1 direct I've added 35k (33k + 2.2k) to the breadboard output when measuring cell 1 direct (12dB) signals, making the total 82k.

Software settings for testing

  • Osc 1 Waveform: Square wave 
  • Osc 1 Pulse width: 0.48 for the best 50/50 duty cycle, without this the signal won't be centered properly during peak measurements.
  • Pre filter mixer: All muted except oscillator 1 which is routed to SVF only
  • Filter routing: Series, which routes the output of SVF1 to the input of the Juno filter


Probe placement 

Probes placed at 

  • LP1
  • BP1
  • HP1
  • AP
  • Notch
  • SVF chain (on pre filter mixer, equals SVF output)
  • Juno out (on filter card, before post filter gain on voice card) 


How were measurements done

Measured at SVF chain

  1. Signal through SVF, no resonance, cutoff set at the point where the output is the highest.
  2. Signal through SVF, resonance set at 0.2 (=80%), cutoff set so that resonant frequency is in sync with (has same frequency as) with the signal, generating the highest possible peaks.

Measured at Juno low pass filter output 

  1. 1 and 2 from the SVF, with Juno cutoff set to max, e.g. fully open so that signal passes unchanged through the filter. 
  2. Juno resonance set to 1 and cutoff to 0.68, giving the max "normal" resonance
  3. Juno resonance set to 1 and cutoff set so that resonant frequency is in sync with the signal, generating the highest possible peaks.
  4. Both SVF and Juno resonance and cutoff set in sync with the signal. 

 

How is possible clipping evaluated

For the SVF output, anything not visibly clipping on the scope is fine. It won't clip on the updated voice card either.

For the Juno filter, we take the new post filter gain of 2.56 into account, meaning anything measured to > 4.02V is expected to clip.

 

Results

These are based on the tests above. There may still be corner cases or other effects at different pitch, but it should be an indicator:

  • Nothing clips in the SVF, even with resonance (up to 80%)
  • Nothing clips in the Juno filter, including any tested output from the SVF
  • For a Juno filter with max resonance, only the HP outputs (without resonance) from the SVF may clip very slightly. 
  • A Juno filter with in sync resonance will clip for almost all inputs, but most clipping is very slight. 
  • With both filters at in sync resonance, we will see massive clipping.
  • With a resonance set to 0.51, which still gives a lot of resonance, just not self resonance, the Juno filter won't clip even at in sync resonance.  

Cases to be careful about

When using resonance set to 1 on the Juno filter, high cutoff (> 0.68) may lead to clipping, though this happens at frequencies higher than 20kHz. Most likely, a resonance of less than 1 will be more than enough and reduces the chance of clipping.


Unrealistic cases

- When using max resonance for both filters, and hitting in-sync resonance points on both simultaneously, we will get massive clipping. This is not a very likely use case though.

- Juno resonance should not be set to max in practice 

 

Conclusion

All general cases look good. We may still see some clipping, but limiting the resonance output on the Juno filter to less than 1 may make things even better.

Tuesday, November 10, 2026

SVF, clipping and fixes

The SVF and Juno filters still clip, and that's the last big blocker before ordering more voice cards. This incredibly boring post tries to document everything that clips, what the max input levels are and to answer how we can adress it/what solution to choose.
 

Design goals

 
Here are the goals I've decided on after testing everything
 
SVF: 
  • Unity gain through SVF (needed for chaining)
  • Input: 2.5V max 
  • No clipping with normal input
  • No clipping with in sync resonance when resonance is < 80% 
  • Remove BP gain (to prevent clipping.  NB: removing gain will invert phase and ruin AP/Notch s don't do that!). 
  • Redesigned AP/Notch using non-gained BP
  • Separate board from Moog filter to be able to change it later. 
  • Consider if possible to move AP/Notch on-board 
  • In software: Limit resonance to 80% and change taper law to logarithmic 

Juno:

  • 50% attenuation through filter (needed to prevent clipping resonance)
  • Input: 2.5V max in normal operation
  • No clipping with input <= 2.5V, including in sync resonance
  • No clipping with input < 10V if not using internal resonance (or specifically in sync reso) 
  • Clipping OK if fed for example in sync reso from SVF and using in sync reso internally
  • Keep current phase output to match Moog
  • Move post filter gain on-board (to make adding a soft clipper possible later without changing mainboard)

Pre filter mixer:

  • default to 2.5V max output
  • allow 5V max output if cutting or soldering jumpers, for future-proofing - must put two 100k in series for normal operation, and have solder jumper for one of them to reduce resistance to 100k.

Output mixer:

  • add 2x gain for Juno, to allow making up for attenuation? Default to unity gain in software. May clip when extra gain but that's a choice, not a bug. Can consider doing this with two 47k in parallel and a cuttable jumper to make gain drop back to normal

 

Input should be max 2.5V

This goal massively reduces clipping. It can be achieved either through changing the internal gain in the mixer OR by changing the wet/dry pan CVs. The CV generation is on the main board and unfortunately fixed, if we should change it we would need both to be 0-2.5V and 2.5V to 0, which isn't possible without another HW revision. The on-mixer change IS possible with the new slim version, perhaps even a switchable version could be made.

If doing the change on the mixer, we can increase the input resistors to 200k, or reduce the gain resistor for the two outputs. 

 

Tests

 

Cell 1 

Without resonance 

Tested with a direct input through a 100k resistor, no resonance, full filter sweep:

Max input triangle

LP1: -9.6 to 8.5 in, -8.5 to 9.3 out (but with slight compression)

HP1: -9.7 to 8.5 in, -9.3 to 8.6 out

BP1: -9.6 to 8.5 in, -4 to 5.5 out (no clipping at all)

BP1 gained: no clip either

Max input saw

LP1: -9.6 to 9.4 in, -9.1 to 8.9 out

HP1:-4.9 to 4.7 in, -4.9 to 6.1 out

BP1: no clip, also gain is not possible to measure properly

BP1 gained : -6.9 to 6.7 in, 

Comment: HP is very high above 0 but not very much below. 

Max inputs square

LP1: -9.1 to 8.6 in, -8.6 to 9.1 out. Locks up with too high input!

HP1: -4.3 to 3.9 in, -5.9 to 4.8 out.

BP1: No clipping 

BP1 gained : -6.8 to 6.3 in, -9.3 to 0.8 out (but not proper measurement as no square out)


With resonance at 0 (= full):
- NB: The clipping we see is always at 10V so it may be that it clips in the probes/logic analyzer before actually clipping. Op amp clipping is still fairly close though.

With resonance 

square: 

In general: self oscillation in sync, with freq as low as 4 x base freq, may clip. 

Also, self resonance at base frequency, once started, is unaffected by input amplitude. 

LP1: 

"normal reso": -9.8 to 9.7 in: -4.4 to 4.9 out

"in sync reso": Self reso, in sync, clips slightly. Independent of input signal amplitude

BP1:

"normal reso": -10 to 10 in: -4.8 to 4.9 out

"in sync reso": Self reso, in sync, clips slightly. Independent of input signal amplitude

HP1:

"normal reso": -10 to 10 in: -5.2 to 5.3 out

"in sync reso": Self reso, in sync, clips slightly. Independent of input signal amplitude

 

Saw: 

LP1:  

"normal reso": Self reso clips slightly when at a multiple of signal frequency, is not affected by changing input amplitude. When more than four times base frequency, no clip. For higher frequencies: -9.5 to 9.3 in: -3.5 to 5 out.

"in sync reso": -4 to 3.8 in, -10 to 10 out.

BP1:

"normal reso": -9.3 to 9 in, -2.5 to 2.5 out

"in sync reso": -4 to 3.8 in, -10 to 10 out, very slight clipping

HP1:

"normal reso": Clips when in 'sub sync', four times base freq for example.  

"in sync reso": -9.3 to 9 in, -4 to 3.8 out


Tri

LP1: 

"normal reso": -9.5 to 8.5 in, -2.9 to 1.9 out

"in sync reso": Hard to get a stable error, but clips a tiny bit sometimes when input is -9.5 to 8.5

BP1:

"normal reso": veldig lav output

"in sync reso": Hard to get a stable error, but clips a tiny bit sometimes when input is -9.5 to 8.5

HP1:

"normal reso": -9.9 to 8.5 in, -3.8 to 3 out at most.

"in sync reso": -2.5 to 2.0 in - very hard to get a stable error but clips a tiny amount at almost at any input. 

 

Cell 2 

Without resonance 

Tested with a direct input that has not been through Cell 1. First, no resonance:

Max input triangle to cell 2 through 150k that does not clip internally during normal filter sweep:

LP2: -9.6 to 8.6, out as -5.4 to 6.4 (inverted)

HP2: -9.6 to 8.6, out as -6.2 to 6 (inverted)

BP2: Doesn't really clip visibly but mostly because it never passes a clean triangle 

  

Max input saw to cell 2 through 150k that does not clip internally during normal filter sweep:

LP2: -9.7 to 9.5, out as -5.4 to 6.4 (inverted)

HP2: -8.1 to 7.9, out as -4.6 to 6.3 (inverted)

BP2: Doesn't really clip visibly but mostly because it never passes a clean triangle 

 

Max input square to cell 2 through 150k that does not clip internally during normal filter sweep:

LP2: not possible to see any clipping since output is also completely square. Output stops changing when input is +/-10V

HP2: -7.3 to 7.2, out as -6.4 to 5.3 at start, slants. (inverted)

BP2: Doesn't clip visibly, 10V in is -5.9 to 5.8 out.

 

So, max -7.3 to -7.2 in for a clean signal for all waveforms, that does not clip normally. 

 

With resonance 

With resonance at 0 (= full):
- Clipping is always at 10V so may be clipping in probes

square: 

LP2, BP2: 

"normal reso": -5.3 to 4.9 passes 

"in sync reso": -3.9 to 3.6 passes 

HP2: 

"normal reso": -5.4 to 5.8 passes

"in sync reso":     -2.7 to 2.4 passes 

 

Saw: 

LP2: 

"normal reso": -6.9 to 6.8 

"in sync reso": -6.7 to 6.6 

BP2:

"normal reso": -8.6 to 8.5 

"in sync reso": 5.7 to 5.5 (a bit unsure about this one)

HP2:

"normal reso": -6.4 to 6.2 

"in sync reso": -4.3 to 4.2 

 

Tri

LP2: 

"normal reso": +/- 10V approx

"in sync reso": -5.5 to 4.8

BP2:

"normal reso":: +/- 10V approx

"in sync reso": -4.4 to 3.8

HP2:

"normal reso":: +/- 10V approx

"in sync reso": -4.9 to 4.3



A possible fix, testing

 

Reducing output of mixer to +/- 2.5 instead of +/-5
 

Testing first with a square wave, -2.7 to 2.34 in

Measuring max output

Cell 1 

LP1

Normal: -2.9 to 3.3

Normal reso: < 5x base self osc: max +/-5V, normal reso -2 to 1.7 max

In sync reso: clips very slightly

HP1

Normal: -6.5 to 6.5 at max normal, but some kind of self oscillation when cutoff is too high

-- This is probably the param to watch, if this does not clip we can perhaps accept that reso clips? 

Normal reso: Up to around +/-6 at extremes.

In sync reso: Clips slightly

BP1

Normal: Around +/-2.5V (Normal with gain: -3.5 to 4)

Normal reso: Around 2-3V (With gain: Up to 8 but never clipping)

In sync reso: Clips slightly (With gain, clips more but still only at sync)

AP: 

-7.9 to 7 - but uses gained BP. Try again with non-gained BP?

 

Cell 2

 Measured at the output of the SVF, before the post filter gain stage. The post gain stage is 100/65 for LP and HP,  100/100 for cell 1 direct and 100/60 * 100/65 for BP

A 150k input resistor is used instead of 100k + 56k during testing, so gain is very slightly different. 

LP1 + LP2

Normal: -1.9 to 1.85

Normal reso: Above sync reso there are still tops up to 8V, but most max out at around 5 and "normal reso" is something like 2.5V

In sync reso: Slight clipping. Below sync frequency the output still high, up to 8.

HP1 + HP2

Normal: -4.75 to 4.6

Normal reso: Up to 8.5 at extremes. Never clips

In sync reso: Clipping starts much earlier than for HP1 alone

BP1 + BP2

Normal: -0.9 to 1

Normal reso: Maxes out at 7.5, more normal at 2

In sync reso: Clips the same places as BP1 but slightly harder

BP1 gained + BP2

Normal: -1.5 to 1.5

Normal reso: Maxes out at 9 but never clips

In sync reso: Clips slightly earlier.

 

Lower resonance

Resonance set at 0.2 in software (which is really 80% since pot is backwards).

Input: 2V square wave. 

Output without resonance: 2.2V


Cell 1

LP1:

Normal resonance: peaks at around 0.8V, flat part at around 0.3V

In sync: 3.2V 

BP1:

In sync: 3.2V 

HP1:

In sync: 3.2V 

 

Cell 2: NB: Raw outputs, no post cell gain: 

LP1 + LP2:

No reso, fully open: 1.5V NB! Means we have to have a post gain that will make in sync output higher!

Normal: 1.5V

In sync: 4.9V

BP1 + BP2 (no BP1 gain, raw output of BP1 fed into Cell 2 through 150k resistor) 

In sync: 5.1V

HP1 + HP2:

In sync: 6.2V 

 

Gain

Gains outside the SVF itself

Post cell 1: 

  • BP 1 gain: 1.47 

Post cell 2 gains are as follows:

  • Cell 1 direct: 1
  • LP 2: 1.54
  • HP 2: 1.54
  • BP 2: 1.67 * 1.54  (67 to make BP 2 unity gain I guess) 

 

Estimated outputs of cell 2 with gain:

LP1 + LP2:

Normal: 2.31

In sync: 7.55

HP1 + HP2:

Normal:  ?

In sync: 9.55 

BP1 + BP2:

In sync, NO additional gain: 7.85

In sync, WITH additional gain after Cell 2: 13.1 - clips massively.

 

In other words, without BP2 makeup gain, all pass fine.

Also, it's highly likely that a normal output will never clip in a (modified) Juno filter. In sync resonance will however likely clip. 


BP, AP and Notch with no extra gain

To prevent clipping, we reverse the additional gain for the BP output. That also requires changes to the AP and notch circuits: 

The current circuit:

Three resistors must be changed:

  • The input resistor to the BP inverter, R151, must be 100k for unity gain
  • The unfiltered input to the Notch circuit, R148, must be replaced with an 82k resistor
  • The unfiltered input to the AP circuit, R145 and R150, must be replaced with a single 75k resistor 


This leads to an approximate change of approximately -3dB for the BP/AP and notch outputs.  

 

Juno

 
Version 1.1.1 of the voice card has a Juno output gain of 100k/18k = 5.56, as the filter itself attenuates the input to 1/5. 
 
NB: version 1.1.3 of the voice card has changed the output gain circuit: output has a 100/39 = 2.56 gain op amp, so gain through the filter is at 0.5 (NB! Also inverts signal). This means output of core must be around 4V (10V/ 2.56) to not clip, including the in sync resonance. Previous measurements showed that in sync reso could get up to 6V, meaning it clips. This must be retested with a 5V and 2.5V max input.
 
Also, this means that even with a lowered input, we still need to attenuate both SVF and moog to match juno. 
 

Output before post gain:

 

Max input 

square: -1.6 to 1.7 at input of filter, -0.25 to 0.42 at juno output, would be 1.34 to 2.3 after post gain.

Can't get higher than 4.4V in from mixer. Will try chaining.
 

Things that may still clip, at least with 5V input

- 12dB HP filter chained through Juno if juno has resonance turned on - 12dB SVF filter outputs peaks at around 2x input. A 5V signal in will give 10V peaks around the cutoff frequency. This will appear at the Juno input which expects a max of 5V, and will likely clip there.

- SVF: Self oscillation with frequency same as signal base frequency will clip no matter the input amplitude (Cell 1 at least, and at full resonance. Lower resonance and 2.5V input does not clip.

 

Thoughts

 

If reducing to 2.5V max out of mixer, normal input to juno will also be 2.5V. Since we currently don't allow mixing chained signal with "bus B", whatever ends up at juno is what came out of SVF. 
 
The highest "normal" signal through the SVF is HP1 at 6.5, which after the final gain will be around 10V. This will probably still clip in the Juno filter. Test this.

Would reversing the order fix tings? Reducing input to max 2.5V, then reordering? What is the max out of the juno filter, and how would that affect the SVF? Also, what is the effect of changing the order, sound wise? It would require the juno filter to have unity gain (like it does now), so it depends on what happens if input is max 2.5V.

Monday, August 3, 2026

DAC on the same bus as DCO. Also, DCO nightmare...

As I'm preparing to put a 12bit DAC on the SPI bus shared with DCOs and the bit crusher, I had to make some changes to how to communicate with the DCO. 

 EDIT: I've written the code in a way that supports 3 bytes per DAC update so even 16bit DACs are supported in theory. For 12bit DACs, only two bytes are needed)

The DCO expected to receive three bytes with a 9us delay between sends and the CS line toggled only at the end of the last byte.

First I rewrote that, to accept single bytes. Then I changed the format so the first byte started with 1 and then had a fire bit command. The two last bits + 2 x 7 bits from the next made up the 16 bit frequency for example. That way, we can sync on the first byte instead, as it's the only one with a 1 as MSB.

Anyway, the bus can at best run at 4MHz when communicating with the DCO, or else each bit length becomes too short for the PIC16F. At 4MHz each bit is 0.25us long.

I want to run the DAC at 2ch * 48kHz = 96kHz. But if the DCO sends all its bytes in one go, it would take up too much time in a single period, preventing a stable DAC update frequency.

At the same time, I want to run the CV updater and DCO updates at 6kHz (well, ideally I wanted to update the CVs at 12kHz, but I can't seem to get a stable 192kHz interval (CV updating is split into 16 updates, 16 * 12kHz = 192kHz) so I think I have to settle for 96kHz. This fits well with the DCO which cannot be updated faster than 8kHz anyway, so 6kHz it is.

So, I came up with a system of 16 slots (96kHz/16 = 6kHz), each 1s/96000 or 10.4us long. The DAC can send its 3 bytes (with no delay between) in any slot, it would take slightly more than 6us. 

That leaves around 4us. Sending a single byte will take around 2us, so we can let any other peripheral send on the second half of the slot. Also, since DAC and DCO will be mutually exclusive (per channel), the DAC may send at the start and any other device (e.g. BC) in the second half. Also, by separating DCO frequency updates and DCO commands (sync, range etc) into separate slots, we can send both within a single 16slot cycle.

Anyway, I implemented this - and then the nightmare started.

The DCO had massive errors to the slope - every cycle overflowed, the saw was no longer a saw.

I spent almost two hole days debugging. Was it the protocol change, some previously untested code changes to the DCO or something in my controller code? 

Turns out, it's likely a problem with the MikroC compiler (again). When writing two chunks to the PIC internal FLASH rom, one with DAC values and one with DAC slopes, the values one got written to both positions! I am not sure if this started to happen now, but it would be weird if it has been that way for a long time.

The solution is to calculate the slope on the fly (it's simply a subtraction). But when I removed the code for writing the slope to FLASH, everything failed. So now I still calculate and write slopes during calibration, I just don't use it. 

I truly hate the MikroC compiler. I really need to port everything to MLabs.

In the process of figuring out what was going on, a few other things happened. First of all, one of the DCOs got stuck at a single frequency. Turns out, one of the SPI pins got pushed in/up through the board (cold solder joint probably). Then, another DCO simply didn't want to calibrate properly. It took a long time to realize that this only happens at the bottom end of the frequency spectre, around 40Hz and lower. At the moment, I think the DAC simply cannot supply a low enough voltage, so every cycle overshoots.

Then disaster struck. I put the DCO in the programmer backwards, sending +12V into one of the SPI  pins. The MCU still works, but SPI has stopped working so it's trash.

So right now I'm two DCOs short, and I have only one that can be calibrated down to the lowest frequency. Not sure what to do about that, but the others work down to around 40Hz which is good enough I guess. We'll see what the rest end up with.

Oh, and I managed to fix a long lasting bug - when changing to a lower frequency, the first cycle would end early because the previous interval's timer wasn't stopped. It seems to work fine now. 

BTW: I had another weird issue that I didn't get to the bottom of. One of the DCOs managed to reach all the way down to 4-5Hz, while the others only managed 8. I think 8 is right. Maybe the first one ran at half the expected speed (16Mhz instead of 32MHz)? 

BTW2: I first suspected that the overflowing waveform was caused by the interpolation between calibrated points being wrong. It did have something to it, the interpolation will be off by a few percent, bulging towards the end. But not as much as I saw. However, this lead me to try without any interpolation at all, just using the calibrated value for the start. That worked pretty well, it only sags by a few 10s of a volt at the end. Pretty interesting, by doubling the number of measured points we could maybe get away without the interpolation. 

BTW3: There is something strange at the startup of the DCO, when hammering the synth with midi, it feels like the DCO lags/hangs, before suddenly doing all the changes. This has not been investigated further.

Tuesday, July 21, 2026

Digital oscillators on the XM8

After deciding on creating a wavetable oscillator for the XM8, I've thought quite a bit about the digital oscillator structure. Here is my current solution

 

Two physical DACs

First of all, I will add a new PCM5102 I2S stereo DAC. This has built-in oversampling etc to prevent aliasing-noise. However, in old synths there were a lot of aliasing, which is part of what we now recognize as the vintage sound. I don't think the PCM5102 can recreate this.

However, my initial idea was to use the DAC8830 on the DCO boards for wave duties as well, and have the DCO MCU do the heavy lifting when it comes to wavetable morphing and other interpolation. The DCO DAC was then followed by an analog reconstruction filter.

 

The DCO as a DAC proxy

I now have a new idea. Let's instead use the DCO MCU as a simple DAC proxy. By copying the incoming SPI signal to the output whenever the DCO is in "direct to DAC" mode, the MCU doesn't have to do any work. We could probably speed up the SPI bus to max and easily get 44.1kHz (or 48kHz) sample rate on the DAC. The only thing left to solve is when to interpret the DCO incoming data as bytes directly for the DAC - we could increase bit length to 24 and use the first as command, but perhaps that makes it harder to use Teensy Audio. It should be possible to use custom SPI DACs with Teensy audio so let's hope this works. If not, there is still an available utility pin on the DCO that can be used for mode switching.

We would also have to send the chip select for the DAC, but only after two received bytes, not 1 as on the PIC16F SPI.

We can also get rid of the recon filter, after all the only reason we do it this way is to get the aliasing. Also, it would be possible to reduce the bit depth to 12bit if we want etc.

 

DAC routing

The analog board already has an input for digital waves per DAC, and a switch to select between that and the waveshaper output.

We can reuse that - and in place of the current reconstruction filter, we'll put a second switch selecting either PCM5102 or DAC8830. We also need the circuit to center and amplify the output from the DAC8830. Currently it's at 0 to 3v3. Finally, we need two available pins on the Teensy for controlling the switch.

 

Modifying the v1.0 Digital voice controller 

This requires the use of two additional pins on the recon filter socket - one for the PCM5102 input and one from the Teensy to control the switch. We should also cut the paths from the PCM5102 to the ext input (cut on the digital voice card side).


Summary

It will be possible to use one of three modes per oscillator: DCO, high quality audio DAC or aliasing basic DAC. It won't be possible to combine DCO with the other two at the same time on the same oscillator. I think this is a fair limitation that makes operation of the oscillators simpler - what you see is what you get, if you switch oscillator mode you also switch its output.

  

Sunday, June 28, 2026

Wavetable oscillator

I need a more precise sine wave than I have at the moment, with a larger range than I can get from the DCO.

That gave me an excuse to go ahead and create the wavetable/PCM oscillator I've been thinking about - there's a slot on the digital board exactly for this.

My colleague Alexander used a PCM5102A DAC for his project, and after taking a closer look it seems this was the ideal choice for my oscillator as well. Even better, I realised I had a breakout board with that DAC already, from Aliexpress, so I could go right ahead and test it!

Here is my layout:

CLK: GND

BCLK: Teensy pin 21

LRCLK: Teensy pin 20

DATA: Teensy pin 7

 

NB: All data/clock pins have a 22Ohm resistor on them to slightly slow down the edges. This is both suggested by the teensy communit (100Ohm) and the breakout board (22Ohm). 

The rest of the configuration pins are already taken care of on the breakout board, but in any case they are:

 

DEMP: GND (Deemphasis off)

XSMT: +Vpp (Soft mute: un-muted)

FMT: GND (I2S)

FLT: GND (normal latency) - I've made this configurable in my circuit

 

For the rest of the pins, see my schematic: 

I've added two inverting gain op amps that brings the output up to +/-5V. FLT (filter latency) is configurable and can also be disconnected from the control pin by cutting the solder jumper.



 I've already implemented wavetable morphing, through any number of wavetables. I've added the four basic waveforms (sine/tri/saw/square) and converted the Prophet VS wavetables into a format that I can use. It sounds amazing!

Right now the oscillators are routed through the ext pot. I originally intended wavetable oscillator duty to be performed by the DCO circuits, so there's a switch between DCO and waveform after the waveshaper on the analog board.

Now I'm not so sure anymore. It would be nice to not use the ext route. Instead, wavetable-osc could be routed directly to the mixer, and to have separate volume control per osc. Instead of having one channel per wavetable oscillator I could let one channel go to each of the busses. I can mix the oscillators digitally instead, and have digital volume control of them.

This is much more flexible. I can use both DCOs and WT at the same time, or I can make them mutually exclusive in software. The only issue is that DCO and WT have to share the same panel pot, meaning we no longer get knob-per-function if both DCO and WT are available at the same time. Then again, this could also be configurable... 

Saturday, January 3, 2026

Power-up sequencing

As there is a significant amount of power needed for the synth, it may be a good idea to not turn on everything at once.

Fortunately, the DC-to-DC converters have CTRL-pins on them. Setting this to GND disables the output, and setting a logic high turns on power.

I have not found the exact voltage needed for logic high on the converters I use (YLPTEC URA2412YMD-20WR3), but elsewhere I've found 3.5V for similar converters. Testing with direct connection to the 3v3 output pins on the Teensy was successful, but I'm still a bit skeptical about doing this "in production", in case it doesn't work.

The solution is to level shift the signals. At the same time, I don't want to invert the signal, so a simple transistor level shifter would require multiple parts.

My solution: Use TTL-compatible CMOS, the 74HCT series. By connecting the supply to 5V, the output logic will be 5V. At the same time, the input is 3v3 compatible. I've tested this with a 74HCT08 quad AND gate and it works perfectly.

Adding 4.7k resistors to the output makes sure the output stays at GND as long as the power is off (? these are not tristate outputs, so not sure this is a good or even needed solution. Perhaps a pulldown on the input instead or in addition is better) 

 I've ordered two cmos chips for testing:

74HCT164, a octal output shift register - this lets me control all voice card power using two pins of the microcontroller. There is no inhibit though, so the outputs have to be turned on in sequence

CD4504 - hex level shifter, with dual supply pins. 

We'll see what feels best later. I guess a power distribution board with some logic on it will be worth considering.

Monday, December 29, 2025

Secondary SMPS testing

I ended up ordering a batch of five DC-to-DC converter boards from JLCPCB. They take 9-36V in and gives +/-12V out, at 833mA per rail max. The voice cards draw 500mA per rail so that's about perfect.

 

To test everything, I found a 19V 2.4A power adapter from an old laptop. It measures 19.8V out which is fine. 

 

To keep the output within range of my Logic2, I used a resistor voltage divider with 100k on top and 200k on bottom, which should give us 8V out.

The DC-to-DC converter has no trimming option, so we're stuck with whatever it outputs. My multimeter says 12.05 and 11.98V, which I think is good enough for Rock'n Roll. 

I tried measuring the output, and while it's hard to know everything that affects the signal, here is my initial findings:

The output fluctuates between 7.797 and 7.807V, or 10mV. (or two steps on the Logic 2. The real fluctuation may be a bit higher).

 


 

It looks like the noise has a period of around 8uS, which means about 125kHz. Again, it's hard to tell if this is real and if it is caused by the converter itself, but this is what I got.

10 cycles take 81uSlog

 

I don't think I have any way of measuring ripple more closely than this, so next up is seeing if this is audible. 

Sunday, December 28, 2025

Dell adapters - are they useable?

I found several Dell laptop chargers on Finn ("Craigslist"), rated at 180W and 240W, 19.5V. 

I have no idea if they're any good when it comes to switching noise, but I've bought a 180W one for testing.

The adapters have a 7.4mm/5.0mm barrel connector, with an inner pin of < 1.0mm. I've found a 7.5mm/5.0mm connector from JLCPCB rated at 15A/30V, which should be ok even for 240W:

https://jlcpcb.com/partdetail/XUNPU-DC_505ACL060/C30607513

Also, I've found second hand wire harnesses from Dell laptops, that converts the barrel into 6 x 19.5V, 6 x GND and a single wire for signaling. It is hard to figure out what the ratings of these are. I've tried searching for the ones used in the top-end laptops, the ones most likely to use the 240W PSU. So far I've landed on the "0J60G1 / J60G1 / DC301015A00", which is used in some of the Dell Alienware PCs. 

I've ordered a cheap version off Ali Express, along with a 7.4mm/5.0m PCB connector and a 7.4 to 4.5mm converter with 20AWG wires inside - these are too thin for my fully spec'ed synth, but will let me cut the wire to get access to the wires, letting me measure ripple etc. 

I may also end up cutting the plug of the 180W charger if I get impatient, it was only about $15 on Finn. 

As for the center signaling pin, this is quite interesting - it lets me read the type of charger plugged in - I could for example check if the wattage rating is high enough for the synth. Not a big deal but a nice addition if I want to do proper power management - after all, I think I have full control of powering up the secondary SMPS'es - if the PSU is too weak I can leave the voice card unpowered.

So - Dell adapters, are they usable for what I want to do? Time will tell...
 

Making the circuit tolerate switching noise

This is a big one. Even the secondary SMPS'es will have some switching noise, perhaps as much as 80mV. 80mV on the VCO pitch CV will be a disaster. 

Let's assume for a second that the ground rail will stay somewhat clean and the noise is only present on the 12V/-12V power rails (not sure if this is true though).

As far as I understand, most op amps will not care much about this noise, they go about their business regardless, so I will have to look at other places the supply voltages are used. One place immediately springs to mind - the base voltage for the 1V/oct input on the VCO. This is connected via a resistor to the power rail. I may be able to get around this by using a voltage reference instead.

Most other stuff in the circuit is hopefully more resilient to noise, as the noise will mostly affect the amplitude of the signal. We will probably have the same issue around filter frequency and resonance controls. 

In short, I have to go through the voice card and modules to look at where the power rails are used directly. 

I suspected this would come back to bite me - I've read several times that one should not use the power rails as reference voltages, but it's so darn convenient, they're already there. Oh well, you live, you learn... 

Sunday, December 14, 2025

It needs more power!

Each voice card draws approximately 500mA from +12V and another 500mA from -12V.

My current Doepfer PSU supplies 1200mA per rail, so I can drive two cards from that.

Also, I see that the rails sag a bit, to 11.6V when fully loaded. That may be trimmed but who knows.

 

Anyway, time to start looking for other solutions. Here are some quick google results:

DIY High Power Supply

https://aisynthesis.com/eurorack-high-power-supply-build-guide/ 

dual 2.5A 12V and single 2.5A -12V. Uses an off-the-shelf regulator module, URB2412LD-30WR3 from Hi-Link: https://www.hlktech.net/index.php?id=165, which is able to step down up to 24W to 12V. It's powered from a 19.5V 6.92Amp PSU

 

 

100W and 70W PSUs with some of the same style but with additional circuitry

https://konstantlab.audio/shop/hammerpwr-100w-eurorack-modular-power-supply/ 

https://konstantlab.audio/shop/seventypwr-70w-eurorack-modular-power-supply/ 

 

Another 5A variant:

https://www.exploding-shed.com/befaco-trolley-bus/100453

The issue with all these are that they don't give me 5A on the -12V rail.

 

A nifty breadboard version:

https://www.exploding-shed.com/clacktronics-proto-psu/100597

 

Another breadboard version that looks like it can be used for my dual ground standard (outer power rails are +/-12V, inner are ground)

https://www.exploding-shed.com/transient-modules-breadboard-supply/100407

 

----

I consider using separate regulators near every voice card.  

Perhaps an URA2412LD-20WR3 can be used, it's supposedly +/-12V, +/-833mA, which is plenty for each channel.

There is also a similar URB24_YMD-20WR3 which has half the footprint. I can't see what else is different.

 

---

DIY:

https://nozoid.com/diy-eurorack-power-supply/

https://sdiy.info/wiki/Comparison_of_Eurorack_DIY_PSUs 

https://metatronicmods.weebly.com/store/p3/PSU-linear-old.html

https://www.my-adaptor.com/a135a022p-rev03-m-84108.html - adapter 

 

Tuesday, November 4, 2025

Midi proxy/Voice assigner

A tiny but exciting win today - I wrote the first line for the XM8 main controller, more specifically a midi proxy/distributor that copies all incoming midi to separate outs. This will let me support multiple voice cards without rewriting the interface (yet).

More importantly though, the proxy does a round robin voice assignment, so instead of forwarding note on/off messages directly, it sends the next note on to the least recently used voice (and makes sure to send note off first, at least for now. This paves the way for polyphony, which is something I've litteraly been waiting a decade for!

As for the communication, I use the serial TX and RX pins directly, from a Teensy 4.1 TX to a Teensy 4.0 RX. It worked immediately, no external components necessary.

It should also be possible to send MIDI at a higher bitrate, right now it runs at the standard 31250bps, I expect that at least 115200 should be problem free.

Don't cut the red wire! 
I'm actually reusing the original voice card controller prototype board for the MIDI proxy, as it has everything needed for receiving MIDI onboard and exposes pins for all the teensy pins. 

Next up is connecting two full voice cards. I can't wait, this is sooo cool!
 

Monday, October 13, 2025

Testing new cards

I'm testing the new cards that arrived this summer - in particular the digital voice card controller

Errors found

VCO: 

- Square wave is probably inverted, just like on the previous version of the waveshaper

- When properly tuned for 1V/oct, the lowest frequency is > 8.1758 which means the VCO cannot be both calibrated to 1V/Oct using trimmers AND reach all MIDI notes. A fix is to add a 1.5MOhm resistor from the summing point (or before the secondary 1V/Oct input jumper) to -12V.

To do

- Tune VCO

- Trim WS 

To test

- VCO frequency vs waveshaper and square wave generator, is the phase inverted?

- Lowest possible frequency for VCO, looks like trimming down won't go as low as DCOs?

- Recon-filter and wave output from digital board, including switching on the analog board

- Control pins on the digital board, though since midi works we know we can control everything. 

What works

- Distortion! :-D 

- Noise

- VCO waves in general

- WS wave mixing is now perfect 

- Midi input on digital card

- DCO tuning

- CV DAC control with 5V and 50MHz signal (3v3 also works but only at 40MHz)

- Rear soldered header on the Teensy 4.0 

- I2C port expanders 

- Winbond W25Q128 flash chip integration from Teensy. Not tested with DCO but uses same circuit. Was tested with W25Q128_test.ino (adapted from https://github.com/msnbrest/W25Q128)

- PCB output /recon filter on digital board. However, output is 0-2V, e.g. not bipolar and not a big enough range.

Wednesday, September 24, 2025

Cleaning up the UI

I'm about to make a prototype of the UI, and have been cleaning up the grid a bit. This is what it looks like right now:

 

Inspired by the Matrixbrute, I started adding boxes around the related parts. The spacings are way off, but it should give some idea as to how things are grouped:


 

I do have some problems with this though. The vertical slits don't line up, in fact, they make the whole thing look a bit messy. 

I did also make a ready-for-lasercutting mode, that adjusts all line thicknesses and changes pot and button sizes to fit the shafts, ready for prototyping. Here is the left panel again:


 Now, to see if I could do any better, and after looking at the Waldorf Quantum, I came up with the following (crude) version


 It follows a slightly more logical structure, with the sources top left, then the mixer and post-mixer effects. It also groups the LFO and Arp in two separate two-row areas which gives a nice balance. There is not quite enough room for everything, especially the Arp controls, and I've decided to remove the bit crusher level pot as it isn't particularly useful. I do like this quite a bit. 

Then I decided to color the current version too, and to my surprise, I think it looks cleaner than it did with the "real" colors:

I think I can make both versions work. I will prototype the finished version now, and perhaps I'll have time to revisit the second version in the future.

As for the right side - it also needs a bit of cleanup, there is no room for the frame here, and I guess I should redo the filter to work better visually on the 8 row grid if I choose to go with the modified left side. 

 

I also think I'll probably ditch the post-filter bit crusher as that can be done by a general DSP, and maybe I'll make a smaller group of pots and no screen (or small oled screens?) for the DSP part. I have even been thinking about doing per-voice FX, or at least chorus, though that would mean not using the FX send lines. We'll see.

Sunday, May 18, 2025

Distortion v1.2

I forgot to add the output gain op amp to my distortion circuit, so the output was 1/11th of what it was supposed to be. Here is a corrected version:

 

In the previous version, I buffered the output from the resistor voltage divider. This is not necessary as it is fed straight to the positive input of the distortion op amp, so I could use that op amp for output gain instead.

At 5V CV the output is unity gain, whereas it distorts at 0V.

A +/-5V signal passes undistorted through when cv is 5V. A +/-10V signal distorts slightly. The output never reaches higher than +/-9V so no clipping.

With CV = 5V and input 10Vpp, output is 10Vpp undistorted

 
With CV = 0V and input 10Vpp, output is a nice distorted signal at around 14Vpp


With CV = 5V and input 20Vpp, we get a bit of distortion, output is around 16Vpp

Finally, With CV=0V and input 20Vpp, we get heavy distortion, but the output is still not more than 18Vpp