Adding "frequency distortion" to a guitar signal

Started by ZillaG, September 10, 2023, 01:50:42 AM

Previous topic - Next topic

ZillaG

I posted the question Need a simple guitar splitter (https://www.diystompboxes.com/smfforum/index.php?topic=131123.0) and in there I referenced "another circuit." with this circuit, I want to create a circuit that introduces a slight "frequency distortion." Say for a 440Hz signal, I want it to create a 435-445Hz signal. I found this article that talks about frequency modulation https://www.instructables.com/FM-Modulationde-modulation-Circuit/. Is this a good start? It does seem overkill for what I want to do. Any other ideas?

ElectricDruid

That circuit certainly looks pretty weird. It's a lot of building-blocks bolted together without apparently a lot of understanding. The filter design, for example, is just a lot of one-pole sections stuck together. That's an extremely inefficient way to make the filter. It probably works, but it's not well designed.

Frequency modulation/demodulation is capable of producing the type of shift you're talking about, but it comes with a side-effect. FM is a linear-in-frequency process, so if you add 5Hz to your 440Hz input signal, you also add 5Hz to any harmonics that that signal has. That means that they stop being harmonically related. That's not too bad for only 5Hz, but imagine adding 25Hz. Now 440 becomes 465, and the second harmonic at 880 becomes 1005Hz and the third goes from 1320 to 1345Hz. Those numbers 465, 1005, 1345 don't form any sort of harmonic sequence so the sound becomes increasingly dischordant and clangorous.

This is the difference between "pitch shifting" and "frequency shifting". Pitch shifting changes the input signal by shifting everything by a percentage, so harmonic relationships are preserved. If 440Hz goes up 10%, 880 goes up by 10% too. Unfortunately pitch shifting is difficult bordering impossible to do well with analog circuits.

There's another thread going on dealing with Ring Modulation which you might like to have a look at. Ring modulation also generates the same sort of inharmonic overtones that FM does (except avoiding the Bessel functions!). For Ring Mod, if you put frequencies x and y in, you get x+y and x-y out. And again, that applies to all the harmonics too, so if signal x has harmonics at 2x and 3x, you also get 2x+y, 2x-y, 3x+y, and 3x-y. This is where the "clang" comes from!

It's all good fun to play with though, so I recommend looking into it.


Mark Hammer

And, as noted in the linked-to thread, unless there is some means for adjusting the modulation frequency in an intelligent way, the "almost pitched" quality of the sideband products changes, depending on where one happens to be on the fretboard.  Adding and subtracting 50hz has less impact on the perceived pitch of high notes on the unwound strings, than on the perceived pitch of stuff below the 5th fret on the wound strings.

That's not a caution to stay away from it, just a realistic approach on what to expect.  As with many things in life, looking at the abstract concepts seems simple and straightforward; the devil lies in the concrete details.

ZillaG

The 50Hz modulation is just an example. Thanks all. What a great forum!

antonis

Quote from: ElectricDruid on September 10, 2023, 06:53:17 AM
This is the difference between "pitch shifting" and "frequency shifting".

Or the difference between guitar whammy bar (vibrato) and moving ambulance siren (Doppler effect).. :icon_lol:
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Mark Hammer

Quote from: ElectricDruid on September 10, 2023, 06:53:17 AM
That circuit certainly looks pretty weird. It's a lot of building-blocks bolted together without apparently a lot of understanding. The filter design, for example, is just a lot of one-pole sections stuck together. That's an extremely inefficient way to make the filter. It probably works, but it's not well designed.

Frequency modulation/demodulation is capable of producing the type of shift you're talking about, but it comes with a side-effect. FM is a linear-in-frequency process, so if you add 5Hz to your 440Hz input signal, you also add 5Hz to any harmonics that that signal has. That means that they stop being harmonically related. That's not too bad for only 5Hz, but imagine adding 25Hz. Now 440 becomes 465, and the second harmonic at 880 becomes 1005Hz and the third goes from 1320 to 1345Hz. Those numbers 465, 1005, 1345 don't form any sort of harmonic sequence so the sound becomes increasingly dischordant and clangorous.

This is the difference between "pitch shifting" and "frequency shifting". Pitch shifting changes the input signal by shifting everything by a percentage, so harmonic relationships are preserved. If 440Hz goes up 10%, 880 goes up by 10% too. Unfortunately pitch shifting is difficult bordering impossible to do well with analog circuits.

There's another thread going on dealing with Ring Modulation which you might like to have a look at. Ring modulation also generates the same sort of inharmonic overtones that FM does (except avoiding the Bessel functions!). For Ring Mod, if you put frequencies x and y in, you get x+y and x-y out. And again, that applies to all the harmonics too, so if signal x has harmonics at 2x and 3x, you also get 2x+y, 2x-y, 3x+y, and 3x-y. This is where the "clang" comes from!

It's all good fun to play with though, so I recommend looking into it.
That may be a little off.
"Pitch shifting" does move everything proportionally, such that all harmonics are retained and appropriate to the new pitch.  "Frequency shifting" adds (or subtracts) a constant, that does NOT change proportionally.  So if one "frequency shifts" a 440hz note upwards by 10hz, that 10hz shift is also true of all the harmonics accompanying that note (and the same if the shift is in a downwards direction).  But that shift remains constant for ALL content fed into the shifter.  A 1000hz note would also be bumped up (or down) by 10hz, along with its harmonics, and so on.  It will sound similar, but not identical, to a ring modulator.  One of the things it will also do is yield "beats" when the frequency shift is very very slight, just like two guitar strings that are almost, but not quite, in tune with each other.  Former forum member Mike Irwin designed this one for MODCAN, and provided some sound samples.  A nice explanation is also provided.   https://www.modcan.com/amodules/freqshifter.html

ElectricDruid

Aah, yes, I know the Modcan Frequency Shifter. My mentor Eric Brombaugh wrote the firmware for the digital Eurorack version:

https://www.modcan.com/emodules/dualfreqshifter.html

Sorry if I didn't manage to explain the difference correctly. It's not easy to express clearly, or equivalently, it's easy to get tangled up while trying!

Mark Hammer


ElectricDruid

Quote from: Mark Hammer on September 11, 2023, 03:27:41 PM
Small world indeed. :icon_biggrin:
<offtopic>
The world of "people that write firmware for music electronics" is small. The world of "people that write firmware for eurorack and pedal applications" is absolutely tiny!!
</offtopic>

Mark Hammer

The museum tech I'm working with on the "electronic sackbut" project spends much of his days dealing with microcontrollers that operate information displays in the 3 museums he works for.  That's the trouble with inviting children to touch things.  He has a big cabinet full of Arduinos and Raspberry Pis, and is currently working on the encoding of the sackbut pots I wired up from CV to MIDI, to drive the Eaganmatrix modules.  I hope he can teach me some Arduino tricks, because I'm starting from scratch (though I haven't got as far as Scratch with my Raspberry Pi units  :icon_wink: )  He did demonstrate for me how OpenAI could be prompted to write Arduino code, and it squirted out a CV-to-MIDI convertor for us, on request.

Now, if the world was small enough for me to find out where the heck Mike Irwin went to, I'd be very happy.  He just vanished.

ZillaG

Quote from: ElectricDruid on September 10, 2023, 06:53:17 AM
That circuit certainly looks pretty weird. It's a lot of building-blocks bolted together without apparently a lot of understanding. The filter design, for example, is just a lot of one-pole sections stuck together. That's an extremely inefficient way to make the filter. It probably works, but it's not well designed.

Frequency modulation/demodulation is capable of producing the type of shift you're talking about, but it comes with a side-effect. FM is a linear-in-frequency process, so if you add 5Hz to your 440Hz input signal, you also add 5Hz to any harmonics that that signal has. That means that they stop being harmonically related. That's not too bad for only 5Hz, but imagine adding 25Hz. Now 440 becomes 465, and the second harmonic at 880 becomes 1005Hz and the third goes from 1320 to 1345Hz. Those numbers 465, 1005, 1345 don't form any sort of harmonic sequence so the sound becomes increasingly dischordant and clangorous.

This is the difference between "pitch shifting" and "frequency shifting". Pitch shifting changes the input signal by shifting everything by a percentage, so harmonic relationships are preserved. If 440Hz goes up 10%, 880 goes up by 10% too. Unfortunately pitch shifting is difficult bordering impossible to do well with analog circuits.

There's another thread going on dealing with Ring Modulation which you might like to have a look at. Ring modulation also generates the same sort of inharmonic overtones that FM does (except avoiding the Bessel functions!). For Ring Mod, if you put frequencies x and y in, you get x+y and x-y out. And again, that applies to all the harmonics too, so if signal x has harmonics at 2x and 3x, you also get 2x+y, 2x-y, 3x+y, and 3x-y. This is where the "clang" comes from!

It's all good fun to play with though, so I recommend looking into it.

Yes, that's the effect I want. I want the fundamental frequency and its harmonics to shift the same amount.

Rob Strand

Here's an old-school analog implementation:

ETI project 486, Howl-Round Stabilizer,  ETI Magazine (au) Nov 1977, p57 (PDF page 56)
https://worldradiohistory.com/AUSTRALIA/ETI-Australia/70s/ETI-1977-11-November.pdf
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

Quote from: Rob Strand on September 11, 2023, 10:37:36 PM
Here's an old-school ....
Pg 65: 1K static RAM. (Kids, ask your grandfathers.)
Pg 66: 64K dynamic RAMs are rumoured to exist!
Pg 92: TI's TL0 opamps. TL081 is general purpose, new TL071 is low-noise, TL061 is low power.
Pg 102: Horny Speaker De-Luxe!

Pg 2 is giving me flashbacks. I can't imagine how many crates of Maxell UD I have deflowered.

  • SUPPORTER

Rob Strand

QuotePg 65: 1K static RAM. (Kids, ask your grandfathers.)
Pg 66: 64K dynamic RAMs are rumoured to exist!
Pg 92: TI's TL0 opamps. TL081 is general purpose, new TL071 is low-noise, TL061 is low power.
Pg 102: Horny Speaker De-Luxe!

Pg 2 is giving me flashbacks. I can't imagine how many crates of Maxell UD I have deflowered.

I remember all of that stuff like yesterday.

TDK tapes were a little more popular here: AD's, SA's.

We built our own S100 computer.  Hand soldered most of the boards.  They were packed with chips. Hand-wired each switch of the entire QERTY keyboard.    At that time my debugging skills were barely up to speed.

S100 boards:
http://q7.neurotica.com/Oldtech/S100/Boards.html

We had 4k static RAM boards which were this dense:
http://q7.neurotica.com/Oldtech/S100/EconoramII.jpg

DRAM was expensive when it first came out.   The S100 systems totally knee-capped the build-in refresh from the Z-80 processors which complicated the DRAM boards.

Programs were stored on cassettes!   Not even floppy disks.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

matopotato

Quote from: Rob Strand on September 12, 2023, 02:41:10 AM
Programs were stored on cassettes!   Not even floppy disks.

I remember when cassettes came, it felt modern.
Might be mistaken but I seem to recall using paper tapes with punched holes that could be re-fed back to read program instructions. Sort of a step up from punch cards.
"Should have breadboarded it first"

Rob Strand

QuoteI remember when cassettes came, it felt modern.

I was just young enough that they appeared by stealth.   We had a reel-to-reel, then my father also got a cassette and used both.   The cars had AM radios then the next car had a cassette.  Before you knew it everyone had cassettes and people could take them to friend's houses etc.   The reel-to-reel got used less and less, then it didn't fit in the new "wall unit" and was ousted - in our case one of the heads went bung on the reel-to-reel.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Mark Hammer

Quote from: matopotato on September 12, 2023, 04:17:15 AM
Quote from: Rob Strand on September 12, 2023, 02:41:10 AM
Programs were stored on cassettes!   Not even floppy disks.

I remember when cassettes came, it felt modern.
Might be mistaken but I seem to recall using paper tapes with punched holes that could be re-fed back to read program instructions. Sort of a step up from punch cards.
The PDP 8i that I worked with in late 1976 was the size of a commercial refrigerator, used paper tapes produced by the teletype keyboard/punch we had (no screens at that time), and had to be booted each morning by manually entering the bootstrap program in octal, with the switches on the front panel, in order to be able to read the paper tape.  I was told that our lab had a collection of all golf games available at the time, on paper tape, though I have no idea what playing them would have been like.  Our hard drive had a platter the size of an extra large pizza, and held a whopping HUGE 10 meg.  As I was instructed, the read/write head could not be parked.  The platter had to be kept afloat at all times, so we had a UPS the size of a large picnic basket.

Oh, and we had to walk to the lab in the driving snow, uphill both ways.  :icon_wink:  Mind you, after fracturing my knee a year later, and having an ankle-to-hip cast to stabilize it, it sure FELT like walking uphill both ways, especially in the winter.

matopotato

<thread derail and possibly hogging>
I had an old reel-to-reel left over from mom's school. It had an amp function so later I was able to plug in my
home made (wood workshop at school, 1.7y to build) strat copy guitar.
It worked! But the neck was beyond baseball or even cricket bat almost.
I regret getting rid of it though.
</thread derail and possibly hogging>

@ZillaG: are you closer to what you want to biild and how?
"Should have breadboarded it first"

amptramp

Quote from: matopotato on September 12, 2023, 04:17:15 AM
Quote from: Rob Strand on September 12, 2023, 02:41:10 AM
Programs were stored on cassettes!   Not even floppy disks.

I remember when cassettes came, it felt modern.
Might be mistaken but I seem to recall using paper tapes with punched holes that could be re-fed back to read program instructions. Sort of a step up from punch cards.

Paper with holes in it?  This is a coin-operated music box with xylophone, drum and triangle and probably a few other items I don't remember:





Here is another coin-op instrument, the precursor of the juke box, from 1912:





This one has a violin with mechanical rotary e-bow plus piano.  These were rented by taverns and the proceeds were split between the bar owner and the machine supplier, like a vending machine.

What did you think, I was just going to show you a player piano?  Everybody has one of those.  "There is nothing new under the sun." - Solomon.  And if it truly hasn't been seen in historical times, they probably had it in Atlantis.

Mark Hammer

One of the most fascinating books I ever read was one about mechanized automated music devices.  It covered things like the paper-roll devices shown above, but surprisingly they go back a LOT farther than the late 1800s or early 1900s.  That said, those devices were commercial coin-operated sources of music.  The ones from much earlier eras (and even Da Vinci designed one) were generally privately-owned devices, made for a wealthy benefactor.  They were essentially very large music boxes.

But wouldn't you love to see an entire extended episode of "How It's Made" devoted to design and assembly of one of those paper-roll things?