DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: Taylor on January 18, 2011, 08:32:29 PM

Title: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 18, 2011, 08:32:29 PM
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:

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44293&g2_serialNumber=1)

The middle part is the front end for a Flash ADC (http://en.wikipedia.org/wiki/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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: amptramp on January 18, 2011, 08:40:27 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 18, 2011, 08:56:17 PM
Yeah, that's a cool idea, although people seem to like circuits which use parts they already have when possible.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: a soBer Newt on January 19, 2011, 03:28:50 AM
This seems amazing Taylor how do you come up with this stuff?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 19, 2011, 03:49:25 AM
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 (http://www.falstad.com/circuit/e-index.html). 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 (http://users.ece.gatech.edu/mleach/ece3050/sp04/OpAmps01.pdf).
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: 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?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: 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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: caress on January 19, 2011, 11:30:13 AM
cool idea!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: 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!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 19, 2011, 03:26:50 PM
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:

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44296&g2_serialNumber=2)

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.

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44299&g2_serialNumber=2)

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.

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44302&g2_serialNumber=1)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 19, 2011, 03:34:49 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: slacker on January 20, 2011, 01:35:25 PM
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  ;)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 20, 2011, 07:00:27 PM
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:

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44319&g2_serialNumber=1)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: faptdivers on January 21, 2011, 09:22:53 AM
Any chance of doing a sound sample? Something this extreme deserves some.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: wavley on January 21, 2011, 09:38:38 AM
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...
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on January 21, 2011, 12:05:29 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 21, 2011, 02:54:47 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on January 21, 2011, 03:26:49 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Cliff Schecht on January 21, 2011, 06:46:03 PM
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).
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: 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.  ???
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Lurco on January 22, 2011, 01:11:51 PM
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
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on January 27, 2011, 08:06:40 AM
I breadboarded a simplified version of this last night, but so far haven't got it to work:

(all amplifiers are TL074)
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44416&g2_serialNumber=2)

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?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 27, 2011, 02:27:49 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on January 28, 2011, 09:20:57 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on January 28, 2011, 09:33:54 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Jaicen_solo on January 29, 2011, 10:31:20 AM
This is totally getting built! Anyone fancy making a layout?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: thomasthebuzzard on February 02, 2011, 08:43:42 AM
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!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: space_ryerson on February 02, 2011, 10:47:29 AM
Out of curiosity, using dual or quad chips? I always though Taylor's avatar was Lee Van Cleef.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: thomasthebuzzard on February 02, 2011, 01:04:34 PM
Using duels! I already sent the layout to him. I stripped it down though. Maybe it is? I thought it looked like old charlie!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: thedefog on February 02, 2011, 02:33:08 PM
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?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 02, 2011, 03:54:10 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 02, 2011, 03:56:10 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Jaicen_solo on February 02, 2011, 04:01:15 PM
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.'
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 02, 2011, 09:18:21 PM
I'm not entirely sure that what I suggested would work.  I'm breadboarding it now.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 07, 2011, 12:25:12 PM
So far I have not made it do what I set out to do, but I have made some interesting noises.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 10, 2011, 11:24:05 AM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 10, 2011, 12:34:00 PM
Okay here's something.  Almost what I had in mind.

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44551&g2_serialNumber=3)

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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 10, 2011, 03:58:30 PM
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 (http://sfxsound.co.uk) 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?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 10, 2011, 04:39:28 PM
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...
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 10, 2011, 04:56:48 PM
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.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 10, 2011, 09:49:28 PM
Just breadboarded the one with the 4051 and a bunch of pots.  On the scope it looks pretty much like the simulated scope shots Taylor put up earlier.  Fun.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 10, 2011, 09:57:10 PM
The first thing I was thinking would be interesting, beyond multiplexing dc signals, would be to have some oscillators going into the channel inputs. A 40106 wired as 6 oscillators would do nicely.

The result might be just a racket, but in principle it's kind of like frequency shift keying, which I would wager has not been yet exploited as a guitar effect. This might actually work better on bass than guitar, since the lower the input frequency, the more time spent on each channel, so might sound less like pure noise and more like an intentional sound. I think we're onto some pretty sweet stuff here.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: artifus on February 10, 2011, 10:07:03 PM
how about a 4040? fuzz to 4040 to 4051?

fun with sea moss (http://milkcrate.com.au/_other/sea-moss/)
cmos synths (http://www.beavisaudio.com/Projects/CMOS_Synthesizers/)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 10, 2011, 11:19:13 PM
@Taylor:  You're making me want to get a bass.  I would imagine 6 squarewave oscillators would be a horrendous racket, even for my tastes.  In a completely opposite direction, you could use the 4051's common as an input for the raw audio, and the 6 outputs could be 6 separate voltage dividers.  Kind of like a compressor or tremolo but with six discrete, and arbitrary, gain settings.
@artifus:  Complete madness.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 10, 2011, 11:33:53 PM
But the thing is that you would only hear one oscillator at a time, so if the frequencies of the oscillators were in the same range as the instrument input, they would create new harmonics which might only be heard every few cycles, or at even longer periods. With low audio range oscillators or lower, it would be like a bit crushed fuzz but with slowly evolving harmonics. I think.

If the oscillator frequencies were around 2-5 times the instrument frequency, it would create some FSK-ish sounds, which I think would be in the realm of Speak N Spell-style synthesis.

Lots of potential with these ideas.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 11, 2011, 06:59:19 AM
Ah... I was thinking the oscillators would be higher than the audio.  Near the fundamental frequency or lower would indeed be interesting.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 11, 2011, 07:47:02 PM
I mocked up a bunch of these ideas in a modular computer program (Plogue Bidule). Some very interesting and weird sounds.

I first tried a bunch of free running square wave oscillators into the multiplexor inputs. All kinds of nasty weirdness. This was definitely bordering on harsh noise. But as I thought, lower frequencies than the fundamental made for more usable sounds. I think this is worth building. You can have 6 square waves using a 40106, 6 caps and 6 pots, so it won't be a tough build.

Then I tried something emulating a cd4040 into the inputs - in other words, as per artifus, I divided the instrument's frequency by 2, plugged that into the first channel, then divided that by 2, plugged it to the second channel, etc. So the multiplexor switched between differently divided versions of the input. This was pretty cool. Sounded much like some FM electronic bass sounds.

I also tried something where the square waves were all the same freq as the input, but with different phase offset. That created some really cool tonewheel organ sounds - not straight sine-y octaves, but real organ sounds which are kind of "grunting" and nasal, or almost like a bassoon or oboe.

If I get time to really build some of these circuits, I think we'll have some pretty fresh stuff on our hands. More unique than a hundred boutiques combined.  ;)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: a soBer Newt on February 11, 2011, 08:14:46 PM
I cant wait till you get these ideas ironed out I will definitely will be buying pcbs if/when they are available.

Sabata Forever!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: defaced on February 12, 2011, 09:30:45 AM
QuoteI mocked up a bunch of these ideas in a modular computer program (Plogue Bidule). Some very interesting and weird sounds.
Just what I did not need to find out existed.  That is beyond cool.  Their chip sounds software sounds really cool too.  There goes my Saturday... ;D
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 12, 2011, 01:38:38 PM
Yeah, Bidule's awesome. I used to use it a lot for my audio experiments before I got into building pedals. It's a million times more flexible and easy to build stuff in there than with hardware, so when I started working with pedals, I was actually really disappointed with how much you have to fight with physics.

I actually haven't done much with the program in years, but I pulled it out to do those tests and remembered how cool it is. It's much of the flexibility of Max/MSP or Puredata, but a lot more intuitive to me.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Strategy on February 12, 2011, 01:49:59 PM
I use Audiomulch, has been around for years, is similar to Plogue and extremely fun.
www.audiomulch.com (http://www.audiomulch.com)

Quote from: Taylor on February 12, 2011, 01:38:38 PM
Yeah, Bidule's awesome. I used to use it a lot for my audio experiments before I got into building pedals. It's a million times more flexible and easy to build stuff in there than with hardware, so when I started working with pedals, I was actually really disappointed with how much you have to fight with physics.

I actually haven't done much with the program in years, but I pulled it out to do those tests and remembered how cool it is. It's much of the flexibility of Max/MSP or Puredata, but a lot more intuitive to me.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 12, 2011, 02:00:18 PM
Oh yeah. I think I got into Bidule when I was a Mac-only person, and AM is/was not available for Mac. AM is pretty cool, I think it was my first foray in computer music, way back before I had ever heard any of this kind of music. I remember playing around with that, and my friend asking, sincerely, whether there was anybody who would actually make this kind of "music" for people to actually listen to.  :D The "metasurface" is amazing, and that's the kind of thing that totally kills Bidule as a live tool.

To bring it back to hardware, I think these can be great tools for understanding circuits conceptually. They don't model electrical characteristics, but some ideas like the ones in this thread are so abstract that it's necessary to get an idea for what they will really do with audio before trying to build them.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: artifus on February 12, 2011, 06:11:19 PM
Quote from: earthtonesaudio on February 10, 2011, 11:19:13 PM@artifus:  Complete madness.

i'll take that as a compliment
;D
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Top Top on February 13, 2011, 05:57:19 AM
Quote from: Taylor on February 11, 2011, 07:47:02 PM
I mocked up a bunch of these ideas in a modular computer program (Plogue Bidule). Some very interesting and weird sounds.

I first tried a bunch of free running square wave oscillators into the multiplexor inputs. All kinds of nasty weirdness. This was definitely bordering on harsh noise. But as I thought, lower frequencies than the fundamental made for more usable sounds. I think this is worth building. You can have 6 square waves using a 40106, 6 caps and 6 pots, so it won't be a tough build.

Then I tried something emulating a cd4040 into the inputs - in other words, as per artifus, I divided the instrument's frequency by 2, plugged that into the first channel, then divided that by 2, plugged it to the second channel, etc. So the multiplexor switched between differently divided versions of the input. This was pretty cool. Sounded much like some FM electronic bass sounds.

I also tried something where the square waves were all the same freq as the input, but with different phase offset. That created some really cool tonewheel organ sounds - not straight sine-y octaves, but real organ sounds which are kind of "grunting" and nasal, or almost like a bassoon or oboe.

If I get time to really build some of these circuits, I think we'll have some pretty fresh stuff on our hands. More unique than a hundred boutiques combined.  ;)

CMOS logic stuff seems to be a whole world of untouched guitar FX. I have messed around with it a bit and have a few things that I can throw down on the forum when I get a little time for it.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: artifus on February 13, 2011, 10:46:05 AM
Chapter 24: Analog to Digital Conversion, Sort of (http://www.nicolascollins.com/texts/originalhackingmanual.pdf)

*edit* Tim Escobedo (http://folkurban.com/Site/GuitarEffects-681.html) has some cool cmos stuff too.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 13, 2011, 12:53:18 PM
I discovered something somewhat interesting on the breadboard.  Using a TL074 for the "comparators" I am able to generate every word except for 101.  At certain input voltages the op-amps oscillate and/or are slewing so that it is possible to generate the word 010, even though ideally it should not. 

I feel like it should be as simple as placing one extra resistor somewhere to generate all 8 words (reliably), but so far I've been unsuccessful.  Using two comparators and the same general scheme it's trivial to get 00,01,10,11 in order, but for some reason 3 is proving difficult.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Jazznoise on February 13, 2011, 01:11:02 PM
Isn't 101 5? Those 4 comparators should never be able to generate 5 - there's four of them! You sound like you've changed the design but I'm not sure what you've done.

Was thinking of building this. The osccilator part sounds very interesting. I wonder how it'd sound if you used the guitar signal going through a D-Type flip flop as your osc source!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 13, 2011, 09:10:43 PM
Finally, I was able to generate all 8 words (in order) using this circuit:

(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44588&g2_serialNumber=1)

It may use an entire TL074 but only 3 of them are wired as comparators.  I hooked the outputs up to LEDs to test and indeed when I put in a DC sweep at the input I get
ABC
000
100
010
110
001
101
011
111

The supply voltage is +9V and GND and AGND=4.5V (junction of two 1k resistors with a 10uF cap).  This actually matters because AGND must be low impedance relative to R3/R4 or amp C gets squirrely.  The only other caveat is that TL0** series op-amps will do the phase reversal thing if you bring their inputs too close to their negative rail.  Since I'm mostly concerned with small signal inputs this is no big deal.  I make R4=10*R3 and similarly R2>R1.  This puts all the voltage references near 4.5V/AGND.

So far, with a DC voltage as the source signal, it works perfectly.  I'll report back once I've put a guitar through.


Quote from: Jazznoise on February 13, 2011, 01:11:02 PM
Isn't 101 5? Those 4 comparators should never be able to generate 5 - there's four of them! You sound like you've changed the design but I'm not sure what you've done.

Was thinking of building this. The osccilator part sounds very interesting. I wonder how it'd sound if you used the guitar signal going through a D-Type flip flop as your osc source!

When I was mentioning generating word 101 and 010, I was referring to the schematic in this post (http://www.diystompboxes.com/smfforum/index.php?topic=89353.msg762057#msg762057), not specifically to Taylor's original.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Paul Marossy on February 13, 2011, 09:14:06 PM
Interesting idea Taylor. Got any sound clips of this mad circuit?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 15, 2011, 10:52:48 AM
I discovered an error in my circuit above.  As drawn it can't generate the words 001 and 110.  Adding a resistor Rc from the junction of R1/R2 to the output of IC1C solves this.  A starting point for values would be Rc=R2>R1.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Skruffyhound on February 15, 2011, 02:55:14 PM
Sorry to bother, but I need to subscribe to this thread to get updates. :D
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 16, 2011, 07:32:03 AM
Bleh.  Please disregard my last post.  It turns out with the proper resistor values this schem DOES work.  

On the breadboard I have (verified and working):
R1=10k
R2=220k
R3=56k
R4=1M
Also R5=1M and C1=0.1u

These values give a full-scale output for ~60mV p-p input.
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44588&g2_serialNumber=1)

I also had the chance to use the ABC outputs to control a CD4051, which in turn processed the same source audio.  I put the guitar into an inverting op-amp with a fixed input resistor, and several feedback resistors controlled by the 4051.  I used the op-amp output to drive the comparator inputs.  Definitely not a subtle effect; the output is a sort of stepped waveform with lots of harmonics:
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44597&g2_serialNumber=1)

On the other hand, by taking the ADC out of the feedback loop, a different sort of response is obtained:
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44602&g2_serialNumber=1)
For this configuration, the output looks something like this:
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44600&g2_serialNumber=1)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 16, 2011, 01:52:30 PM
Beautiful waveform.

This is awesome. At this point I can take no credit for what you're coming up with, but I'm glad I get to watch!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Hides-His-Eyes on February 16, 2011, 02:32:58 PM
Holy smoly that's a clever use of a 4051.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: digi2t on February 16, 2011, 06:08:17 PM
I would really love to hear a sound clip of this. Looks like a real audio mangler! I like!
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on February 16, 2011, 07:13:58 PM
Hey Alex, is the waveform there a simulation or scoped from a real hardware unit?

It seems like, basically, if everything was perfect, you'd have a regular wave right there, right? So the aliasing going on there would seem to be a result of the mismatch of the resistors due to tolerances if I'm understanding things correctly. In any case, the next thing I'd like to try would be pots in place of the Rf resistors. Should give some pretty nice control over the distortion, and a filter on the end would probably be good, so we can remove the aliasing due to the clock and get something more like an analog lookup table distortion - basically what I was aiming for in the first place.  :)
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on February 17, 2011, 07:55:21 AM
The waveform drawing is not a scope shot, just an "artist's rendering" in MS Paint of what the scope looked like when I ran guitar through the circuit in the second schematic.  I made sure none of the resistors were matched, and you'll note that the bottom half of the waveform is distorted differently from the top half; that's due to using one set of values for Rf0-Rf3 and a different set for Rf4-Rf7.

I don't know when I'll get a chance to do a recording, but the sound is not as extreme as you might think, after seeing the waveform.  It sounds sort of like a cross between plain old harmonic distortion and the way an FM radio station sounds with poor reception.
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: Taylor on April 13, 2011, 02:47:31 AM
Quote from: earthtonesaudio on February 16, 2011, 07:32:03 AM
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=44597&g2_serialNumber=1)

ETA, I assume this was drawn as a bipolar circuit for simplicity. In a single-sided 9v supply setup, should the AGNDs in the ADC go to 4.5v, or ground?
Title: Re: "Uncanny Valley" - analog bitwise wave manglor
Post by: earthtonesaudio on April 13, 2011, 08:12:25 AM
AGND should be 1/2 the total supply voltage.  So for a 9V supply yes, it would be 4.5V.