Changing the duty cycle on a Bluebox

Started by Mark Hammer, February 21, 2010, 07:47:07 PM

Previous topic - Next topic

Mark Hammer

Could a person alter the duty cycle of the square wave generated by the flip-flop in a Bluebox by placing a back to back diode configuration in series with the signal going to the 4013?  In other words, could one generate a different-sounding octave (or sub-octave) by effectively chopping off the first and last bit of the signal with diodes in series?

Just wondering.

Processaurus

If I'm imagining schematically what you're imagining, a series diode wouldn't have any effect on the timing of a square wave, and also the length of the pulses clocking the 4013 doesn't matter, because each is just toggling the output state of the flip flop on the rising edge.  One could make the sub octave phase wander (relative to the input) with some RC combo's somewhere in the 4013 section, but that would be different thing than narrowing the pulse length to get a different synth tone.

Anything to alter the sub octaves pulse width would need to happen after the 4013, the second half of Tim Escobedo's PWM (the logic section with the inverters), I can vouch for, sounds brilliant.  A great 8 bit nintendo impression.

earthtonesaudio

You could take a standard BMP tone control, but with diodes directing the positive to the highpass, negative to lowpass (or vice versa).

R.G.

Quote from: Mark Hammer on February 21, 2010, 07:47:07 PM
Could a person alter the duty cycle of the square wave generated by the flip-flop in a Bluebox by placing a back to back diode configuration in series with the signal going to the 4013?  In other words, could one generate a different-sounding octave (or sub-octave) by effectively chopping off the first and last bit of the signal with diodes in series?
Unfortunately, generally no. The 4013 is an edge triggered flipflop. It changes state when the clock has a positive going edge that meets the chip's internal needs to be a clock. It ignores anything else about the clock. The nature of the signal going into the clock pin is modestly irrelevant as long as it meets the "positive going clock" definition once per cycle. When that instant in time happens, the chip triggers and does whatever it's going to do.

Flipflops are useful in digital electronics for generating a square wave from any incoming duty cycle at all, as there is one positive-going edge per cycle, so the output generates a half-frequency output with perfect symmetry.

You *can* do tricks like firing off a one shot timer to eat a little bit off each edge, but this will not track with frequency. You can use the square wave to generate a triangle wave, normalize the triangle amplitude, then use a comparator to pick off variable duty cycle on the triangle. You can even phase lock to the half-frequency, multiplying several octaves up and from the super-octaves generate synched waveforems.

But all this gets complex and fussy.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Mark Hammer

I get what you're saying.

What I was thinking was that if no signal was presented to the flip-flop until it exceeded the forward voltage of the diode/s that the triggering of the flip-flop would be delayed by a bit.  That is, where the normal boosted wave would reach the critical voltage for triggering the flop-flop (which, of course, does not trigger for everything) quite quickly (producing a square wave which, in theory, should be juuuuust a bit less than 50% duty cycle), blocking series diodes would suppress the signal until it reached some level which was, at once, both robust enough to be conducted by the diodes and trigger the flip-flop.  It's a distant cousin of trigger-pulse delay.

I guess what would settle this is finding out that the critical voltage for triggering is less than the forward voltage of even a germanium diode.  But I'm betting it isn't, or else 4013 flip-flops would be among the most unstable chips in the business.  My data sheet for a Fairchild 4013 brags about high noise immunity, which I think (interpreting these specs may be over my head) requires an absolute minimum of .45v to trigger anything.

So, to further articulate, I'm thinking that one could have a string of back-to-back pairs in series from the collector of the transistor that feeds it to pin 11 of the flip-flop.  A 3-position toggle could select between normal direct feed (i.e., straight-wire bypass of the entire diode string, for normal almost-50% duty cycle), the full diode string (for whatever duty cycle that provided, given its total forward voltage), or something less than the full diode string.

In theory, this should work.  What I don't know is whether sticking something between the Q1 collector and the clock pin of the flip-flop screws up triggering altogether.

Incidentally, I am assuming that if one wishes to get the typical overdriven op-amp distortion that provides the normal fuzz to be blended with the octave, you don't stick anything untoward in the signal path until after that distortion has been produced.  The path between the Q1 collector and the flip-flop is the fork in the road after the distortion and envelope signal have been generated.

earthtonesaudio

Edge-triggered means Schmitt trigger input, right?  If it's done internally like other CMOS Schmitt triggers I've seen, then varying the supply voltage will necessarily vary the trigger points.  So you could adjust the 4013's supply to make it trigger higher or lower (though with the same symmetry... dang!).

Mark Hammer

Hmmmm....

Maybe this is a case where something like the Anderton/EPFM "super fuzz" could be usefully integrated.  This is the one that uses a 1458 and employs the second op-amp like a comparator to produce a square wave with duty cycle varied by adjusting the reference voltage that triggers it.

So, actually, let's expand the scope of this thread to anything that permits an octave-divider - whatever the pedigree - to vary the duty cycle of the octave or sub-octave generated.  If the mod permits pulse-width modulation by foot control or LFO, even better.  We basically need a little bit of animation to those undertones.

slacker

#7
Quick and dirty way to do this would be adding the relevant bits of Tim Escobedo's PWM after the flipflops,
http://folkurban.com/Site/PWM-715.html

Just ditch the 386 and take the input from the CD4013 instead, if you wanted you could use more of the gates to apply the same effect to the fuzz as well. I guess an opamp wired as a schmitt trigger would do the same job.

On a similar theme his Simple Square Wave Shaper is nice for giving square waves a different flavour.
http://folkurban.com/Site/SimpleSquareWaveShaperMadeSimpler-712.html

R.G.

Quote from: earthtonesaudio on February 22, 2010, 07:09:17 AM
Edge-triggered means Schmitt trigger input, right?
Unfortunately, no. Schmitt trigger means there is a DC reading circuit just inside the pin that won't read a + level until it gets over some high threshold, say, 2/3 of V+. The same circuit, once it reads a high input level, will not read a low level until the input goes lower than the high threshold, say, 1/3 of V+. The region in the middle is a kind of no-man's land where nothing triggers until you either get over the top or under the bottom threshold levels. The point of all this is that it's a DC level. Schmitt trigger inputs can clean up slowly varying signals into clean logic levels, and that is one of their big uses.

Edge-triggered means just that - whatever the DC levels, you need a sharply rising (or falling, if negative edge triggered) signal. Signals moving too slowly either won't trigger the input at all, or will make it work erratically in the middle of the power supply if they're almost but no quite correct.

Quote
If it's done internally like other CMOS Schmitt triggers I've seen, then varying the supply voltage will necessarily vary the trigger points. 
It is - but Schmitt triggers are still Schmitt triggers and still have something like 1/2 of V+ as a no man's land.

Beyond that, even if it were level triggered with a Schmitt input, it would still only trigger on a rising edge (or falling edge, if that's what it's sensitive to), so it would still only put out square waves on repeating waveforms. No matter what you do to the signal, a repeating signal generally only has one repeating signal that will trigger the input. Since it repeats at the signal frequency, it flips the flop once each period, and that necessarily makes for a 50-50 duty cyle square wave at the output of the flipflop. It's the nature of flipflops, not something you can diddle with. Generations of EEs have given portions of their careers to make that true.  :icon_biggrin:

Quote from: Mark Hammer on February 22, 2010, 09:00:36 AM
So, actually, let's expand the scope of this thread to anything that permits an octave-divider - whatever the pedigree - to vary the duty cycle of the octave or sub-octave generated.  If the mod permits pulse-width modulation by foot control or LFO, even better.  We basically need a little bit of animation to those undertones.
Any flipflop worthy of the name will only do square waves. It's part of the inherent nature of the flipflop.

What you're looking for is something which will let you pick off only a part of the resulting waveform to change the frequency spectrum. There are ways to do that, but they get complex quickly.

One method I suggested is to use the (for example) positive edge of the divider output as a trigger for an edge-triggered timer. The timer can be set to put out a positive-going pulse of X microseconds every time there is a positive-going edge on the output of the flipflop. This does what you want, varying the resulting harmonic structure. However, it is a varying harmonic structure as the timer puts a fixed size pulse out and the duty cycle is NOT constant. That may sound interesting and more animated, but it's not what you described.

The other is to make the square wave into a wave with nice sloped sides and run that into a comparator. The output of a comparator with a reference voltage compared to the sloped-side derivative of the square wave is a nice, fixed-duty cycle output as you've described. The problem is making the nice sloped-sided wave from the square wave.

One approach is to simply lowpass filter the square wave. This makes a rounded-corner square wave if the filtering is right, and a comparator would make your variable duty cycle, but the duty cycle would vary quickly up in the flat portion, making a control pot difficult. This is also a problem in that the filter would do different things to different frequency square waves. But it might work over a certain range, maybe 2:1 or 4:1, which is probably enough.

Another approach is to phase lock to the square wave with a PLL that generates both a triangle and a square wave. The PLL locks to the flipflop square wave frequency, the triangle is available for playing duty cycle /pwm games upon. The CD4046 is a single-chip PLL solution, but doesn't have a native triangle output. The XR2206 can be used as the VCO instead of the CD4046 VCO, and it DOES have both sine and triangle available. So you can get the variable PWM from the triangle output, as well as having a pure sine at the divided-down frequency, which is a neat trick in itself. Both the sine and Tri are useful outputs and may be more interesting that PWM for music.

Another variation of this is to use a DIY VCO that makes a square wave and triangle. This circuit does that:http://geofex.com/FX_images/ramp-lfo.pdf
You take the output of the CD4046 chip which would go to the VCO and put it into the input of the DIY VCO. Take the square wave output of the DIY LFO to the comparison input of the 4046. Now the 4046 locks the square wave to the flipflop output, and this drags the triangle along with it. You can then do comparator PWM on the triangle and the PWM stays constant duty cycle as signal frequency varies.

You can then, of course, do filter-y stuff on the triangle, sine, square, combinations thereof, etc.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

R.G.

Doh! Of course someone else thought of t his too.

Quotehttp://techdoc.kvindesland.no/radio/b1/20051213185745265.pdf

Looks to be specialized for 0-1MHz and +/-12V, so the work to make it into 0-9V and 20Hz-10kHz isn't done yet, but the basics are there.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

earthtonesaudio

Of course, you don't have to use the 4013 as a toggle flip flop.  Those S and R inputs can be used to vary duty cycle.  Put your standard square wave signal into the S input, then put an RC filter and inverter on it and run the output of the inverter to the R input.

R.G.

Quote from: earthtonesaudio on February 23, 2010, 10:53:41 AM
Of course, you don't have to use the 4013 as a toggle flip flop.  Those S and R inputs can be used to vary duty cycle.  Put your standard square wave signal into the S input, then put an RC filter and inverter on it and run the output of the inverter to the R input.
Yep. You don't even have to use a 4013 - it's just a handy way to do it. Maestro's effects used discrete transistor flipflops.

The S and R inputs are level sensitive on the 4013, but you do get unusual events if you feed them too slow a signal. That may be musically interesting, but it tends to be unpredictable. Again, maybe good. Depends on what you wanted to do.

Circuit bending is another example of deliberate misuse being something to induce finding something you like.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.