"Uncanny Valley" - analog bitwise wave manglor

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

Previous topic - Next topic

Taylor

I had an idea the other day for an analog breakpoint waveshaper for guitar/bass. I was trying to figure that out and came up with this instead:



The middle part is the front end for a Flash ADC. It takes your analog wave and send it through a series of comparators - each comparator fires its output digitally when the input crosses a certain voltage. The resistor ladders sets each comparator to a different voltage.

If we just take the outputs of the flash adc and mix them, we have a 2-bit analog bit crusher. This is not a sample rate reducer, like other things that call themselves "analog bit crushers" - it puts out a waveform that is quantized on the amplitude axis, not on the time axis, so it really is analogous to a bit crusher.

Now, sure, that's fun on its own. But what the circuit then does is allow you to vary continuously each individual "bit" from on, to off, to inverted. You can get some very interesting digital-style waveshaping, plus octave up and frequency tripling (octave+fifth).

An interesting thing about bit crushing is that your waveform becomes less distorted as it gets louder. Quieter signals will be square waves, whereas louder signals fire off more comparators and so the waveform becomes a stepped version of the input signal.

This concept is easily expanded to more stages. More stages would make your signal less distorted and give more opportunity for subtler mangling. Splitting the waveform into positive and negative halves, then operating on those and mixing them, would, I think, offer some pretty nice options.

I haven't built this yet. The whole core part definitely works and simulates well - the only trick will be getting the input signal amplified enough without clipping at the input gain stage. The concept is verified, though, and this will achieve some pretty unique sounds.

amptramp

You can try an LM3914 as a 10-output flash converter and increase the resolution of your audio.  It can be set to provide only one output at a time.

Taylor

Yeah, that's a cool idea, although people seem to like circuits which use parts they already have when possible.

a soBer Newt

This seems amazing Taylor how do you come up with this stuff?

Taylor

Uh, well... in this case I wanted to make a thing where you could basically draw a waveform with slider pots and it would map your input to that waveform.

So I was trying to figure out how to do that, and I kind of mocked up what I thought it would look like in Falstad's simulator app. It didn't work the way I wanted but it mutated into this, and this seemed cool on its own.

As I said, the middle part is basically a snippet from the flash ADC. Then the right part of the schematic uses four "switch hitter" amplifiers.

Hides-His-Eyes

I like your original idea too! So you were gonna have the ADC /DAC combined with pots to set the conversion points?

slacker

Nice, have to try and find space on the breadboard for it. I think the pots need to connected to half the supply not ground though.
You could mod the Harmony Generator to do your drawing the waveform idea.

caress


phector2004

So, basically, is it quantizing the frequencies and setting a threshold?

Is it pretty much a "low res" EQ?

I'd love to hear some sound samples. Seems interesting!

Taylor

Quote from: phector2004 on January 19, 2011, 11:47:51 AM
So, basically, is it quantizing the frequencies and setting a threshold?

Is it pretty much a "low res" EQ?

I'd love to hear some sound samples. Seems interesting!

Well, here's a way to think about what it does:

The resistor ladder sets each comparator in the flash ADC section to a different voltage. The top one has 7.88v at the inverting input, and each other one has a lower voltage at its inverting input. So whenever the input signal (your guitar) goes above that voltage, the comparator outputs flips from 0v to 9v, and then when the signal goes below that it goes back to 0v. So each of these comparators are outputting pulse waves with varying duty cycle.

Here's what the top and bottom comparator outputs are doing individually:



Here's what you get when you mix all 4 comparator outputs. This is analogous to bit crushing - you have a wave that is quantized to only 4 possible values. I think this would be equivalent to 2 digital bits.



And here are some things we can do with inverting and turning off some bits. By inverting 2 "bits" (technically more like half a bit), you get frequency tripling.


Taylor

Quote from: Hides-His-Eyes on January 19, 2011, 05:32:30 AM
I like your original idea too! So you were gonna have the ADC /DAC combined with pots to set the conversion points?

Well, I don't know. I didn't get too far with that idea. I just was thinking that, basically to do that, we need to separate the waveform into a bunch of "amplitude bins", and then allow negative/positive amplification of each bin separately. I wasn't able to figure out conceptually how to do that electronically yet, but I've been thinking about it.

Quote from: slacker on January 19, 2011, 08:05:17 AM
Nice, have to try and find space on the breadboard for it. I think the pots need to connected to half the supply not ground though.
You could mod the Harmony Generator to do your drawing the waveform idea.

You know, you're quite right. I wonder why it works in the simulator, connected to ground, even though I have set the opamps to run on 0-9v in the sim?

If you do breadboard it I'd love to hear your thoughts. I know this could be improved by somebody more knowledgeable than I.

You're right, I could probably do something with the HG to get that working. I know it's something that's done in synth gear with Lunettas and all that, and the HG is almost like a guitar-controlled lunetta in some ways.

slacker

#11
Not sure why it works in the sim, I've seen some sims that assume a bipolar supply for opamps but it doesn't sound like that's the case here.
To do it with the HG, imagine one of the simple 8 step sequencers running at audio speeds  ;)

Taylor

This circuit is now verified. It works really well and sounds insane! The sounds are all pretty extreme. If you're into the massive digital-sounding fuzz and abrasive harmonics that you hear on Nine Inch Nails' guitar sounds, this is right up your alley. And as far as I know, this is the only game in town for these kinds of sounds without going digital. This is probably a bad choice for SRV-ish music.  :P

I used it with my two instruments: one is a P-Bass, the other is a fancy custom 8-string bass, and that's the one I use to get a feel for how something will sound on guitar, as its range reached up into the higher registers of the guitar's range. On my P, this circuit is just huge, fat, and abrasive/glitchy. On the 8-string, playing chords on the high strings, you get some really weird harmonics and some subtle octaves.

Some suggestions for mods:

-Add a tone control - the harmonics are indeed pretty intense sometimes, so an RC lowpass would be a good idea.
-Make the 560k in the first opamp's feedback loop a 1m pot. You need to boost your signal to be as rail-to-rail as you can get it, but you don't want to clip at the front end probably. Then again, sometimes that's fun.
-XOR the bits together for a ring mod fuzz

Here's the verified schematic:


faptdivers

Any chance of doing a sound sample? Something this extreme deserves some.

wavley

I think I've actually got the parts around to make this happen!  Now if my wife/school/work/fixing broken things will give me some time...
New and exciting innovations in current technology!

Bone is in the fingers.

EccoHollow Art & Sound

eccohollow.bandcamp.com

earthtonesaudio

Awesome.  I especially like the use of the switch hitters, that gives you twice the functionality with the same number of controls.

If I may make some suggestions...
-Get rid of the 10u cap going into the comparators.  You don't need it, and with it there you have no DC bias for the comparators to compare, save whatever leaks through the cap.
-Make the last stage inverting (swap inputs and add one resistor between (-) and out).  This will mix the 4 outputs more reliably.
-Consider increasing the value of the 500 ohm resistors.  This will bring your threshold(s) more toward the middle of the supply, and you'll be able to lower the gain (and noise) in the first stage.
-(request) Please specify what you used for the comparators.  Did you use actual comparators or op-amps?  Some op-amps will work in this application but some won't.

I mean this all as constructive criticism, so hopefully you won't take it as rudeness.  :)

P.S.  I've always thought "Uncanny Valley" would be a great band name.

Taylor

Those are great suggestions, thanks very much. Not rude at all - although I think I'm good at processing concepts, my low-level designs skills are hack-ish, so when I post something, I'm always hoping those who know more will have suggestions to make it better.

The cap and 500 ohm resistors: these are good suggestions because I'm not sure I'm lighting up all comparator stages as it is. The cap seems obvious to me now, but it worked the way I wanted in the simulator; I think sometimes DC offsets don't sim as expected. I need to get a proper scope so that I can see what's happening once I take an idea from sim to breadboard.

I'm just using TL072s for the "comparators". I have never been too sure about the differences between opamps as comparators and real ones. Maybe slew rate?

Thanks again for those ideas - I'll implement them and see how it sounds. I'll try to get some clips recorded - while I'm at it I hope to get some clips of those weirdo CMOS "phaser" ideas I posted as well.

earthtonesaudio

Quote from: Taylor on January 21, 2011, 02:54:47 PM
...although I think I'm good at processing concepts, my low-level designs skills are hack-ish, so when I post something, I'm always hoping those who know more will have suggestions to make it better.
I feel the same way much of the time. 

Quote
The cap and 500 ohm resistors: these are good suggestions because I'm not sure I'm lighting up all comparator stages as it is. The cap seems obvious to me now, but it worked the way I wanted in the simulator; I think sometimes DC offsets don't sim as expected. I need to get a proper scope so that I can see what's happening once I take an idea from sim to breadboard.
Sims tend to behave ideally, so the inputs bias up at exactly 1/2 the supply and the cap never leaks so it always works.  Real life does not always comply.  :)

Quote
I'm just using TL072s for the "comparators". I have never been too sure about the differences between opamps as comparators and real ones. Maybe slew rate?
The trouble here is that datasheets won't often come right out and say "this op-amp works well as a comparator".  Some older JFET-input op-amps were prone to phase inversion if you apply too big of a differential voltage to their inputs.  Some op-amps' input impedance goes to hell without feedback.  I have used TL07x series as comparators at audio frequency (and higher) without issues, so TL072 sounds good to me.

Quote
Thanks again for those ideas - I'll implement them and see how it sounds. I'll try to get some clips recorded - while I'm at it I hope to get some clips of those weirdo CMOS "phaser" ideas I posted as well.
Oh yeah, I've been  meaning to try that one out too.

Cliff Schecht

The big difference between op amps and comparators is the comparator will have an extremely high open loop gain (where it's meant to be run). Op amps are designed for closed loop operation mostly and exhibit a few problems when run in open loop. Most op amps have internal compensation that limits the slew rate whereas comparators don't. The quiescent current draw can sometimes increase significantly when an op amp is run in an open loop configuration and some op amps just flat out don't like to be run as a comparator. You also get changes in the rail-to-rail input and output voltage that change for open and closed loop operation. The datasheet specs for op amps are usually for closed loop unity gain operation which is a lot different than open loop operation!

With that said, the TL07x/08x parts are so great because they are comfortable in many different situations, including being run in an open-loop configuration. They aren't very fast parts although this usually isn't an issue for audio applications (unless you are looking for lots of gain, the GBP eventually does become an issue).

earthtonesaudio

I wonder if there's a document anywhere that shows how common op-amps (4558, 741, TL07x, etc.) behave when run as comparators.  ???