Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Building a quantized sequencer without programming (MC)

Waxxdaddy

New Member
First post here. Looking forward to working with everyone here!

I keep being told that trying this is a dumb idea and I'm making it unnecessarily hard for myself. I totally get that but I'm stubborn and I'm having fun with this project so far! I'm enjoying circuit design but have no interest in learning programming at this point so I'm trying to find a way of building a quantized sequencer without using a microcontroller. The idea I came up with is a ciruit that is supposed to generate precise voltage references of 1/12V (for half steps) and 1V (for octaves) that can then be added together in various configurations to give a full scale of musical notes. (I'm not too worried about getting all octaves as long as I can get a few) The problem I keep running into is that my voltages are too unstable so the more of them I add together the further off I am from being in tune. (After adding 1/12V twelve times I'm over 150% off)

I'm adding the schematic as well as a flow chart to illustrate the intention of how it should work. Currently I'm working on debugging the original voltage reference IC (I'm using an LM4040) I cannot get it to be stable enough because as I turn RV3 to simulate the CV voltage coming from the sequencer the 12V supply voltage drops and with that drop the LM4040 voltage goes up by several mV. Aside from that I'm sure there are other places in my circuit where voltages are changed. (overall if I measure the output it keeps increasing as I turn up RV3 to open up the switches)

I'm very open to suggestions of doing what I'm trying to do here with other ICs as long as they don't require programming. I've looked into using ADCs and DACs but they are quite expensive. (At least the ones I can find)

On the flow chart I have not added the part that adds octaves since I haven't added it to the circuit yet either. But it would basically just be another chain of comparators and switches hooked up to a second variable voltage divider.
 

Attachments

  • RV3 (Variable Voltage Divider 1-12V).pdf
    14.6 KB · Views: 129
  • Quantized sequencer R01.pdf
    321 KB · Views: 125
Have you looked at block programming ? Kids in 6'th grade are using it to control
robots. I use it as well as C. Block makes rapid development w/o having the rigid
extensive constraints imposed by C.

Examples (look at first post in each for need) :

Posts #9 and #21

Post #4

Post#10

I will take a first pass to show you just how simple your design would be in block.
Later today or tomorrow.


Regards, Dana.
 
Last edited:
Here you would have N number of If Then blocks to cover how many (N) test ranges you
want of V input. I only show 2 as example. A flag can be assigned to each range, and that
tested in more block code for other functions for that range. Like output a specific tone
or sequence of tones.

1719334954058.png
 
Last edited:
First thought, change all resistors (except for the LEDs) to 0.1% tolerance. You will get both improved accuracy and improved temperature performance; and a more stable 1/12V.

ak
 
Last edited:
The idea I came up with is a ciruit that is supposed to generate precise voltage references of 1/12V (for half steps) and 1V (for octaves) that can then be added together in various configurations

Try using +/- 15V supplies for the ICs, and limit the variable voltage range to 0 to +10V with a 10V reference.
Divide the lower voltages from the 10V ref.

The LM339 common mode range is up to (positive supply - 1.5V) so you cannot use the same voltage at the inputs as for the supply.

And, use high precision resistors as AK suggests.

(A lot of common opamps cannot work well within around 3V of one or both supplies, so it's always good practice to allow decent "headroom" for the supply voltage beyond the maximum signal in or out range).

Prior to digital interfaces and MIDI, synths commonly worked with CV + gate using 1V per octave, and a lot of modular synths still do - so the concept is by no means dumb!
 
Try using +/- 15V supplies for the ICs, and limit the variable voltage range to 0 to +10V with a 10V reference.
Divide the lower voltages from the 10V ref.

The LM339 common mode range is up to (positive supply - 1.5V) so you cannot use the same voltage at the inputs as for the supply.

And, use high precision resistors as AK suggests.

(A lot of common opamps cannot work well within around 3V of one or both supplies, so it's always good practice to allow decent "headroom" for the supply voltage beyond the maximum signal in or out range).

Prior to digital interfaces and MIDI, synths commonly worked with CV + gate using 1V per octave, and a lot of modular synths still do - so the concept is by no means dumb!
Can I keep the power supply as +/- 12V but use a 2.5V reference instead of 10V? My power supply doesn't go higher than +/-12V. And then can I power both RV3 as well as the string of R4-R15 from this reference?

When you say I cannot use the same voltage at the inputs as for the supply you mean the maximum voltage that goes into the non-inverting input of any LM339 must be at least 1.5V lower than the positive supply voltage? Or I need a seperate voltage source (like a voltage reference)? Or both?
 
There is a spec that is called common mode range for inputs, and it insures
inputs always function properly if that is met. If not in spec input can produce
unpredictable output.

1719358317859.png


5. Positive excursions of input voltage may exceed the power supply level. As long as one input voltage remains within the common mode range the comparator will provide a proper output state. Refer to the Maximum Ratings table for safe operating area.

No you dont need another power supply, its just the range of V that can be put on input pins,
+ and - input pins (not power pins), to maintain functionality.


Regards, Dana.
 
Last edited:
There is a spec that is called common mode range for inputs, and it insures
inputs always function properly if that is met. If not in spec input can produce
unpredictable output.

View attachment 146261

5. Positive excursions of input voltage may exceed the power supply level. As long as one input voltage remains within the common mode range the comparator will provide a proper output state. Refer to the Maximum Ratings table for safe operating area.

No you dont need another power supply, its just the range of V that can be put on input pins,
+ and - input pins (not power pins), to maintain functionality.


Regards, Dana.
Try using +/- 15V supplies for the ICs, and limit the variable voltage range to 0 to +10V with a 10V reference.
Divide the lower voltages from the 10V ref.

The LM339 common mode range is up to (positive supply - 1.5V) so you cannot use the same voltage at the inputs as for the supply.

And, use high precision resistors as AK suggests.

(A lot of common opamps cannot work well within around 3V of one or both supplies, so it's always good practice to allow decent "headroom" for the supply voltage beyond the maximum signal in or out range).

Prior to digital interfaces and MIDI, synths commonly worked with CV + gate using 1V per octave, and a lot of modular synths still do - so the concept is by no means dumb!
This tip with lowering the voltage on the input pins has given me the biggest advance in weeks! I went from 160% off target to 20% and I just need to be withing 10% for the pitch to sound correct. What else can I do to improve the accuracy of this circuit? The problem is still the same. As more of the 83.3mV get added together more voltage comes from somewhere. It's much less now but still needs to be lower. Are there better components I can get? Someone on reddit mentioned tl074s are from the 70s and outdated. I switched to TL051 but I don't know if those are any better for my application. Are the switches and comparators I'm using decent? I don't know if the bug is due to type of components, circuit design or both.
 
The input offset V is 5 mV, an offset to each R divider tap V, so real
issue is divider accuracy. The divider absolute errors compound as you get
to max values at top of divider.

"Normally" one uses a precision Vref and either a DAC or A/D used
in error correcting loop. But takes code, processor, to do error correction,
or FPGA like core.

You can get precision thin film R arrays, accuracy << .01%


There are SOC's, system on a chip, like PSOC that have 20 bit A/Ds that
can yield great precision. And almost codeless if you can do logic and or Verilog
design.

Regards, Dana.
 
First thought, change all resistors (except for the LEDs) to 0.1% tolerance. You will get both improved accuracy and improved temperature performance; and a more stable 1/12V.

ak
Can you explain how this would make a difference? It makes sense to me that the summing mixer reistors need to be accurate so they are all the same. But how does it affect the 1/12V if the string of 12 resistors for the comparator input are slightly off, wouldn't that just affect the accuracy of the intervals that activates the switches? Secondly, how would 0.1% resistors in the precision voltage circuit help? Non of the resistors are even the same value and I'm using trim pots to get precise values for 1/12V anyways. I'm not resisting (haha) just don't have enough understanding of electronics.
 
Can I keep the power supply as +/- 12V but use a 2.5V reference instead of 10V? My power supply doesn't go higher than +/-12V. And then can I power both RV3 as well as the string of R4-R15 from this reference?

When you say I cannot use the same voltage at the inputs as for the supply you mean the maximum voltage that goes into the non-inverting input of any LM339 must be at least 1.5V lower than the positive supply voltage? Or I need a seperate voltage source (like a voltage reference)? Or both?

It should be OK with the 12V supply and 10V max on the control pot & divider chain - the 339 is the critical one to watch out for in that circuit, and 2V should be enough for that.

As the pot and chain are ratiometric, as long as both share the same positive, the voltage there is not critical - try a zener around 9V or 10V, or just one extra series resistor feeding positive to both of them to reduce the maximum somewhat.

The maximum from the final summing amp may be limited with 12V power, but it should manage at least 8 - 9V which still covers a range of 8 octaves.
 
Re. the resistors - the most critical are the step ones from the analog switches to the summer and the opamps; all the 10K ones.

If the step ones are 5% tolerance then each step could be off by up to +/- 4mV.
Two or three that are sequentially low (or high) could easily add a significant error.
With 10%, any single one could be up to 8mV off.

1% should give 0.8mV worst case error per step, if everything is adjusted correctly.

The ones in the summing amp and inverter can throw off the scaling or offsets. In high precision circuits, it's common practice to add a low value preset in series with each resistor (or with a slightly lower value resistor) to be able to calibrate each stage exactly.
 
Another thought - try adding 10V zener regulation to the voltage input to the analog switches?
Reducing that voltage range slightly below the PSU voltage may give some (probably very small) improvement, both from reducing the input voltage range and isolating the signal voltage from PSU variations.
 
Re. the resistors - the most critical are the step ones from the analog switches to the summer and the opamps; all the 10K ones.
Just checking because I know it's written a bit small. R27-R42 (the 10k resistors for the summing mixer and post switch) are currently 0.1% tolerance. I'm considering getting some 0.01% tolerance ones to try. Would that actually improve the offset by a factor of 10?
The ones in the summing amp and inverter can throw off the scaling or offsets. In high precision circuits, it's common practice to add a low value preset in series with each resistor (or with a slightly lower value resistor) to be able to calibrate each stage exactly.
What is a low value preset?
Another thought - try adding 10V zener regulation to the voltage input to the analog switches?
Will try this for sure!
 
Update: I tried disconnecting RV3 from the inputs of the comparators and when i turned it it did not cause fluctuations in the voltage references so it seems the problem lies either with the comparator chain or the switches.
 
One issue not discussed so far is no hysteresis is used on the comparators,
So when RV3 generates a V close to any setpoint that comparator can start
to oscillate due to noise in system/

1719481318281.png



If you have a DSO put it on infinite persistence, set vertical for AC, say 100mV / box, trigger on
auto, to get an idea of how much noise you have on comparator and R string supply.



Regards, Dana
 
Last edited:
As an aside, future reference, here is how simple it was to create a talking voltmeter/freq meter with
block language :


Used a different block language, but when you learn one they are all quite similar.

Regards, Dana.
 
Last edited:
One issue not discussed so far is no hysteresis is used on the comparators,
I had a quick look at what hysteresis is. By no means enough to fully grasp all the implications. So far it seems like it would only cause a "voltage wiggle" as the CV passes the threshold and would not explain the permament increase in voltage of the references? Am I understanding this correctly?
 

Latest threads

New Articles From Microcontroller Tips

Back
Top