Subharmonic synthesis

Started by parmalee, August 03, 2020, 10:05:28 PM

Previous topic - Next topic

ElectricDruid

Yeah, ring mod is a good idea.

You'd need to make sure that the oscillator tracks the keyboard too though, otherwise your pitches won't be at all musical.

If you can get separate signals for two higher octaves out of the harmonium though, ring mod would be ideal since it could give you the difference: some far lower octave.

Mark Hammer

parmalee asked about "sputteriness" earlier.  The erratic tracking that gets described as "sputtery" is a result of a few things.  Too much harmonic content confuses the flip-flop, since it is unclear what to divide.  On a guitar, compared to a keyboard, the pitch itself is unstable.  We tend to perceptually impose more stability on the pitch than is really there.  As well, division is predicated on reliably exceeding some fixed threshold, and plucked strings yield a highly fluctuating amplitude.  The received wisdom regarding octave-down units is to:

  • provide as harmonic-free an input signal as possible; so, neck pickup, treble cut on the guitar, higher frets/notes where harmnic content is limited
  • provide as pitch-stable an input as possible; so heavier gauge strings that don't yield to light lateral finger-pressure
  • provide as amplitude-stable an input as possible; so compression or at least simple diode limiting of peaks
In the case of the MXR Blue-Box the rectified signal is used to control a crude gate, such that output is suppressed when the divided signal falls below a threshold.

For a plucked dynamic input signal, the challenge exists of how long to maintain the divided signal.  When the signal is a relatively sustained one, like a harmonium or other keyboard, the can-I-still-get-a-reliable-division challenge is significantly reduced.

But I may be assuming too much here.  Just how constant/stable IS the volume of a harmonium?

parmalee

#22
Quote from: ElectricDruid on August 09, 2020, 05:36:05 AM
If you can get separate signals for two higher octaves out of the harmonium though, ring mod would be ideal since it could give you the difference: some far lower octave.

I'm not even going to get in to the countless ways in which I've tried to achieve this "separation" over the years--both mechanical and electronic ways.  OK, I'll just say this:  I actually tried to physically separate and isolate the air chamber, betwixt the bellows and the keybed.  Achieving total isolation, via physical means, is no easy feat.

I've considered the ring mod route.  Harmoniums actually track quite well.  For one, volume level is fairly stable and consistent.  Obviously, you can modulate volume by pedaling harder or softer, but the envelope is mostly just pure sustain.  Most harmoniums of this sort employ two separate reed sets--bass and male--an octave apart, but even when using both, tracking is not much of problem, provided one filters the signal sufficiently.  (Really pricey harmoniums have four reed sets--bass, two male, and female.)

In fact, I've used the harmonium quite a bit with a variation on that old Penfold ring mod--Light Metal Effects, I think--which tracks the signal, rather than using a fixed oscillator. IOW you set the oscillator to a fixed interval of the incoming signal, for slightly subtler ring mod effect.

Incidentally, pitch bending is possible on both harmoniums and accordions, though it's not terribly easy.  I used to know a guy who became quite an expert at pitch bending the accordion--he had studied under some Turkish master.

I am thinking that using three wholly separate bandpass (or lowpass) and division stages for the frequencies of the lowest octave-and-a-half is the best route.  WIth adequate filtering of a very limited range (less than half an octave), I suspect that one can get away with injecting the squarish signal directly into the divider, without having to employ all that follows the filter stages of an OC2-type divider, i.e., zero-crossing and/or peak level detection and suchlike to ensure the divided signal remains in phase with the original. 

Then again, I might just combine this approach with a ring modulation approach--having a serious arsenal somehow seems quite appropriate here.

I think that this curious obsession of mine stems from my deep love of the bass/bass pedal tones of the Farfisa compact series.  Most combo organs had some sort of split-keyboard feature, or separate bass pedals, but none sound quite like the Farfisa Compact series--not even those of the other Farfisa lines, like the Fast or the Professional.  For that matter, I think it even beats the bass pedals of a tonewheel organ.

parmalee

#23
If I do employ the ring modulation approach, which method is likely to achieve the best results here?  Personally, I am partial to the OTA approach, but my preference may simply have to do with what I had on hand.

Dividers of the OC2 variety all use that synchronous detector after the division to switch between the original signal and the inverted one, but I have never put together a "proper" ring mod using that  approach.

parmalee

Quote from: amptramp on August 08, 2020, 06:58:15 PM
There have been instruments that used multiplication of signals to produce sum and difference frequencies.  I have a Minshall Model E organ that has single-triode dividers for generating five octaves of keyboard sounds and uses the combination of a note and its musical fifth going into a stage driven hard into intermodulation territory to generate lower octaves.  For example G1 and C1 produce C0.  This avoids having extra tubes and gigantic (for the era, 1950 to 1951) capacitors to produce the lower octaves and gives the pedalboard a reasonable sound.

Thanks for this.  Funnily, I was thinking about this just the other day, but I couldn't remember which organ used that approach.

parmalee

#25
Quote from: parmalee on August 09, 2020, 10:04:29 PM
If I do employ the ring modulation approach, which method is likely to achieve the best results here?  Personally, I am partial to the OTA approach, but my preference may simply have to do with what I had on hand.

Apologies for responding to myself here, but I couldn't resist.

I would suggest, to myself, that Roger Penfold's Light Metal Effects--which I already mentioned--might be a good place to start, being as it already incorporates the tracking feature with an OTA based ring mod.  See here for schematic:

http://www.experimentalistsanonymous.com/diy/Schematics/Ring%20Modulators%20and%20Frequency%20Shifters/Light%20Metal%20Effects%20Penfold%20Ring%20Mod.pdf

When I built this (on a breadboard--I never finalized it), I used the fundamental detector from the U-boat octave divider, as the one described here was mishap-prone.  Penfold's fundamental detector--page two of the pdf--uses a 555 as a sort of tachometer.  The ring modulator--page three--is a fairly standard one based around the 13700 OTA.

So perhaps the following: A two or three stage bandpass (between ~65 hz to, say, 200 hz) into the fundamental detector and multiplier.  Filter output above ~ 100 hz and blend accordingly with original signal.

For reasons known (or unknown) only to myself, a part of me wants it to be a whole lot more complicated than that.  I'll work on that.

As an aside, I received the DOD Meatbox.  Schematics for the original and the 2015 re-issue can be found on the internets.  Only differences between the two are transistor amplifiers in the original and op-amps in the re-issue.  Frankly, I was not impressed.  It does not seem terribly versatile, and it is really only responsive to very low frequencies--on guitar, it really does not even respond to anything above a open B string.  However, I do kinda like the gyrator filters.


Edit:  Of course, I forgot the divide aspect in my above proposal.  Including that, I suppose a sine wave would likely be the best choice for the carrier?

skyled

The EHX Ring Thing that I mentioned lets you select ring mod lower band, upper band, or regular ring mod, plus some other fun stuff. The Bode Frequency Shifter is similar, but without all the presets and gimmicks. Then there's other DSP based polyphonic pitch shifters and octavers such as the EHX Pog/Micro Pog, EHX Hog, EHX Pitch Fork, the newer Digitech Whammy 5, Digitech Whammy Ricochet, etc.

You could also try the Schumann PLL  :icon_biggrin:

Using any of these combined with signal splitting and low pass filtering should be able to get you what you're looking for. I don't know if you'll be able to accomplish this going entirely DIY and analog. Hell, since you're already miking up the harmonium, you might as well just run the signal into a computer and use effects from there.

ElectricDruid

Quote from: parmalee on August 09, 2020, 09:36:03 PM
Most harmoniums of this sort employ two separate reed sets--bass and male--an octave apart

So there's no way to get separate signals for the two reed sets?

parmalee

Quote from: ElectricDruid on August 10, 2020, 05:07:06 AM
So there's no way to get separate signals for the two reed sets?

Unfortunately, no.  You can open or close either set, but there is no real practical way to isolate the outputs.  Here is an illustration of the profile of a single key and reeds:

from here:  https://www.instructables.com/id/MIDI-Controlled-88-Key-Reed-Organ/

That blue and grey thing at the left (front) is a solenoid--that (at the link) is quite an impressive undertaking, which I shall not be attempting.  However, I did once install 18 micro switches below the bottom set of keys once, along with circuitry.  It actually worked pretty well, but it seemed... I don't know, deceptive or something.

Fortunately, there's an abundance of proper scientific literature on harmoniums/reed organs, and free-reed systems generally.  I suppose, in part, that's got something to do with the harmonium being Helmholtz's instrument of choice for all his research compiled in On the Sensations of Tone as a Physiological Basis for a Theory of Music.  Another awesome, albeit dense, read.  Where would we be today without the Helmholtz Resonator?

amptramp

One of the issues with dividers is the square wave signal you get out of them.  Another approach is to use a switchable gain of +1 / gain of -1 amplifier and apply it to the incoming signal with the switch function selected by a comparator.  If you have a sine wave coming in, the output will be sine followed by - sine which gives you a double hump positive followed by a double hump negative whose fundamental is at half the incoming frequency but it has a different frequency spectrum compared to the square wave fundamental plus 1/3 of the third harmonic plus 1/5 of the fifth harmonic etc.  There was a thread comparing this and other methods of frequency division but I can't remember where it was.

parmalee

Quote from: amptramp on August 10, 2020, 05:37:35 PM
Another approach is to use a switchable gain of +1 / gain of -1 amplifier and apply it to the incoming signal with the switch function selected by a comparator.  If you have a sine wave coming in, the output will be sine followed by - sine which gives you a double hump positive followed by a double hump negative whose fundamental is at half the incoming frequency but it has a different frequency spectrum compared to the square wave fundamental plus 1/3 of the third harmonic plus 1/5 of the fifth harmonic etc.

Personally, I prefer this sound--from either guitar or harmonium--to that of those that switched at peaks, with a DC offset.  Isn't this method also somewhat more reliable, in that there are apt to be more peaks at different levels to contend with than there are zero crossings?

For whatever it is that I am hoping to achieve here--

namely, some element of sub-octave, which is clearly derived from the original source waveform (as opposed to wholly synthesized), BUT, only with respect to the bottom 1/3 to 1/2 of the keyboard

--a secondary consideration is this:  Do I want the sub-octave/subharmonic to diminish as one moves up the keyboard, or do I want it to abruptly cut off at a specified point?  The latter is somewhat more easily obtained, with gating, I suppose, but the former sounds somewhat more appealing.

Rob Strand

#31
QuotePersonally, I prefer this sound--from either guitar or harmonium--to that of those that switched at peaks, with a DC offset.  Isn't this method also somewhat more reliable, in that there are apt to be more peaks at different levels to contend with than there are zero crossings?

I think amptramp was explaining the phase-flipping more than what is flipped.  I guess there's a subtle difference between the detection phase and the phase-flipping.   The detection relates to tracking  *and* tone.   But what is flipped and how the signal is flipped only affect tone it can't affect the tracking. 

I find the Boss detection method quite good.    Both sound and tracking.   There's a few variants which play with the filters and peak detector time constants.    For the Boss the Set and Reset signal are separated far as apart ie. at the peak.    That gives the least chance of the first flip-flop being kicked early.

The U-boat detector  only does one side of the peaks.    The negative peak  set/resets the flip-flip but the zero crossing soon after will reset/set it.  So it has a half cycle "open" to retrigger earlier than the Boss.

The Mutron Octivider had quite a complex detector and it had some form of trigger lockout time-constants to prevent it triggering too early and make it more reliable.   From what I can see it still doesn't track as well as the Boss but I haven't spent enough time on it.

The Penfolds detector has many areas which could be tweaked to help tracking.  The mono-stables are quite short for bass frequencies.  So they could re-trigger somewhat earlier than they need to.   The trigger pulses are very short but I think the mono-stable chosen might ignore extra trigger pulses while the output pulse is high.     I guess the biggest problem with the Penfolds detector  is probably the lack of front-end filtering.   Then there's the choice of the Schmitt-trigger threshold.   So many factors affecting tracking.

As for the sound.   The Boss (and copies) does the phase-flipping at the peaks and folds the signal at the peak.    The way it does that is with a peak detector and diodes in the *audio path* before the phase-flipping circuit.  While the Uboat has a similar detector to the Boss it doesn't fold the signal at the peaks like the Boss.    Flipping at the zero crossing produces the double hump case.  Flipping at the peaks produces discontinuities at  the peaks, which would be expected to be the most buzzy.    So the Boss  and Uboat cover the basic sounds.      Phase-shift in the low-pass filters in the circuit skew reality from the ideal cases.

Maybe you should get into some DSP?   Take some signals from your harmonium and experiment with different filtering and detection schemes.  You can use things like the Octave package.    It might be a steep learning curve but you seem like someone who could do it.   You will be able to hone the detector and filters.   Keep in mind you need to constrain the DSP to things that can be done in analog circuits.    The down side is Octave works off signal files not real-time signals.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

parmalee

#32
Quote from: Rob Strand on August 11, 2020, 07:51:42 PM
Maybe you should get into some DSP?   Take some signals from your harmonium and experiment with different filtering and detection schemes.  You can use things like the Octave package.    It might be a steep learning curve but you seem like someone who could do it.   You will be able to hone the detector and filters.   Keep in mind you need to constrain the DSP to things that can be done in analog circuits.    The down side is Octave works off signal files not real-time signals.

I've done some reading on DSP, but I never find myself sufficiently motivated to translate from thinking to action.  Embedded programming for pics and avrs and suchlike is a somewhat different matter--I can think up plenty of applications, both music related and otherwise, to keep me busy and that I'll actually use.. With respect to DSP, certain applications sound good; whereas others bring to mind the horrors of PK Dick or JG Ballard stories.

That said, I can certainly appreciate the experimental, for which practical applications (that I, personally, will actually use) are wholly absent, but if it's going to take me hundreds of hours just to get to the point at which I can, say, make a light blink, but do little else, I might find myself a bit miffed and depressed.  What are the best introductory materials for DSP?

On a somewhat related note, has anyone ever played around with this stem-isolation software?

   Spleeter <<<

It actually works surprisingly well (certain types of music excepted, of course), and is amost usable. (In fact, I almost did actually use it to remove some bothersome sibilance from an old track for some forthcoming compilation release. The song had multiple, mostly lost, origins, i.e., 4-track cassette, 1/2" and hard drive, so working from the completed, mixed track was the only option.) And, of course, it learns, so it's getting better and better.  Alas, it works with files, and not in real-time.

Rob Strand

#33
QuoteThat said, I can certainly appreciate the experimental, for which practical applications (that I, personally, will actually use) are wholly absent, but if it's going to take me hundreds of hours just to get to the point at which I can, say, make a light blink, but do little else, I might find myself a bit miffed and depressed.  What are the best introductory materials for DSP?

It definitely takes quite a bit of motivation and drive to bother.   DSP is a massive subject and it is very mathematical.  Big thick books with zillions of equations and abstract concepts, and that's only the introductory stuff.   

However, it is possible to go a long way by just using the functions in the package as "black boxes" and stitching those together.   It you take analog filters as an example there is a lot of theory and maths but if you just know what a low-pass filter does and have a part value calculator you can get the job done without knowing much theory or maths.    DSP can be used a lot like that these days.    You can design filters using functions in library, just  supply the parameters and it spits out the filter coefficients.   The problem with a lot of packages is trying to understand what the function parameters actually mean, they are quite inconsistent and surprisingly messy.   So if you get frustrated don' t let it stop you.   That's just how those packages are.

One tip I can give you using things like Octave is to think in terms of  vectors not in terms of individual samples.  You can work in individual samples but it is extraordinarily slow.  Suppose you want to set values in an array or vector greater than 1000 to zero.

Processing by samples you might go, (no particular language),
         n = size(x)
         for k = 1 to n
               if x(k) > 1000 then
                    x = 0

But in vectors it's more efficient to go,
        k = find( x > 1000)            ; k is itself a vector of all the indexes of x > 1000
        x(k) = 0

The internal functions can process large amounts of data much faster than the individual statements in the programming language itself.

A good introduction to DSP is,
http://www.dspguide.com/
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

parmalee

Quote from: Rob Strand on August 12, 2020, 02:38:07 AM
It definitely takes quite a bit of motivation and drive to bother.   DSP is a massive subject and it is very mathematical.  Big thick books with zillions of equations and abstract concepts, and that's only the introductory stuff.   

...

A good introduction to DSP is,
http://www.dspguide.com/
This is all very helpful and much appreciated--thank you!

One has to be mindful when using those "black boxes" of not using them as an excuse to not bother learning anything.  Whenever I use such, I at least try to have a fairly decent understanding of what is going on within them, even if I am not quite capable of programming such.

I've downloaded a few chapters from that book, but I may just have to obtain a hard copy.  No matter what anyone says, a screen is not--and never likely shall be--a replacement for a proper textbook in material form.

Incidentally, the Boss OC-3--the DSP one--may be suitable for my applications here, with some adaptation.  The OC-3 has that "split" feature:  the poly/range setting allows one to have only a specified range of lower notes be divided, whilst the upper notes are left alone and "un-effected."  It's not perfect, of course, but it can work reasonably well if one is mindful in how one plays.

How is this most likely achieved in DSP?  Would it simply be a matter of heavy filtration, the sort that would be impractical to implement in the analogue domain--sort of like an ideal crossover that comes closer to the "brick wall" ideal for frequency rolloff?  Or is there some sort of method that is really only obtainable in the digital domain, practical or otherwise?

ElectricDruid

Quote from: parmalee on August 14, 2020, 11:12:51 AM
How is this most likely achieved in DSP?  Would it simply be a matter of heavy filtration, the sort that would be impractical to implement in the analogue domain--sort of like an ideal crossover that comes closer to the "brick wall" ideal for frequency rolloff?  Or is there some sort of method that is really only obtainable in the digital domain, practical or otherwise?

There are definitely techniques that are possible in DSP and could never be done in analog electronics. One such is "auto correlation" which is a technique for spotting which sections of a waveform match which other sections. Since consecutive waveforms in a sound tend to be of similar shape, finding the sections that match best usually gives you a good idea of the fundamental frequency. You can then use that information to guide other processing - so filtering (for example) can respond to the signal that is feeding it.
Another absolutely fundamental technique for DSP is the fast Fourier transform. You can take a waveform apart, process it in the frequency domain instead of the time domain, and then put it back together again. That's not entirely impossible using analog electronics (it's more or less what a Vocoder does, for example) but it certainly takes a lot of circuitry!

I have no idea how Boss did their DSP sub-octave, but if I was doing it, I'd start by playing samples out at half the rate I was reading them in, and then I'd use auto-correlation, spotting zero-crossings or some other technique to find the fundamental pitch so I could skip every other wave cycle of the input signal. This is a "downwards pitch shifter" technique, but knowing the fundamental allows you to "hide the joins" much better than a basic pitch shifter can manage.
I don't know how well such things work on polyphonic material. That's beyond any DSP knowledge I have, but I expect there's a few papers on the topic flying about.

parmalee

Quote from: ElectricDruid on August 14, 2020, 02:49:37 PM
There are definitely techniques that are possible in DSP and could never be done in analog electronics. One such is "auto correlation" which is a technique for spotting which sections of a waveform match which other sections. Since consecutive waveforms in a sound tend to be of similar shape, finding the sections that match best usually gives you a good idea of the fundamental frequency. You can then use that information to guide other processing - so filtering (for example) can respond to the signal that is feeding it.
Another absolutely fundamental technique for DSP is the fast Fourier transform. You can take a waveform apart, process it in the frequency domain instead of the time domain, and then put it back together again. That's not entirely impossible using analog electronics (it's more or less what a Vocoder does, for example) but it certainly takes a lot of circuitry!
Ahhh, FFT.  Yeah, I guess that would be a nightmare in the analogue domain.  Am I entirely wrong in thinking that what can be achieved in DSP is theoretically possible with analog, but might take an entire room--even if done with the smallest SMD--to functionally implement?

QuoteI have no idea how Boss did their DSP sub-octave, but if I was doing it, I'd start by playing samples out at half the rate I was reading them in, and then I'd use auto-correlation, spotting zero-crossings or some other technique to find the fundamental pitch so I could skip every other wave cycle of the input signal. This is a "downwards pitch shifter" technique, but knowing the fundamental allows you to "hide the joins" much better than a basic pitch shifter can manage.
I don't know how well such things work on polyphonic material. That's beyond any DSP knowledge I have, but I expect there's a few papers on the topic flying about.
I think that, in the case of OC-3, the "polyphonic" descriptor might be a tad misleading.  To my knowledge, it will not reproduce the divisions polyphonically, but rather, it can accept (to a degree) a polyphonic signal, and will reproduce half the frequency of the fundamental of the lowest note input.  Whereas the POGs, HOGS and suchlike will produce polyphonic multiples and divisions.

That Deezer software linked above is really quite impressive; however, it does not work in real-time, of course.  At present, it can isolate vocals, bass, piano and drums.  The results are of surprisingly decent quality, but they're not quite useable-- inharmonic percussion (cymbals, hats, etc.) sound pretty funky, for instance.  Still, isolating, say, a low male voice from a stringed bass instrument is pretty amazing.

ElectricDruid

Quote from: parmalee on August 14, 2020, 03:48:46 PM
Ahhh, FFT.  Yeah, I guess that would be a nightmare in the analogue domain.  Am I entirely wrong in thinking that what can be achieved in DSP is theoretically possible with analog, but might take an entire room--even if done with the smallest SMD--to functionally implement?

I'm not immediately sure. That's an interesting question, and consequently I should think about it. ;)

parmalee

Quote from: ElectricDruid on August 14, 2020, 07:14:15 PM
I'm not immediately sure. That's an interesting question, and consequently I should think about it. ;)
I'm leaning towards thinking that my assumption--that anything that can be done with DSP would theoretically, be possible, simply not feasible, with analog--is actually correct.  Otherwise, wouldn't DSP therefore be... erm, magic?

11-90-an

Quote from: parmalee on August 14, 2020, 07:56:57 PM
Quote from: ElectricDruid on August 14, 2020, 07:14:15 PM
I'm not immediately sure. That's an interesting question, and consequently I should think about it. ;)
I'm leaning towards thinking that my assumption--that anything that can be done with DSP would theoretically, be possible, simply not feasible, with analog--is actually correct.  Otherwise, wouldn't DSP therefore be... erm, magic?

Hopefully yes... so there is still hope for a analog tap tempo!! :icon_mrgreen:
flip flop flip flop flip