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 yusynth.net, 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.