mandag 31. desember 2018

Juno/jupiter VCA and resonance CV

I just discovered something surprising.

First of all, my Juno CV runs the output VCA at very low currents, less than 0.2mA, while the LM13700 can be driven up to 2mA.

I have started researching this to see if I can change the CV to get unity gain at 5V on the JP6. For some reason I expected the control circuit to be converting a linear CV to an exponential one, because I didn't think the Juno had it in it to do this elsewhere. But it makes perfect sense I guess, this lets us generate both linear and exponential envelopes in software.

I took a closer look at the juno 106 schematics and discovered that the CV present at R37 in my schema is not 0-5V. It is actually an adjustable voltage, amplified right after the DAC. It is adjustable from min 0.2V/max 10.3V to min 0.32V/max 10.42V.

Now, this means that the max current at the control of the VCA is about 0.3mA, It is not a major change but it is something at least. And without having to worry about changing the response curve of the VCA CV control, I can change the max control current easily.

As for VCA gain adjustment, I can either chose to add a slightly higher than unity gain and adjust this in software, or add a adjustment pot. A CV summing point may be a good idea anyway

PS: Without adjustment, CV below 0.6V will give 0V out due to the diode drop of the transistor.

A closer look at responses for the Jupiter 6 filter

NB: This post was written before i discovered a missing 33k feedback resistor. Results are not correct

To make a good state variable filter with 12/24dB HP, LP and 12dB BP I simulated the JP6 filter and tapped it at various places to look at the responses.

For my simulated circuit, setting cutoff CV to 0.2V (this has nothing to do with 1V/oct CV btw, look at the circuit to see exactly how it is wired) and Resonance CV to 10V (=off, see this post for details), gives the following results:

24dB LP:
- Cutoff: 507Hz
- Resonance (3V CV): 14dB at 953Hz

24dB HP:
- Cutoff 2kHz
- Resonance (3V CV): 13.7dB at 1.05kHz

12dB HP + 12 dB LP
- LP cutoff: 1.77kHz
- HP cutoff: 574Hz
- Center: 1kHz
- 10dB attenuation on top
- Resonance (3V CV): Top has 13dB amplification

12dB LP + 12dB HP
- LP cutoff: 1.77kHz
- HP cutoff: 574Hz
- Center: 1kHz
- 10dB attenuation on top
- Resonance (3V CV): Top has 13.5dB amplification

12dB LP with connection to second stage
- Cutoff: 666Hz
- Base attenuation 1.35dB
- Resonance (3V CV): Top has 6dB amplification over base at 885Hz, base is -1.26dB

12dB LP without connection to second stage
- Cutoff: 666Hz
- Base amplification 1.6dB
- Resonance (3V CV): Top has 7dB amplification over base at 885Hz, base is 1.6dB

12dB LP with connection to second stage
- Cutoff: 1.38kHz
- Base attenuation 1.2dB
- Resonance (3V CV): Top has 6dB amplification over base at 1kHz, base is -1.18dB

12dB HP without connection to second stage
- Cutoff: 1.4kHz
- Base amplification 1.7dB
- Resonance (3V CV): Top has 7dB amplification over base at 1kHz, base is 1.7dB

søndag 30. desember 2018

Moog style ladder filter for the XM8

I have simulated a ladder filter for the XM8. It is based on various designs found around the net - I've studied the original moog circuit, the Schmitzbits one, the Yusynth one, the modified ASM-1 for emphasis voltage control and not least the Memorymoog (which is probably the source for the ASM-1) for the output VCA.

Cutoff CV is 1V/octave, using a 100k resistor to the mixing point at the negative terminal of U10. The point labeled cv in the schematics has a 0.5V/octave response, to allow 10 octaves of control using 5V CV.

U9 tunes tracking, it should be approx 18mV (17.5 - 18.2mV, depending on temperature) for a 1 octave increase.

U4 sets initial frequency (freq when CV is 0). Adjust to whatever you like.

U11 sets output symmetry.

I have suggested two alternatives for R16 and R24 - choose the one with the range you need for the input voltage. the 10Vp.p alternative will probably distort for higher amplitudes while the 20Vp.p is probably more noisy as it attenuates and amplifies more to run the core at the same amplitude.

Simulated circuit

Juno filter for the XM8

UPDATE: This filter circuit has some limitations to its maximum cutoff frequency and high frequency tracking. I will post an updated version that adresses these problems.

I have simulated a Juno filter, based on various designs found on the net. I have made a few deviations from the original Juno filter:

- Frequency tuning happens before the frequency 1V/oct mixing point. The Juno has if after, which means that chaning the tuning also changes the tracking. My change may have messed up other things, no guarantees there. My version makes it easy to set the base frequency over several octaves. NB: The resistor and pot values in my schematics may not be ideal.

- Input audio is attenuated heavily. In my simulations, anything above 1V p.p gets distorted. I have chosen to allow +/- 10V audio. R29/R30 do the attenuation, and changed values for R27 and R26 make up for it in the output stage.

- Resonance control is 0-5V but highest possible resonance equals what we would get from 10V in the juno. This corresponds to a maximum control current of 0.25mA, approximately what I found in the specs in my post about the ba662. I still need to see how this works out i practice. The control curve is different too.

- Output is now in phase with the input

- Filter has unity gain at 5V CV (or slightly above it).

- Freq CV in the schematics is 0.5V/oct to get a 10 octave range from 5V CV, the summing point has 1V/oct when using 100k input resistors.

I have suggested two alternatives for R26, R27 and R38 - choose the one with the range you need for the input voltage. the 10Vp.p alternative will probably distort for higher amplitudes while the 20Vp.p is probably more noisy as it attenuates and amplifies more to run the core at the same amplitude.

R26 may be replaced with a 100k resistor and a 200k potentiometer (for the 20Vp.p version) to be able to tune the output VCA max amplitude.

U15 adjusts tracking, U14 sets initial frequency, U16 adjusts output symmetry.

PS: The filter may be tapped after the second pole (the output of U4) for 12dB instead of 24dB response.

Simulated circuit

0 - 10V resonance (original circuit from Juno 106). 1V/step
0 - 5V resonance, modified circuit. 1V/step

Still to do: check response curve for the VCA CV.

torsdag 27. desember 2018

Filter fact

If current per Hz is constant, a doubling of current gives a tone one octave up, because it will double the frequency.

This is independent of what current gives what frequency, i.e. what cap/resistor values are used. Those are only used to set the base frequency/frequency at a given current.

The filters I've researched do not have a quite constant current/Hz ratio. It is however flat enough to use this fact even though the actual cutoff will be slightly off.

(and by frequency I mean the cutoff frequency, where attenuation is 3dB).

onsdag 26. desember 2018

Minimoog filter research

I'm trying to figure out a bit more about the minimoog filter, to be able to use it in my XM8. I've started by simulating a circuit. I first drew up the Yusynth version, but thought the results were a bit odd so I switched to the Schmitzbits one. I later realised that I probably should have used a 0-10V CV with the Yusynth one to cover the full frequency range, this worked well with the Schmitzbits one.

Anyway, first off I will have a look at the current-to-frequency ratio. Both filters are trimmable so that the initial freqyency offset may be set. To chose a sane offset I will figure out how the core responds to currents. This is the simulated circuit:

I got the following measurements. The -3dB point has been read manually by setting the CV and
running ac analysis with frequencies from 20 to 20kHz in LTSpice. I tried reading the current simultaneously but it seems to vary a bit with frequency. For consistency I did a new run with a fixed frequency of 1kHz and read the current from there.

Plotting the Hz/uA vs frequency gave this:

What we see is that the Hz/uA is a bit higher at the start and then stabilises at around 36Hz/uA (or 0.027uA per Hz).

I tried validating the results by connecting a current source to the common emitters:

Current is what I set the current source to. Expected freq is what I would get if the control current was linear and 27nA/Hz. Measured is what I got. It matches the previous measurements closely.

There is however an important weakness to my measurements. At low frequencies, there is actually a dampening for all frequencies. At 0.84uA the top of the response curve is at -10dB. Similarly, at high currents (500uA) the top is at 1.39dB. This has not been accounted for in the table above. The -3dB falloff is from the TOP of the curve for that current.

Response at 840nA

Response at 500uA

I still think we get usable results, something we can use to set a nice offset current with U3.


I was curious what would happen if I changed the cap values from Schmitz to Yusynth, i.e. 22nF to 47nF. Turns out that by doubling the capacitance, you also double the amount of current needed per Hz. Not really that surprising when you think of it at it takes twice the current to charge the cap with the same speed.

In practice, this means that by doubling the capacitance, but leaving the rest of the circuit - including the control voltage - the same, the cutoff frequency will drop by one octave - see the last column of these measured values:

I then changed the Yusynth variation to use the input/output stages from the Schmitz version to see how all the small changes affected the circuit. Here is a screenshot of the results:

and the circuits for reference:

Quite interestingly, the Yusynth version has a 5kHz cutoff at 10V CV with similar settings as the Schmitz. Tweaking U3 will change this however, for example, a wiper setting of 0.85 instead of 0.92 will result in a cutoff at 14.6kHz instead.

I noticed that I had unintentionally kept the 56k resistor from the Yusynth circuit in the output part of these. Removing it has no effect on the output.

Replacing the 27k on the input with the 10k from the yusynth on the other hand, increases the output from 1.5dB to 9.9dB. It does NOT change the frequency response however, so attenuation on the input and gain on the output will not change the measurements in this post.

Caps and resistors

In general, increasing or decreasing a capacitor value will change the absolute cutoff value a certain control current will result in. But it probably still holds true that doubling the current will double the frequency and thus give a cutoff one octave up. I assume the same is true for changing the resistors between the steps in the ladder.

The Yusynth calibration scheme tells us to make sure the base of Q16 is at 18.2mV when the CV is at 0V, and that it increases by 18.2mV for every additional volt. This is presumably similar to the 17.5mV I have written about in my doc on the exponential converter, but with a slightly different temperature (without temperature compensation, the expo converter requires 18.12mV per octave at 30 degrees celcius).

When one has this dialed in, we know that one volt increase means one octave up. We then need to set the correct starting point by adding a current, which is done using the U3 potentiometer. In other words, the 1V/oct scaling is independent of the caps and resistors used.

Tuning range

By setting the tuning pot to its extremes, we get:

Yusynth with Schmits i/o (47nF):
wiper 0, CV 10: LP: 31.2kHz (HP: 23Hz)
wiper 0, CV 0: LP: 94Hz
wiper 0.96, CV 10: LP: 94Hz
wiper 0.90, CV 0: LP: 31Hz (but with an initial 9dB attenuation)

Schmitz (22nF):
wiper 0, CV 10: LP: > 100kH (HP: 21Hz)
wiper 0, CV 0: LP: 1.1kHz
wiper 0.96, CV 10: LP: 937Hz
wiper 0.94, CV 0: LP: 37Hz (but with an initial 10dB attenuation)

CV control of the emphasis (resonance)

I originally thought about controlling the resonance using an OTA-based VCA. While googling this, I came across a circuit that appears to be from the ASM-1. Initially, I could not get it working with an LM13700 in place of a CA3080, so I started thinking about other synths with moog filter and patch storage. The Memorymoog came to mind after I failed to find the schematics for the little phatty. I found the sheet, and guess what - it is almost the exact same circuit as the ASM-1. I simulated it and it looks good. The resonance is a bit low but I need to try it in real life to see if it is sufficient.

The filter core itself has a nA per Hz of about 33nA/Hz, or 30Hz/uA. The tracking seems quite linear all the way up to around 5kHz.

There is a difference between the response curves of the minimoog and the memorymoog filters. At high frequencies, the minimoog has a HPF part as well, as high as 100Hz for the most extreme settings. This is not there on the memorymoog.

The memorymoog (right) has no visible HPF part above 20Hz

Filter for the XM8

I've tweaked the ASM-1 filter a bit, to get unity gain, 0.5V/oct response from 0 to 5V (to get 10 octaves from a 5V DAC) and a fairly high resonance. I have not yet breadboarded and tested this but it looks promising.

Suggested circuit

I also tried adding an OTA in place of the output opamp, as per the memorymoog circuit. While it works, I get massive distortion at the output, even with very low control currents. I will have to simulate this to see if it is real. The non OTA output may have to be tested to find a suitable gain too, but the values above look promising.

søndag 18. november 2018

PG-200 busy line

When building the MPG-200 for the JX-3P, I discovered that the busy line is hardwired via a pullup resistor to +5V, in effect tying it to logic high.

Because of this, I decided to ignore it altogether. But when trying to get the MPG-200 to work with the MKS-30, I discovered that this synth actually DO control the line.

So what actually happens when the busy line is pulled low?

As expected, the PG-200 does not transmit anything while the line is low. Still, I was curious what happened afterwards, when the line was released again - did the PG-200 just ignore whatever had happened during busy, did it queue up events or did it send the new stable status?

Well, a bit of both really. It keeps the last state from before it was blocked. Then, once busy is cleared, it sends first the state it had before blocking, and then the state after blocking. This happens for both switches and potentiometers.

lørdag 17. november 2018

Fooled by running status. Again and again.

The midi protocol is not very complex. But one thing keeps making me trip: Running statuses. You can send a status byte, and as long as you don't send a new status byte you may keep sending data bytes for the same status. This is very convenient when sending for example filter sweeps etc.

In my work on the MPG-200 this has made me trip several times. Because:

The source for my midi data has mostly been my Moog Little Phatty. It sends running statuses of course. But when I reboot my mpg-200 without restarting the LP or playing a note, the LP don't send the status message again, and the MPG-200, having just booted, has no way of knowing what it is receiving as it has not seen any status message. It has fooled me more than once.

Today it happened again, but in a more subtle way. I have spent the last week trying to figure out a very strange bug I noticed after a large refactoring of the MPG-200 code: After changing the CC for the filter cutoff using sysex, things worked fine when sending the correct CC from my sysex/web midi based pg-200. But after rebooting nothing worked. Sending a sysex clear memory somehow reset things and the CC started working again.

I stripped down the program to the minimum and it still happened. I discovered though, that sending a midi note on had the same effect. Today I had time to think more thoroughly about it and came to the conclusion that it could not be the part of the program that treats the received bytes, it had to happen on reception. So I hooked up my logic probe to the midi rx line and watched what came into the MPG-200.

Guess what - after a restart, the web gui, knowing nothing about the restart, did not resend the status message. That explained almost everything, I had tripped in the running status issue again. But a little more research uncovered a few other interesting things:

Sending a midi note on from the LP actually reset the running status, so the status message was sent again. This surprised me, how does the web gui know that the LP has sent a midi on? I also tried to refresh the web gui to 'restart' the midi interface, but this did NOT work, it still did not send a new status message.

Then it dawned on me. I am using the LP as my midi interface. It is the LP that holds the state, NOT the web midi adapter! So even if the web midi did restart, the LP knew it was currently sending a particular CC, and so did not resent the status - and of course sending a note on merged into the same data stream and made the LP resent the CC status later.

Oh well, I am just glad I figured this out, even though it's a bit embarrassing.

torsdag 9. august 2018

Checking the Xonik Linear VCA performance

Way back in october 2017 I did some research on the BA662 clone. To my surprise I got massive distortion when trying to get unity gain out of it. This made me fear that my Xonik Linear VCA had the same issues.

Yesterday I simulated the circuit:

At 5V CV and 5kHz sine input, I got unity gain with no visible distortion. I then doubled the frequency:

I still didn't get the kind of distortion I expected, but I got SOME distortion (see the blue graph).

Now, this isn't good. I tried both with and without the output filter cap, no change there.

I am however using LT1001 opamps in place of the TL072.

Today I breadboarded the circuit, first without the output cap. The results were very promising. I could see no visible distortion, not even at 20kHz:

Changing to a triangle wave at 40kHz showed a slight distortion at the top of the curve:

Changing again to a square wave showed severe ringing on the output:

I then added a 33pF cap:

It worked wonders for the other waveforms as well:

I then experimented with a lot of other cap values, here are some:



18pF and 10pF in parallel

22pF and 22pF in parallel

It seems that 33pF is still the best match (or 18pF + 10pF if one wants a tiny ring instead of a rounded edge). It has to be said though, that this is not a very scientific method, and it has a huge error factor in that the breadboard itself may contribute massively, making the capacitance higher than expected. 

Just to make sure that I wouldn't get a significantly better result with a lower CV and higher compensating gain, I replaced the CV resistor with 6k8 and the output gain resistor with 22k (I did however not replace the cap. The filter frequency is 1/2*PI*R*C (presumably), so in doubling the R I also halved the output frequency, leading to more rounded corners:

I only realized this right now while writing this post. Still I think the results are quite good, the selected values seem ok though I have to test with both a 33pF and a 47pF cap (specified in the circuit) on the final board to see which one is best.

Anyway, my conclusion is that the Xonik Linear VCA is still a good choice.

fredag 3. august 2018

Bootloader working!

I finally got the midi based bootloader for the mpg200 up and running. I have yet to test it with the mpg200 code but a short test program uploads fine. So happy right now :)

torsdag 2. august 2018

Summer 2018 - DAC Mux, Ring mod

Summer is always kind of productive for me. While off on summer holiday to the western parts of Norway, I get time to do some electronics work. This time I've drawn up and ordered a 16 channel sample and hold circuit (DAC mux) to replace the 32 channel one used in the prototype. This one is easier to place and makes it possible to use only 16 channels for parts of the synth.

I also did a v3 of the linear VCA. This time, as for the first version, the trimmers are off-board, but the components are placed on both sides as in v2. The whole card is sort of a double width DIL thingy with the pins for one VCA on one side and the other on the other side. I imagine it possible to place it in a socket and have other parts of the circuit below it - we'll see.

Finally, I did a ring modulator based on the one from, which in turn is almost entirely a copy of the one in the datasheet. This one uses a surface mount MC1496. The circuit and board are finished (but untested), including logo.

Oh, and I have written a midi/sysex-based bootloader - it's almost finished. I will feel much better if I can remotely update any MPG-200 I sell. The bootloader is very simplistic and does not have any flow control, so sysex uploading must be done through a program made by me. Still better than not being able to update at all.