mandag 25. mai 2020

Little Phatty overload is just soft clipping

From the time I studied the Little Phatty to build my moog filter, I have wondered if the LP does pre-filter distortion of the signal or if it uses feedback for its overload.

From the Little Phatty schematics it is clear that overload is just soft clipping, and the circuit is extremely similar to what I did for my distortion with in-feedback-loop OTA :-D

The LP:

There are a couple of differences: The moog circuit uses both inputs of the OTAs, and also the same CV (though inverted) for both increasing the amount of distortion and reducing (?) the output gain. A nice trick to keep output at the same level I assume.

The overload CV also controls gain/attenuation of the filter output it seems.

TIL: The little phatty has an analog signal path from pots to synth circuts

I read a reddit thread this morning about a guy that is doing a synth controller front panel. He had the novel idea of switching between using the pots directly to feed an analog voltage to the synth circuit (filter cutoff cv etc) and using voltages from a DAC to do the same. By simultaneously reading the voltage from the pot for patch storage, it would then be possible to load a patch and have a dac generate the required voltage to control the synth, but switch to direct-from-pot cv when the user turns the pot to prevent stepping.

The original poster was immediately beaten down by the knowitalls of Reddit, saying that this was overly complicated and that noone would do it like this.

He countered by claiming that he had looked at the circuit board of a Moog synth and seen analog multiplexers close to each pot, and rationalised that these did what he was thinking about. He also claimed that a video told him that this was the way Moog did it.

Another poster then proceeded to post the schematics for the Slim Phatty, explaining how it was clear to see that the circuits were indeed digitally controlled.

I had a closer look at the schematics and discovered that the original poster was indeed right (though possibly not about exactly how it was done) and the one posting the schematics wrong - the Slim Phatty (and by extension Little Phatty) DO actually have the ability to switch between direct control and digital control. Have a look at this:

The filter pot. Its value is buffered by an opamp (U29), which is then both tapped directly (FILTER_CV) and sent to an ADC through AINO.2 for digital processing/storage.

Digital control: CV from the DAC is buffered by a sample and hold circuit and output as FILT_CUTOFF_BUF

A switch then selects between the CV tapped directly from the pot (FILTER_CV) and the digitally controlled voltage (FILT_CUTOFF_BUF). Notice how FILTER_CV is sent to multiple outputs, depending on what mode is currently selected for the pot.

The selected voltage is sent to the board connector as FILT_CUTOFF...

...and received on the voice bort as FILT_CUTOFF (pin 33)

There, it is mixed with CVs from other sources (modulation etc) into the filter cutoff CV FILT_CONTROL

Finally, FILT CONTROL controls the cutoff frequency of the ladder filter. Thus there is a completely analog signal path from pot to filter.

When I went back to post my findings on Reddit, the original poster had already done so. He pointed out that this is called RAC (tm) in the Slim Phatty manual - "Real Analog Control".

The discussion went on to saying that this must be a marketing trick more than having real value, and funnily enough saying that it had do be something only the phattys use because "the memorymoog and prophet 5 does not do it". I call bullshit on this.It may be true that it is only found on the phattys, but comparing it to 25 years older synths is no way of proving it...

søndag 24. mai 2020

Noise tested

I tested the first board tonight, the triple noise. Two external parts are needed, a 2N3904 with the collector unconnected, the base connected to GND and the emitter connected to IN, and a 50k trimpot for adjusting the gain of the input.

It works perfectly. Rainy white, oceany pink and deep, rumbling red noise. Mmmm... I breadboarded this back in 2017 and had a lot of fun playing around with it with my then 3 year old daugter. "Daddy, can we go listen to the rain?"

Both orders from JLCPCB has arrived!

Finally, after waiting for over two months, the second order from JLCPCB arrived yesterday. I now have loads of circuits to test:

- JP6-style SVF
- Juno-style OTA filter
- Moog-style ladder filter (but this requires some soldering)
- 4ch mixer
- 4 way VCA
- Three types of CV/sample and hold
- Noise
- VCO, CEM3340 w/waveshaper
- Waveshaper
- Led ring

The quality is overall very good, though I have found at least one solder bridge and and one of the led rings appear to have been slightly reworked (oh, and I've already broken a led, but that was my own mistake).

Some pics:

4ch mixer and VCA, with room for v2164 or similar

Top: Waveshaper. Bottom: Ring modulator and 4ch CV buffer

VCO, DCO, two versions of S&H for CV buffering, DAC.

torsdag 7. mai 2020

LED dial light pipes, second try

I did some more testing yesterday. I moved the connection points for the slits to the inside of the circle, tried engraving to make room for the leds, tried engraving slits to make them not go all the way through and made a black circle for the center.

Unfortunately I fucked up bigtime when cutting so everything is covered in oily brown residue. But I can still test the concepts.

Initial conclusion: Engraving room for the leds does not work at all. The diffuser has to be some distance from the LED, having it on top of it made the result very blurry. It may be a combination of this and light leakage between the cells, but it seems we get the best result when we have completely separate (cut) cells 'projecting' onto a diffuser.

The previous version with connection points on the outside and a simple diffuser still works the best. It may be that 3mm light pipes (i.e. 3mm plexi) is better to focus the beams.

There is also a lot of light leakage between the cells in the unengraved 2mm version. Not sure if this is because of the short light pipes or the moval of connections from outside to inside. Mostly the edges of the slits light up for at least the two neighbouring cells.

As for trying to make the cells bleed a little to get a continous bar, I feel that that did not work very well at all, the edges get blurry very quickly so I probably have to accept that they are slightly separated.

Using clear 3mm pipes with a 0.3mm spacing to the diffuser gives a continous bar but with slight bleeding. May be acceptable if we want a bar. No spacing will give an extremely sharp edge which is also very cool.

Further testing
- Is engraved room for led combined with cut cells working?
  a: somewhat but not very well

- Are engraved slits working or significantly worse?
  a: not conclusive but may achieve the same with a spacer

- what works best, connection points inside or outside the circle
  a: outside seem slightly better.

- will dividers between the cells improve bleeding
  a: Definitively, but needs to be dark color

- should we cut dividers even closer to minimise contact points?
- Is 2mm (or close to 1mm really) worse than 3mm for light pipes

- diffuser - should it be a continous ring or start and stop at the ends of the led ring?
- diffuser - try individual cells? Does it look cluttered?

I think that the diffuser may be less visible if it is a full circle and not divided into cells, especially once it is red.

onsdag 29. april 2020

LED dial light pipes

For the XM8 UI I want led dials around the potentiometers/encoders. I've sent a prototype of the led ring itself to production, and now I had a little time to quickly test some ideas for making it look as nice as possible.

If possible, I want to have a continous ring clockwise from the left to where the current setting is. It may draw too much current, but for now that's my goal. I also want the end of the ring to be as sharp as possible - and in the event of having to use a single led at the time, having as little leaking light from the current led to the ones next to it. Finally, I want the light to be as uniform as possible.

To get distinct sections along the ring, I'm trying out light pipes, one for every LED. They need to have as smooth as possible sides to reflect the light and keep it contained within the pipe, and they must be separated to prevent leakage.

As I'm not sure about exactly how to do this, I made several prototypes:

For the two first ones each light pipe is actually a separate piece of plastic. I thought that painting the sides of the pieces and glueing them back together could be an option.

Number three is a variation where all the parts are still held together at the edge. The gap between them is whatever the laser leaves behind when cutting the acrylic.

Row two: The first one is just to have somewhere to glue the pieces from the center one in row one, as I could not be bothered making the cut lines shorter.

For the center one, I've made the slits between the segments a little wider, my theory was that this would reduce leakage.

As for the four last ones, they test the second design goal - uniform light. Wherever there is black on the drawing there will be engraved white on the acrylic, effectively making a diffuser. There are two diffusers where I have not cut any lines, they will be used on top of the light pipe, and two where the segments themselves were diffused.

I quickly realised that painting and glueing the parts together is not a viable option. The parts are too small and there are too many of them.

The ones with laser-thin slits actually have quite wide slits as it is, so there was no need to widen them.

As for diffusers: Putting the diffuser on the segment means that the slits are still visible. Not a great look.

I also wondered if the diffusing layer should be on top or bottom. It definitely needs to go on top, as the light has to spread before it hits the diffuser.

To test the combinations I taped off a normal led so that it is as narrow as one segment. I put the diffuser layer with the diffuser down against the layer with the segments. The diffuser is clearly visible, the slits are mostly hidden. I would like the diffuser to be less visible, but I think that using red acrylic may help a lot here. Each layer in my test is 3mm btw, so this builds 6mm in addition to the height of the leds.

LED with tape on it to make it more narrow
Segment layer
LED below one of the light pipes.  
There is almost no light leakage between the light pipes, I am really satisfied with this result. There will definitely be visible lines between each segment though, so I may have to experiment with engraving instead of cutting the slits, to allow a little bleeding at the top. An air gap between the layers may also help.

Notice thast the gaps are slightly visible. I think this will improve slightly once the pot is put in a case as there will be no light coming from behind.

With a randomly chosen cap on top. I think this looks great! This diffuser is 4mm wide, I also have one that is 2mm, making each segment almost square. I will test both to see which one I like the most. I will also put black acrylic in the centre of the ring (on the segment layer), and the diffuser layer will be cut so that only the ring protrudes through the front panel.

torsdag 9. april 2020

Distortion breadboarded

I've breadboarded two versions of the distortion circuit, both with input attenuation and output amplification to keep a 10Vpp signal almost untouched.

Pre-distortion amplification

First I did the version with pre-distortion amplification. With distortion CV at 0V the distortion circuit sees around 30mVpp. This is heavily amplified to distort.

At the other end, a second OTA amplifies the signal. The output has unity gain for a 10Vpp input when CV is around 2.5V.

Hard clipping circuit with pre and post distortion VCAs

Hard clipping, distortion CV from 0 to 5V

Soft clipping circuit with pre and post distortion VCAs

Soft clipping, distortion CV from 0 to 5V

This circuit worked pretty much as in the simulation. I do have some issues with CV feedthrough so centering is not perfect when distortion changes.

I think I have to bite the bullet this time and introduce AC coupling to get rid of this. Placing a cap in series with the 1k resistor to the distortion op amps negative pole seems to do the trick, and will function as a high pass filter as well (beware though, if not chosen correctly low frequencies will not be distorted, in fact they will be attenutated.

Distortion CV at 0V

Distortion CV at 2.5V, almost full distortion and more than double amplitude

Distortion CV at 5V, full distortion. Signal is clipped unevenly by the op amp.

Distortion CV at 2.5V, almost full distortion

Distortion CV at 5V. Very similar to half distortion.

It seems that the real life circuit sees a higher maximum input gain than the simulation. Full distortion is reached much earlier. Also, compared to the OTA in feedback loop version below, the CV response seems exponential, not linear.

OTA and parallel resistor in feedback loop

Then I tried breadboarding the OTA-in-feedback version. I had lots of trouble and could not get it working as expected at all. After much experimentation I ended up with a well functioning circuit. I then started documenting the changes, and realised what was going on: I had inadvertently put a 33k resistor in the feedback of the distortion op amp. This works in tandem with the signal fed back through the OTA, so it completely changes the amount fed back.

As a bonus, the CV control of this version seems to feel much more linear - in the other version all changes came at the start of the CV and very little later. Also, the soft clipping amplitude seems to stay very close to 5V, so in some ways it feels more "correct", the volume doesn't increase as much.

After discovering my error I simulated this circuit too and it works as on the breadboard.

PS: The distortion CV now works in reverse: 0V is max distortion, 5V is no distortion. Unity gain through the circuit is the same as above, approximately 2.5V.

OTA and 33k resistor in feedback of op amp

Soft clipping

Hard clipping, starts very soon after turning the distortion pot.

OTA in feedback loop without the 33k resistor

Now I went back to the circuit that I was TRYING to breadboard and looked at the simulation again. I think I got lost because I couldn't get it working the way I wanted to. Looking at my previous Distortion post, I realised that the hard clipping starts much later, and so the output has a higher amplitude when clipped than in my happy accident.

I then changed parts back to my original design and did some tweaking, resulting in this circuit:

OTA and no resistor in feedback. Soft clipping version

OTA and no resistor in feedback. Hard clipping version
Soft clipping

Hard clipping

Results on the breadboard for versions with OTA in feedback loop

The circuit on the breadboard have some small differences from the simulated one. The output amp uses a 120k resistor instead of a 150k to get unity gain at 2.5V CV. I left the 180pF (Low pass filter) in place, and used 1k pots instead of the resistors to ground on the OTA inputs (except for the distortion OTA in the version without resistor in the feedback.

The potentiometer settings used were:
VCA pot: 620 ohm to ground on negative input, 365 ohm to ground on positive input
Distortion pot: 479 ohm to ground on negative input,  512 ohm to ground on positive input in distortion OTA. For the version without a feedback resistor I breadboarded it as in the schematics.

All oscilloscope pictures are of a 473Hz 10Vpp input wave. Vertical resolution is 5V/square. Output VCA CV is at 2.5V which according to the simulations should give us unity gain for undistorted signals.

First, the circuit with both an OTA and a 33k resistor in the feedback, soft clipping:

Triangle wave, soft clipping selected and distortion CV is at max (5V) meaning least amount of distortion. Output is equal to input
Same as above but with distortion CV at 0V, meaning max distortion. Amplitude only changes slightly but output is heavily distorted.

Hard clipping:

Same as above, but this time with hard clipping. 5V distortion CV, No signs of clipping and still unity gain.

Again same as above, hard clipping, but with 0V distortion CV/max distortion. Heavy clipping and just slightly higher amplitude.

Without 33k resistor in feedback

Now for the circuit without the 33k resistor in the feedback loop. This didn't work very well, the clipping became very asymmetrical. This may be due to the high attenuation of the input signal? I tried replacing the resistors at the positive and negative OTA terminals with a 1k resistor but that didn't change things. Maybe an HP filter capacitor would help?

Soft clipping:

Soft clipping, max distortion CV. The signal passes unclipped but with the output VCA CV at 2.5V the amplitude is only around 7Vpp, and also not symmetrical around 0V.

Soft clipping, no distortion CV. Heavy but unsymmetrical clipping. Amplitude is almost the same as for the previous circuit.
Hard clipping:

Hard clipping, max distortion CV. Same as soft clipping, no surprises there.

Hard clipping, no distortion CV/max clipping, looks very similar to hard clipping for the other circuit except that the clipping is unsymmetrical.

Pre and post OTA breadboarded

510 ohm resistors instead of trimmer for version with 33k in feeback

I tried replacing the 1k trimmer pot on the distortion feedback OTA with two 510 ohm resistors to ground. That gave the following result:

The input is now distorted, meaning the OTA sees a too high voltage.

By measuring the position of the trimmer potentiometer for the distortion feedback OTA when signal does not clip at 10Vpp input (750 ohm), and using the resistor divider equation, I found that the distortion OTA sees +/-165mV. Going the other way, a resistor divider with 15k and 510 ohm will yield the same result. Here I have done the change:

When tweaking the potentiometer I could see that clipping starts right after I started turning the potentiometer. Since there may be production differences, an even smaller input resistor would give a litte room for trimming the input digitally. Here is the effect of 12k, a slightly smaller amplitude:

I also tried replacing the trimmer in the VCA OTA part, that heavily offset the output. It could be possible to use AC coupling here, but we would still get uneven clipping in the VCA at high gain, so it might be best to use a trimmer.

I also did see a slight distortion at minimum distortion CV, but this is probably not related to clipping.

510 ohm resistors in the simulation

In simulations though, it does not work very well:

Signal is much smaller than in the breadboarded circuit when no distortion CV is applied.

I am not sure I will do any more work on this now, I have a well functioning circuit that I will test with some "real" signals instead later (the one with the extra 33k resistor in the feedback, 12k on the input and 120k on the output).