"Uncanny Valley" - analog bitwise wave manglor

Started by Taylor, January 18, 2011, 08:32:29 PM

Previous topic - Next topic

Lurco

Quote from: earthtonesaudio on January 22, 2011, 07:49:38 AM
I wonder if there's a document anywhere that shows how common op-amps (4558, 741, TL07x, etc.) behave when run as comparators.  ???

not the exact answer to your question but interesting: http://www.analog.com/library/analogDialogue/archives/37-04/comparator.html and http://www0.fh-trier.de/~berres/Datenbl%E4tter/TEXAS/sloa067.pdf

earthtonesaudio

I breadboarded a simplified version of this last night, but so far haven't got it to work:

(all amplifiers are TL074)


The strangest thing is that the non-inverting inputs are pulling the Vref to either a higher or lower voltage, and exhibiting hysteresis.  So if I vary the Vref pot from 0 to 9V, the voltage on the non-inverting comparator inputs stays at about 3V until I get to around 7V, at which point it increases quickly.  Similarly, if I decrease Vref from 9V to 0V, it stays high until I get to about 3V and then it drops quickly.

I suspect this has something to do with the decreased input resistance due to running the amplifiers in open-loop configuration, but I haven't proved it yet.

So far I have no audio output. 
Taylor, would you mind posting voltages for your verified version?

Taylor

Hmm, strange. I had mine breadboarded and took it apart - have yet to build a perf version but will report back with voltages when I can.

You used different values in the switch hitters, why is that? I know you know better than I, so just curious.

The other thing is that, without a gain stage in front, even though you changed the resistor ladder values, you're going to need a signal that's something like 1 volt peak to peak to make the comparators fire off, and I don't think you'll get that out of any guitar.

earthtonesaudio

Got it sorted out in about 2 minutes once I finally returned to it.  Notice the Vref comes from a 200k pot.  The outputs of the comparators were driving Vref up or down through the 1M pots.  Even with the large cap, the average DC level could not stabilize, and exhibited hysteresis *because it was positive feedback from output to noninverting input*.  D'oh.

I replaced the Vref divider with two 1k resistors and all is well.

Also, for the values in the resistor string, I made the 1k's into 100 ohms each, and replaced the 10k's with 100k's.  This was a narrow enough window for my passive guitar pickups.


On the scope, it looks pretty much like your simulation shots.  Cool little circuit.

Taylor

Cool, thanks for testing it out. I think you are officially the first person to build an original(ish) circuit of mine, besides me.

I played around with the resistor ladder in the sim, and one thing to note is that you'll actually do some waveshaping depending on these values. If the windows are very small, the signal will end up being in the top or bottom comparator level most of the time, so the signal will be more like a square wave, but a bit stepped.

If the windows are spaced out more, the signal will spend an equal amount of time within each window, and the output will be more sine or triangle-ish, but quantized.

When I build this on perf, perhaps I'll make the resistor ladder all out of trimpots to figure out a sweet spot.

Jaicen_solo

This is totally getting built! Anyone fancy making a layout?

thomasthebuzzard

I am working on a layout for this as we speak. I am going to send it to taylor first though and I'll let him post it if he likes! BTW I love the chuck bronson avatar!

space_ryerson

Out of curiosity, using dual or quad chips? I always though Taylor's avatar was Lee Van Cleef.

thomasthebuzzard

Using duels! I already sent the layout to him. I stripped it down though. Maybe it is? I thought it looked like old charlie!

thedefog

This looks very interesting and I love effects like this. I build the arduino bit-crusher posted here.

http://www.diystompboxes.com/smfforum/index.php?topic=69830.0

I'm wondering how this one sounds in comparison to the arduino based one. Has anyone been so kind as to record any samples yet?

earthtonesaudio

Since the phase of the individual comparator outputs is arbitrary (thanks to the following switch hitter circuits), one could arrange them such that the upper and lower groups are inverting with respect to each other, then diode-OR their outputs into a peak detector (capacitor), and you'd have a very rough envelope signal. 

...Which you could then use as a control voltage for the resistor string current.  Drive both ends of the string, one with an inverted copy, and your thresholds are now a function of the input signal rather than constants.  The steps in the output waveform would occur as a relative percentage of the input, allowing you to hear all the steps, even on quiet notes.

Taylor

#31
Wow, that's extremely clever. I'll put together a schem of this idea and see how it looks.

Edit: Actually, I don't think I know how to do that. Played around with it in the sim but didn't get anything that made sense.

And, yes it's Lee Van Cleef. I'm a big Leone fan but intentionally chose a non-Angel Eyes shot of him. I guess it could look like Bronson, maybe if he dropped a few pounds.

Jaicen_solo

I think I need to read that again, it made my head hurt a bit!

p.s. +1 for Lee Van Cleef. He always was 'the Bad.'

earthtonesaudio

I'm not entirely sure that what I suggested would work.  I'm breadboarding it now.

earthtonesaudio

So far I have not made it do what I set out to do, but I have made some interesting noises.

earthtonesaudio

#35
Alright, I put pen to paper and worked out whether or not my latest inspiration would be viable, and I think it is.

So you take the 4 comparator outputs and wire the lower two with their inputs switched.  Say for simplicity that your resistor divider is 0-5V and all resistors are equal.  For a full-scale sine input, the outputs will fire like this:

4V:_____----____________________
3V:___-----------__________________
2V:_______________------------_____
1V:__________________----________
(Where "__" = low, and "---" = high output state)

If you notice that the upper two and lower two are never on at the same time, you can do something clever (perhaps).  Use the 3V output as a polarity bit, then diode-OR 1-4 and 3-2 and you have a 3-bit binary output...
...Which is perfect for controlling a CD4051.


[edit]Hang on a moment... I may have jumped the gun again.
[final edit] Yes it turns out I was wrong.  See following post for the more evolved idea.

earthtonesaudio

#36
Okay here's something.  Almost what I had in mind.



This one uses the first comparator's output to flip polarity on the reference for the other two.  This gives you a total of 6 different 3-bit binary words using just 3 comparators.  These words are delivered to the 4051's A/B/C inputs and its internal logic selects one of its 8 analog in/out pins and routes to the common out/in.  Since the states 010 and 101 are not generated by the comparators, outputs 2 and 5 are not used.  The rest could go to pots set up as voltage dividers across the supplies.

The 1M pot at the input adjusts the input Z as well as hysteresis for the first comp.
 Wiper goes to 1/2 supply voltage.

[edit]
Modified the schem a bit.  The lowermost comparator's inputs were reversed (oops), and I tweaked the resistor string values by a couple orders of magnitude.  With the inputs done this way (correct) it's possible to run the lowermost section as either a comparator (wiper to inverting input) or as an amplifier.  With real-world parts the gain is still likely high enough to saturate most of the time, so it should still work as desired.

Taylor

Wow, awesome. So we'd want to connect pots as voltage dividers to the channel inputs, and then the comparator outs act as binary selectors for which channel is active at a particular moment. Is that right?

This looks great and I'm excited to build it.

I also want to point out that the idea of using the Flash ADC is not really my own - although it's a standard building block, Max from SFX Sound gave me the idea to use it as an effect. My contribution was in fleshing it out into a usable circuit, and in adding the switch hitters to get on/off/invert action for the bits. So Thomas and Alex, you don't really need to give me any credit for ideas using the flash ADC without the rest of the circuit.

Alex, do you have any thoughts on whether your MUX circuit will work polyphonically? I simulated a circuit based on the harmony generator, which used the 3 octaves up square wave to step through an 8-step johnson counter with voltage divider inputs. It achieved the goal of a drawable waveform, but it would be monophonic due to the PLL input. But I'm just guessing that you should be able to play somewhat polyphonically with this new idea of yours - what do you think?

earthtonesaudio

I don't even know how to wrap my mind around the question of polyphony.  If you are multiplexing DC voltages, you could draw some arbitrary (6-step) waveform that may sound like an approximate chord, but then the frequency would depend on the input signal's frequency, and my brain explodes trying to think about it.

It's bad enough to try and imagine what it would sound like with DC levels being multiplexed.  But since it's an analog MUX you could put about anything in.  6 differently-filtered copies of the input... feedback or prerecorded material... other instruments chopped and remixed by your playing...

Taylor

Quote from: earthtonesaudio on February 10, 2011, 04:39:28 PM
It's bad enough to try and imagine what it would sound like with DC levels being multiplexed.  But since it's an analog MUX you could put about anything in.  6 differently-filtered copies of the input... feedback or prerecorded material... other instruments chopped and remixed by your playing...

Oh wow. That hadn't occurred to me. But that's... pretty amazing.