Monday, December 30, 2013

Quad saw revision 1.1

Following the debugging of the revision 1 board, I've updated the quad saw PCB. It now has a coarse tune input (oscillator 1+2 and 3+4 are tuned together) with the posibility to add a jumper wire directly to -15V if one does not want a coarse tune input.

I have also changed the power input to a four pin version that includes panel ground (Oakley Sound Systems-style) and turned all connectors 180 degrees.

Oh, and most importantly, the outline-corners have been rounded off ;-)




Sunday, December 29, 2013

Oh well - some errors are to be expected

While trying to tune the oscillators I discovered two errors. They are both easily fixable but important. First, I had used 100k instead of 10k pots for the wave balance pots, which means it was impossible to get a good balance around 0V. I replaced the pots and it worked very well.

Second, both this quad oscillator and my stock yusynth oscillator seemed to have a very high-pitched response to 0V CV. Only after reading through the text on the yusynth.net site did I realize that the coarse tune pot is not centered around 0. Instead, the maximum counter clockwise setting is 0 and the max clockwise setting is 10 (not sure if that means 10 octaves though). This means that in order to function "normally", I have to add a 270k resistor connected to -15V to my design as I have no coarse tune pot. It's not a big problem but one that will have to be adressed in a version 2 of the oscillator. I should also concider adding either an octave rotary switch or at the very least an octave/coarse tune input. As I have run out of space on the PCB, I think the pot will have to affect all oscillators, not only one, meaning all four oscillators will be tuned to the same range. Two four-oscillator cards could of course be tuned differently though. I may even be able to squeeze in two inputs so that groups of two oscillators may be tuned differently.

One final note: I have used 100k resistors for the wave amplitude amplifier input. Mr. Usson states that one may have to use an 82k resistor here and I can see why. My saw wave output has a +/-4V amplitude instead of the expected 5V, swapping the resistor may help.


UPDATE: Fixed!
Four 270k resistors soldered directly to the back of the board, with a common wire to -15V. The molten plastic gunk is clearly visible too. What a shame.

Saturday, December 28, 2013

Quad oscillator oscillating!

After a false start this morning, I managed to get my quad saw oscillator card up and running tonight. At first, it seemed like nothing worked, but after switching to another set of oscilloscope probes and probing from the start to the end of the circuit, it turned out it was working after all. Great success! :-D


The unpopulated PCB

My first ever try at soldering surface mountable components. It wasn't hard at all, just put some solder on one of the corner solder tabs (on the PCB), hold the part with SMD tweezers and solder the first corner. Then do the same to the diagonally opposite one. When they are done and the chip is adjusted to it's correct location the rest is easy.

The completed PCB. I tried cleaning the board with isopropanol, with disasterous results. The cleaning left white residue all over the card. In retrospect I suspect that the residue is in fact from the toothbrush I used for cleaning...


Oh... and to round up the post - of course an electronics enthusiast needs an electric car, so I bought this amazing vehicle, the Tesla Model S :-D It's a beast!

Two versions of the sub oscillator under production

Last night I sent two prototype versions of the sub oscillator for PCB production. The "normal" single sub oscillator with the cool inverted saw thing, as well as a stackable quad sub oscillator that can be used for my 7-saw/polyphonic modular project. The quad version will need a separate controller card as well, to be able to select the type of wave and polarity etc for eight sub oscillators at the time.

If successful, the single sub oscillator is destined to be the first official product from Xonik Devices, my new brand. All future projects will be released under this name.

Tuesday, November 26, 2013

Sub oscillator board finished

Last night I finished the initial version of a sub oscillator PCB. It is based on the circuit in the previous post, but since I had one flip flop to spare I've included a two-octave down square wave as well as a 25/75-duty cycle pulse wave, similar to (and heavily inspired by) the Roland SH-101. The kind of square wave to output is selectable by a three position switch.

The board measures 30 x 100 mm, with 3 mm screw holes 4 mm from all sides, and should fit behind a 6HP panel. Cut-outs have been added near the input, output and switch connectors, to be able to mount the board with the components facing backwards and then route the cables to the front without adding any width to the module. This makes it possible to adjust the saw wave matching trimmer after the PCB has been attached to the panel.

The board has a slight shortcoming related to the pulse output - since the average voltage over one cycle is not 0V, the centering capacitor will not center the wave around 0V but slightly lower. This has no effect on the sound of the output but may lead to unwanted effects/clipping in subsequent modules/when mixing waves. I have still provided the pulse output as an option because it only requires two additional parts and may be useful to someone.

Sunday, November 24, 2013

Updated saw suboscillator

I have been working a lot on the saw divider circuit lately. Last night i finalized a prototype that works for all audible input frequencies. It can also use both saw waves that start high and ramp down and the ones that start low and ramp up, as inputs.

The circuit has two outputs - saw and square wave, and the saw wave has two modes - frequency division and a more exotic one where the frequency is sort of both doubled and divided. Have a look at the pictures later to see what I'm talking about.



The divider works on the same principle as earlier, by shifting half of the saw teeth up and then reducing the amplitude back to +/-5V. However, it now uses fewer parts than my initial prototype and achieves more. Instead of using an offset voltage to center the wave around zero, it uses a capacitor to do the same thing. I've also added input and output buffers to the flip flop, and the rather complex voltage dividers used for the square wave have been replaced with a resistor ladder and an op amp buffer instead. The need for trimmer pots has been reduced to a single one, and all resistors are from the E12 standard values. The need for a RC-network between D and not Q of the flip flop also disappeared once I introduced the buffers.

The input is connected to a switchable inverting/non-inverting op amp buffer. The comparator used to make the initial square wave needs the input saw wave to ramp down to output the correct square wave necessary to generate a saw wave on the output. If your input wave ramps up instead, flip the buffer polarity switch. Running the "wrong" kind of saw wave through the comparator will lead to an interesting, useful and very nicely sounding output, so feel free to try both polarity settings independently of the input wave.

You may also use other input wave types. The output won't be a saw wave, but will have a frequency related to the input frequency, and be within the same amplitude range. Try it out!

In addition to the saw output, a square wave output with +/-4V amplitude is provided. This will work independently of the type of input wave (well, for "normal" waves anyway) and always have close to a 50/50 duty cycle.

The single 100k trimmer pot (I use a 20 turn one, but any multi turn will do) adjusts the matching of the two saw teeth that are combined to make the new half-frequency wave.

Output

These pictures show the various modes in real life. The scale in all pictures is 1 square vertically = 5V.

Saw wave

First, the saw wave output when the input is not inverted:

Input wave

Output wave, half frequency

Input and output shown at the same time

Inverted saw wave input

Then, the saw output when the input has been inverted (the input itself is the same but the invert switch has been flipped):

Input wave
Output wave - notice how it forms a crude saw wave of half the frequency but with the opposite phase as the input wave and made up of four small saw waves. It sounds great.
Input and output shown at the same time
The reason why we get the strange wave is that the square wave used to lift half of the input saw tops has been shifted 1/4th of a cycle, so instead of lifting a whole saw tooth, it lifts half of one and half of the next one.

Square wave

Finally, the square output. As a square wave is already generated to shift the saw up/down, making a square wave output is only a matter of scaling the amplitude to the correct +/-4V range:


Input wave
Output wave
Input and output shown at the same time

Sunday, October 6, 2013

Saw frequency divider

In my previous post I described how to make a frequency doubler for a saw wave. Now, more often synths have a frequency divider/sub oscillator. These are usually square wave oscillators, but I wanted one that would work with saw waves. After an initial idea and a lot of trial and error I have finally come up with a working circuit. It works on the same principle as the frequency doubler, i.e. it shifts parts of the wave up and down to achieve the saw form, but instead of cutting each sawtooth in half, it combines two teeth to make one with twice the duration.


The central idea - half of the teeth are shifted up to double the frequency


Dislaimer: Allthough I came up with the concept of this divider myself, I've since found that the core of the divider is quite common, even to the point that the good old Roland SH-101 uses the same trick - with the same 4013 flip flop :-D. I have yet to see a saw version though.

Some of the interfacing tricks are from Horowitz and Hill, and the RC combination to slow down the feedback in the flip flop are from a site elsewhere on the net (can't remember where right now),

Here is how the divider works:

1) The input saw wave is fed through an op amp set up as a comparator. This turns the +/-5V input saw wave into a +/-15V square wave, 15V whenever the saw wave is >0V and -15V when it is < 0V.
Saw wave is turned into a square wave by the comparator. Each vertical square equals 5V, so the saw wave is +/-5V and the square is +/-15V.


2) The signal is fed into a D-flip-flop. The internal protection diode in the flip flop chip chops off most of the negative voltage, so the Flip-flop sees a square wave of about 0-15V, in effect a clock signal.

3) The D-flip flop does the main work, and it works like this: Everytime the clock goes high, the value on the D input (0/1 e.g. 0 or 15V) is copied to the Q output. The inverse value is copied to the "not Q" output. The trick now is to connect the "not Q" output to the D input. In this mode, the Q will change state between 0 and 15 everytime the clock goes high. This means that it will take two input pulses to generate one output pulse, which means that the flip flop is a frequency divider, dividing by a factor two. In many synths the output from the flip flop is connected to a second flip flop to get a divide by four-frequency divider. This makes it possible to switch between 1 and 2 octave sub oscillation. In this circuit however, only the divide by two is used.
Input vs output of the flip flop.  Negative part of square wave is chopped off at the flip flop input. Notice how every high pulse on the input results in a change of the output. NB: The horizontal scale of this picture is half that of the previous one, so the input here are the SHORT pulses, the output are those with the same length as the ones in the previous picture. Also note that the small "ticks" in the middle of each horizontal line are because I forgot to ground the flip flop...




The flip flop output compared with the input saw wave. The square wave is positive for every second saw tooth, i.e. has half the frequency 


4) Now we have to turn the square wave with half the frequency back into a saw wave. Like with the frequency doubler we achieve this by combining the original signal with the square wave. But instead of shifting parts of the original wave closer to the 0 volt line to spit it in two, we shift then further apart to combine two saw teeth.

5) Before combining though, we have to adjust the amplitude of both the original saw wave and the square wave to keep the result within a 10v p.p. range. Also, because the square wave is not centered around 0V (unlike the square wave used in the frequency doubler), we have to add an offset voltage. The outputs of the three operations are summed to give the resulting half-frequency saw wave


Original saw wave

Resulting saw wave. The spikes half way through the wave are presumably caused by the spike at the start of each wave, though this has not been confirmed

The two waves compared. It sounds great!


The circuit looks like this:
Notice: The square wave in the top right corner is wrong, it should start at -5V, not 0V.



A few things to note about the circuit:
1) The 12k resistor between the comparator and the flip flop limits the flow of current into the chip as it can only handle about 10mA of input current. (page 578, Horowitz and Hill)

2) A 2k2 resistor and 100nF capacitor has been connected between the "not Q" and D ports of the flip flop, to delay the signal between the ports slightly. Without these I could not get my flip flop working. I find this a bit odd since other designs usually do not have these.

3) The output from the flip flop is buffered by an op amp in buffer configuration before it is used in other parts of the circuit.

4) Like the frequency doubler, the next stage is an attenuator (amplifier with gain < 1), found here. It turns the 0-15V square wave from the flip flop into a -5-0V square wave. NB: The wave is inverted, +15V turns into -5V.

5) the same thing is done with the saw input, it is attenuated from a +/-5V wave to a +/- 2.5V wave. Summing the square wave and the saw wave will result in an output with a 10V p.p swing, just like the input signal.

6) However, the signal goes from +2.5V to -7.5V. To adjust the symmetry back to +/-5V, we add a DC voltage of 2.5V, which comes from the 100k potentiometer and is buffered by yet another op amp buffer.

There are a few issues about the circuit though, and it should not be considered final.

1) First of all, because of the 12k resistor after the comparator, the input to the flip flop has a slow slew rate, which is a problem at high frequencies. I started seeing (and hearing) problems due to this at input frequencies > 10kHz. Using two MOSFET transistors for interfacing may solve this, I have not tried that yet.

2) The comparator may "bounce" when crossing 0V (i.e. going between +/-15V very fast), which will lead to multiple clock pulses going into the flip flop. This can be solved either by setting up a hysteresis configuration, using a comparator with built in hysteresis or passing the signal into a CMOS buffer with built-in schmitt trigger before the flip flop.

3) Likewise, the output from the flip flop may be connected to another CMOS buffer like the 4050, this may remove the need for the op amp buffer (I have not tried this yet - see page 586 in H & H).

Thursday, September 12, 2013

Saw wave frequency doubler

After listening to Grant Falkenburg's demo of the JP8000 on youtube, I realized that it would be cool to have the option to add a secondary wave to the output of the super saw oscillators, one octave lower than the original frequency.

This got me thinking about how to create a frequency divider, which in turn led me to come up with a way to create a frequency doubler as well.

I have dreamt up both the divider and the doubler, but only the doubler has been breadboarded and tested. My initial design was revised a few times and the current design seems to work fairly well for frequencies up to at least 5kHz, and looks ok but with a little bit distorted output all the way up to at least 10kHz. I don't think frequencies above 10kHz are all that interesting as the doubled frequency (20kHz) is starting to push the limits of human hearing.

In any case, I have yet to actually listen to the result, I have only watched it on my oscilloscope. I also do not currently have a saw wave source (Well, I actually do, but my function generator cannot output saw waves and I cannot be bothered connecting the little phatty to the circuit) so I tested the circuit using a triangle wave instead. The end result should be pretty similar though.

The idea of the circuit is to detect when the original saw wave crosses 0V. This is done using an opamp in a comparator configuration, which will output a constant negative voltage slightly less than the negative supply voltage when the input wave is > 0V and a constant positive voltage slightly less than the positive supply voltage when the output is negative. The output is then scaled down to half the amplitude of the input wave. By summing the two and amplifying by 2, the result is a saw wave with double the frequency and the same amplitude as the input.

This picture shows the input wave (triangle) and the resulting square wave output by the comparator (after scaling to 50% of the input amplitude):



Here is a drawing of the circuit. The potmeter across the second op amp adjusts the attenuation of the comparator output which in turn adjusts the symmetry of the two parts of the output wave. With a 10v p/p input wave and a supply voltage of +/- 15V, the attenuation should be about 1/6 (giving the square wave output from the comparator a swing from -2.5 to 2.5 volts). As opamps cannot really handle a gain of less than 1 when in the normal inverting mode, a 8.2K resistor is connected to gnd (see this page for a detailed explanation):





The breadboarded circuit is really tiny:

One thing to be aware of is that the output of the circuit is inverted with relation to the input wave. This can be corrected by using the last opamp of the TL074 as an inverting amplifier with unity gain to invert the result back.

Here is a photo of the result at around 1-3kHz:
Inside the red square you can see both the input waves and the resulting wave with the doubled frequency. Notice that both parts of the new wave have the same starting voltage and the same amplitude as the original wave (one square on the scope equals 5V).


This photo shows the result at around 10kHz:
As you can see, the starting point of the second part of the output wave is higher than the first part. Also, the fall from the top of the first part to the bottom of the second part is not instant, it is slightly slanted (This is of course also the case for the 1kHz wave but it is not visible as the scale is different).

The reason for both these errors is that the rise time of the square wave output from the comparator is a little bit too slow. I doubt that it will be a big problem at this frequency. At higher frequencies the problem becomes more and more pronounced, but as mentioned earlier I do not expect the circuit to be used above 10kHz anyway.

Next up is the frequency divider, but to build that I need a flip flop.




Saturday, August 3, 2013

7-saw board design finished

I just finished designing the PCBs for the 7-saw prototype. I decided to go for two separate modular panels, one with the slopes and mixing circuits/controls and one with 7 oscillators. As a result, I had to redesign the VCO board. Now, instead of having a single board with 7 VCOs, I have designed a board half the size but with four oscillators. The cards include a power bridge, making them stackable to get a 7 (8) oscillator unit. I also added interface points for linear fm and sync and a tap point for the raw wave if I would like to add other waveforms later.




Monday, July 8, 2013

Roland M-240 power supply

Some time ago I bought a Roland M-240 24 channel line mixer. It looks like a nice and compact mixer, but the seller never got around to delivering the power supply / wall wart for it. I have tried googling to figure out what kind of power supply I could use, but have not found any info whatsoever.

So, today I opened the mixer and had a look at the power input board. It is quite simple - no bridge recitifier and no circuit breaker. It has a few huge caps though.

The connector on the back says +/-21.5V DC 500mA. The internal voltage regulators however - AN7812F / AN7815F / AN7912F / AN7915F - can all handle +/- 35V input, so anything between 21.5V and 35V should be fine - it might even work with 18V but this is not guaranteed. Beware that a different voltage than specified may make the voltage regulators run hotter than intended though!

I made a schema of the circuit, it looks like this:

I haven't figured out the value of the ceramic caps though...



Looking at the circut makes me think a bit - the two diodes look very much like they form a half-wave rectifier in conjunction with the 2200uF electrolytic capacitors. I do however take no responsibility if you connect an AC power supply to the mixer and it burns out!

Update, dec 2021: The input is in fact DC, but not well regulated, just rectified and filtered with two caps. I wrote a bit more here: https://atosynth.blogspot.com/2021/12/roland-m-240-psu.html

Monday, April 22, 2013

Prepare to be sawed to pieces!

I've been working on something lately. It involves seven saw oscillators, each to be tuned slightly apart and mixed together, all controlled from the same 1V/oct CV. Can you guess what it is? Does it sound like something you have heard before?

Oh yes! It's the amazing Super Saw! This time in glorious analog :-D

I am fairly certain I will be able to pull this off, but I have no idea of its stability or real sound. I am implementing the circuit part by part. So far I've worked out how to create the detune control slope, the mix curves and the saw oscillators.

The detune pot is not linear, instead it follows a "trumpet" shaped function, somewhat like an exponential function but much sharper than you would be able to create with a normal exponential converter, so I've approximated it using four linear sections in the way described here: http://www.oldcrows.net/~patchell/archives/idealdiode.html (I got the link from Scott Stites on the electro-music.com forum). I've done the math and breadboarded this part of the circuits, and it works as expected although it requires some more work to get a stable +/- 15V.

The mix curves for oscillator 1-3 and 5-7 are essentially exponential functions, and I indend to use the AD633 for that. I have done the math but not yet tried the circuit in practice. The curve for oscillator 4 is just a decending linear function which will be easy.

The oscillators are basically the cores from Yves Usson's VCO: http://yusynth.net/Modular/index_en.html
I've ripped out the main parts - the CV mixer, exponential converter and saw wave generator, leaving out the sine, square/pulse wave, sync possibilities and exponential fm. My version is based on a surface mounted SSM2212 (replacement for the SSM2210) and I've managed to fit all seven oscillators on a 160 * 100 mm PCB. I have also duplicated the power line parts, not sure if this is necessary but I wanted to have the oscillators as separate as possible.

Here is the schematic:
The main thought here is that one can connect one (pre-mixed) 1V/oct CV that goes to all the oscillators, and one detune voltage per oscillator. One could of course connect a separate 1V/oct CV to any of the detune voltage inputs too, to get separate control of each oscillator. One could also attach the missing parts of the oscillators to a separate board to get seven full blown oscillators, but a few modifications will be necessary as there is nowhere to connect the sync and pwm inputs.

Here is the board, almost finished. Ground planes are missing though:


My idea is currently to fit the additional parts - the detune slope and mix curve generators, three VCA/mixers to mix the 7 oscillators, possibly some noise generators and a VCF to a second board of the same size, that can be stacked together with this one for a complete one-voice Super saw oscillator (only leaving out one or more envelope generators.

This is really turning out to be a fun project, I hope I will complete it. Also, I expect it to be drifting as hell,  but that remains to be seen. Perhaps it would be possible to make a digital circuit, compu-tune style for compensating this, that remains to be seen. I am already fantasizing about a six voice analog super saw - imagine the pain of having to keep 42 oscillators in tune...

PS: The board uses 5mm pitch resistors in order to fit everyting in such a small space.


Wednesday, March 13, 2013

Stand alone prototype finished

The first fully functional MPG-200 prototype was finished and shipped yesterday. It features automatic switching between midi and pg-200 mode (with a small modification to the JX-3P), and tries to minimise the fact that switching cannot be done very quickly. In particular, it stores any note off messages received while in pg-200 mode and sends them as soon as it reverts back to midi mode.

The following features have been implemented:
  • all switches and pots from the PG-200 except for write and manual
  • midi passthrough - lets all midi messages not destined for the mpg-200 through
  • note off protection to prevent hanging notes
  • automatic switching between midi and pg-200 mode to allow full control of the JX-3p from a DAW or similar
  • three modes - pg-200 only (blocks midi but keeps delay to a minimum), safe mix (mixes midi and pg-200, but ensures that no message is interpreted as the wrong type by the jx-3p by introducing a "safe time" between modes), mix (switches instantly).
  • queueing of messages in case they arrive faster than the mpg200 can handle them.
  • default CC-to-pg200 mapping

Still to be implemented are
  • Config of CC-mapping and other parameters via sysex, stored to flash memory
  • Configurable midi channel
  • Autosensing of when the jx-3p has noticed a mode change
  • Configurable ranges for the potmeters
The mpg-400 prototype. The "production model" will be using an 8 leg microcontroller with a built in crystal, and will be using at least 7 parts fewer than the prototype.

Tuesday, January 1, 2013

Oh the horror!

I have incredibly bad news to bring to the world at the start of the year. To my horror, I've discovered that the switch between midi and PG-200 modes on the JX-3p is scanned like any other key on the front panel of the JX-3P. Using my logic probe on the scan line while turning both a dial and playing notes at the same time, I have observed the following:


  • The scan frequency varies widely depending on how much work the JX-3P has to do (as is to be expected I guess)
  • The minimum period between two scan cycles is 11.7ms (!) while delays of up to .23 seconds (!!) also occured. This means that the absolute fastest switch between midi and PG-200 data is about 12ms and that I have to use a much higher period to be reasonably sure of not dropping any bytes.



In this screenshot, the first waveform is the serial data (midi/pg-200), the second is the mode-select signal (switches between midi and pg-200), the third is the scanning - notice the big period of blackness in the middle of the screen, here the JX-3P has been working hard and not had the time to scan for changes, resulting in a dropped midi or pg-200 byte. The fourth is the result of the scanning, whenever a scan occurs and the mode select signal is 0, a 1 is returned to the microcontroller - this is seen as long stretches of 1 on the fourth line, in the parts where the scanline still changes rapidly.

This is by far the biggest problem I have faced while working on the mpg-200, and I am afraid this one cannot be solved easily as it is directly related to the way both the hardware and firmware of the JX-3P is built.

I have tried using a "settle time" after changing the mode of about 100ms, that seems to work fine for most hand turned potmeters etc, as long as one does not play fast and turn rapidly at the same time. However, even this means that one has to wait at least 100ms after changing a controller before a new note is pressed (or released). If not, the note will be delayed or not played at all.

So - one can do filter sweeps as long as you hold down the same note, but rapidly changing parameters while playing will probably not work very well :-/


This seems to me like a show stopper for much of what I wanted the mpg-200 to be. It can still be used for tweaking the JX-3P from a daw, but prevents much of the automation that would be cool.

What a bad way to start 2013...