Author Topic: How hard would it be to make something like EHX's key9/b9/mel9 etc?  (Read 6950 times)

deadlyshart

Hey guys, I recently heard EHX's synth pedals that turn a guitar sound into classic organ/synth sounds, and I love it. Here's the key9, for example: http://www.ehx.com/products/key9

So I'm pretty positive it's a digital circuit, right? Taking a look at the guts shot, I'm not seeing a lot of discrete components: http://www.harmonycentral.com/images/uploads/ehx-b9-organ-machine-gutshot-7425eb5b.jpg

and that makes sense to me. Is the following, my naive guess of how it works, correct? my understanding is that, because they want to create a new *timbre* for a given note you're playing, the electronics has to figure out the fundamental input frequency (because the guitar has its own timbre of overtones/etc), and then just reconstruct the note from there with the correct timbre?

So my real question is, has anyone does this type of stuff on a DIY level, and how doable is it? I would loooove to make one of these and be able to mess around with the sounds by programming it. I briefly looked into doing it with an Arduino and found a little, but it seems like it's hard to do.

Is this within the realm of possibilities?

thanks!

vigilante397

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #1 on: February 23, 2017, 02:41:21 PM »
Very much digital, and not very doable in a DIY way. They are very cool pedals, I owned a B9 for a little while and it was awesome. And while you can get similar with DIY stuff (I run a fuzz into an octave up+octave down for an organ-ish sound live) if that's exactly the sound you want I'm afriad you're just going to have to buy one. But I can promise they are well worth the price 8)
"I'm not sure what "serious design flaws" you see. Does it explode or poison your dog?" - PRR

www.sushiboxfx.com

deadlyshart

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #2 on: February 23, 2017, 03:09:06 PM »
Hmm, okay... do you know any more about how they work? I'm curious.

I might just buy one, I have the cash. I just want to know if I can make them, because it's really satisfying.

markseel

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #3 on: February 23, 2017, 03:16:30 PM »
Quote
Very much digital, and not very doable in a DIY way

... how would a kind of guitar-synth be implemented? A whole bunch of filters + gates/triggers or by FFT? With FFT one will introduce latency because of the frame/window size, but with high samplerates (96kHz?) and small framesizes (1k?) that might be ok-ish.

I ask because daydreaming about things to use your board for might be to do a kind of EHX B-9/C-9/etc. workalike. In this case FFT might actually be ok, if you start a 'click' sample right away on the attack of the notes but only start the correct pitched sample after analysis.

Steve Newton

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #4 on: February 23, 2017, 03:20:55 PM »
When the B9 first came out I started to read an article about it and the technology behind it and some other EHX pedals like the Superego.

I was in a hurry and didn't read it all and I thought I'd bookmarked it for later. I've never been able to find it again.

But basically what I did read suggested that it's not pitch extraction and processing that but is a 'granular' based system. Finite slices of time processed and blended. So if at any instant you are playing say, a root, flat third, fifth, flat seventh stack of notes, the contents of that slice of time get processed. The unit doesn't have to figure out that you are playing E, G, B and D or whatever.

Fiendishly mathematical, and probably beyond us DIYers even if we can get the chips to run the code.
Steve.
Not my circus, not my monkey.

markseel

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #5 on: February 23, 2017, 03:45:35 PM »
Anyone know how this stuff works?  I can provide FFT, time-domain filter, and energy/RMS detection code but I'm not sure they come together.  Nor do I know how instrument synthesis works.

It seems that using FFT or filter banks could be used to detect energy at various frequencies that either correspond with notes (E, G, B whatever you consider those to be as far as specific frequency) or who's relative frequency spacing (root, third, fifth) can be determined.

So maybe two steps here?  Determine 'notes' or whatever we're calling them and translate that to a stream of codes that represent these notes/bins temporally and then push those to a synthesis system that operations in parallel - both operating in real time.  Hmmm, it even seems that this intermediate stream of 'codes' could be MIDI allowing Guitar-->MIDI, MIDI-->Synthesis, and Guitar-->Synthesis.

Anyway I've not read about any of this but I can provide digital/DSP frequency and time domain foundations for other work.

Digital Larry

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #6 on: February 23, 2017, 03:53:49 PM »
See "Phase Vocoder".

https://ccrma.stanford.edu/~jos/parshl/Phase_Vocoder.html

https://guitarextended.wordpress.com/2012/04/04/polyphonic-synth-using-phase-vocoder-in-pure-data/

I ran the Pure Data Phase Vocoder on my PC using the Focusrite interface for guitar input.  Incomplete but kinda interesting! 
Digital Larry
DSP tinkerer and former transistor twister


Digital Larry

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #8 on: February 23, 2017, 08:46:32 PM »
Here's a little more light reading on the topic (cough)...

https://ccrma.stanford.edu/~jos/sasp/
Digital Larry
DSP tinkerer and former transistor twister

potul

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #9 on: February 24, 2017, 08:28:03 AM »
Answering the OP: There is currently no DIY project that can achieve this. I've explored  multiple DIY-friendly ways to achieve similar things with different results:

-Raspberry pi + puredata: You can get very close, but when you go polyphonic, things get funky. Rpi is a great platform, but it's tricky to make it work "headless" without display, keyboard and so on. At the end, it's a small PC, it suffers from the same issues (hanging from time to time, you need to close it correctly, etc...)

-PIC for fundamental detection (guitar to MIDI) + some sort of MIDI synth (it can be DIY as well). There is a GUITAR2MIDI project here in the forum that works reasonably well for MONOPHONIC playing, using zero-crossing detection algorithms. No chords, and no bendings.

-I started a project with dsPIC using FFT  and autocorrelation in order to improve guitar to MIDI fundamental detection, but I never finished it.

-There are some software based solutions (like MIDI guitar 2.0) that seem to work pretty well. You need a PC though. And it's not really DIY.

After playing with all these for some years, I ended up buying an EHX C9, and I don't regret it.
This doesn't mean I stopped investigating this area... that's the fun of DIY. But when I want to really play guitar with organ sounds, I use the C9.

Mat

markseel

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #10 on: February 24, 2017, 10:50:47 AM »
Good feedback/info and based on that is seems that hardware was the limiting factor?  When folks say something can't be done and haven't tried that really fires me up.  So it's encouraging to see that you actually looked into it and gave it a shot - you would probably have some good insights into implementation.

For me a PC is a no go (not portable and more latency than I want putting the latency and psychoacoustic arguments aside).  rPI wasn't meant for this stuff although there's projects that get the latency way down.  But how much real-time audio DSP is it capable of and what about appropriate guitar-level analog interfaces?  The dsPIC for audio DSP work?  Forget that.

My FlexFX board offers 2000 MIP's (up to 4000 MIP's depending on instruction mix using dual-issue pipelines), hardware threading with 300+ MBit transfers between them, three 500 MHz single-cycle 32x32=64 multiply accumulated units, low latency USB and ultra-low latency I2S/PCM/TDM.  This is serious hardware.  So as far as a HW feasibility study I'll start from there and I suspect that there's enough compute to at least do guitar to MIDI via windowed STFT or wavelets or whatever.

Looking at pictures of the B9/C9 PCB I see an AKM CODEC and TQFP64 IC which must be the MCU/DSP.  Anyone know what DSP this is?  From the looks of it (being a relatively small package) this does't look exotic in any way.

Interesting post on the B9: http://www.vguitarforums.com/smf/index.php?topic=11574.0

I wouldn't suggest putting off buying a C9 nor would I suggest giving up on trying it yourself if you're into that.  Do both.  After all one review states "Given the low cost and ease of use, the C9 is a seriously impressive device." and I believe that 100% ... and it works right now.  Hmm but if you're driven by DIY ...

The FlexFX digital and analog boards take care of circuitry, USB audio, I2S, MIDI, sample data flow, DSP libraries, etc. leaving you (us) with just the application specific DSP to figure out and implement.  There's lots of smart folks here and out there - I'm sure if we collaborate we could figure this out.

I'd like to look into implementing the windowing, the sliding STFT (or Wavelets although they seem to reduce to almost the same thing for this app?), and energy detection to MIDI conversion when I have time so that I know what the MIP's load on this board will be.  Starting with the math is pretty hardcore - anyone have source code for various aspects of this?  That might speed things up.

BTW the FlexFX board prototype run has been quoted - three boards for almost $3K!  A big investment but I *have* to prove that the HW design is correct and that the boards are manufacturable.  I'd like to get these boards mass produced to bring cost down to $100 to $125 per board (PCB, assembly, BOM/parts) but it's going to take some interest from the community to make that leap (perhaps via KickStarter).  If anyone's really serious about developing code for this board for apps such as guitar effects, high-channel count instrument interfaces and mixers, cab sims, instrument synthesizers, guitar-->MIDI, etc. and making that code publicly available on a FlexFX code sharing site then I'd consider getting you a board at low cost (maybe free).
« Last Edit: February 24, 2017, 11:03:19 AM by markseel »

slacker

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #11 on: February 24, 2017, 01:09:49 PM »
TQFP64 IC which must be the MCU/DSP.  Anyone know what DSP this is? 

It's an Analog Devices part, other EHX pedals use Blackfin DSPs, I had a quick look on the AD website and I couldn't see anything obvious in TQFP though.

slacker

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #12 on: February 24, 2017, 01:29:58 PM »
If deadlyshart hasn't already been scared off you can do "simple" organ sounds using pitch shifting to add extra harmonics, octaves up, down, fifths or whatever, add compression to get rid of the distinctive guitar attack and add sustain, chuck in some modulation to taste and you can get organish noises.
Something like the Earthquaker Devices Organizer, which is almost certainly Spin FV-1 based, is DIYable using either an FV-1 or a suitable MCU and an external codec/ADC-DAC combo. You could just about do it using though hole parts if you used a DSPic.

« Last Edit: February 24, 2017, 01:31:53 PM by slacker »

markseel

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #13 on: February 24, 2017, 02:28:27 PM »
Quote
It's an Analog Devices part, other EHX pedals use Blackfin DSPs, I had a quick look on the AD website and I couldn't see anything obvious in TQFP though.

I see that their POG uses an ADI Blacken so maybe so maybe I looked at the wrong part?

slacker

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #14 on: February 24, 2017, 03:54:48 PM »
I had another look and found a thread on "the other" forum about the EHX Pitchfork that had a photo with very similar looking parts to the ones in deadlyshart's photo. The part number was BF592KCPZ which is available in a 64 pin QFP package http://www.analog.com/media/en/technical-documentation/data-sheets/ADSP-BF592.pdf I must have missed it when I looked on the AD website earlier. It would make sense for them to use the same parts in multiple pedals so it could be it.


Ruptor

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #15 on: February 25, 2017, 05:41:15 PM »
As already mentioned the sliding DFT is required to do this kind of job and if you do a Web search of "Sliding DFT" there is lots of stuff about it. It comes in to its own when the number of frequencies to deal with is low and since a guitar only has 6 fundamental frequencies Sliding DFT is the perfect match. I found this article that at a quick glance looks useful.
http://www.convict.lu/Jeunes/ultimate_stuff/RFT.pdf

deadlyshart

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #16 on: February 26, 2017, 08:14:19 PM »
Hi guys, I haven't been scared off! Just quickly mostly out of my depth here, but still interested.

A brief googling of the ADSP-BF592 says that it's only about $10, so price itself doesn't seem crazy, unless it needs some sort of crazy programmer. It is also definitely SMT or even finer, so that would be tricky.

I know the basic idea of FFT/DFT stuff, having done a little bit of it (but in software, not with hardware). So from what Ruptor said:

Quote
As already mentioned the sliding DFT is required to do this kind of job and if you do a Web search of "Sliding DFT" there is lots of stuff about it. It comes in to its own when the number of frequencies to deal with is low and since a guitar only has 6 fundamental frequencies Sliding DFT is the perfect match. I found this article that at a quick glance looks useful.

am I right in thinking that this may be what I was originally guessing? That it does FFT magic to figure out the actual notes (i.e., fundamental freqs) being played, then "reconstructs" those notes with the timbre you want? That's what I understood from "only has 6 fundamental freqs", anyway.

(I wonder/can speculate what happens if you play a chord with an octave in it -- how will it know that the higher one is an actual distinct note rather than just an overtone of the lower one? I'm guessing that it has some sort of amplitude threshold, and the octave note would have roughly the same amplitude as the lower note, whereas overtones drop off in amplitude really quickly.)

also, I'm sure it can't actually do stuff this complicated, but it appears that someone *has* gotten DSP stuff to work on an arduino! http://interface.khm.de/index.php/lab/interfaces-advanced/arduino-realtime-audio-processing/

samhay

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #17 on: February 27, 2017, 04:59:48 AM »
>If deadlyshart hasn't already been scared off you can do "simple" organ sounds using pitch shifting to add extra harmonics, octaves up, down, fifths or whatever, add compression to get rid of the distinctive guitar attack and add sustain, chuck in some modulation to taste and you can get organish noises.

This is very do-able with a dsPIC. I have a mini POG-a-like going on the breadboard, which makes use of the 2 DACS on the 33FJ64GP802 to output separate octaves up and down from a single ring buffer. It would cost little extra parts to add regeneration and/or variable ringbuffer length for psuedo-reverb, and I think it would sound pretty similar to the 'Organizer' at this point.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

potul

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #18 on: February 27, 2017, 10:24:43 AM »
Good feedback/info and based on that is seems that hardware was the limiting factor?  When folks say something can't be done and haven't tried that really fires me up.  So it's encouraging to see that you actually looked into it and gave it a shot - you would probably have some good insights into implementation.

In my case, hardware was one of the limiting factors, but not the only one. Designing the software/algorithms is not a piece of cake. I suppose that with your XMOS architecture we should have enough power to do it.
I have not seen any explanation on what the EHX pedals are doing in terms of algorithm, in fact in one of the linked forums, Bill says "If I talk about its workings Mike Matthews would have me in cement shoes at the bottom of the Atlantic!".   ;D  ;D. But from the EHX description, they seem to say they are not using any picth detection + synthesis, but rather manipulating somehow the guitar audio signal to get the right result. Whether this manipulation is done on the frequency or time domain is another story... This would explain the really low latency and the polyphonic characteristics.
What puzzles me is that they have been able to "copy" the sound characteristics of so many keyboard instruments (Hammond, piano, mellotron, etc...)

Implementing an organ similar to what can be achieved using a POG is doable. At the end it's just a combination of known algorithms. Using a phase vocoder you can create multiple pitch-shifted signals, that can be combined into a organish should. If you add some envelope manipulation to change the attack-decay and some modulation, you are in the ballpark.

But if you pretend to go further and recreate let's say a grand piano, or cello, ... it would require some more creativity.


slacker

Re: How hard would it be to make something like EHX's key9/b9/mel9 etc?
« Reply #19 on: February 27, 2017, 01:34:28 PM »
A brief googling of the ADSP-BF592 says that it's only about $10, so price itself doesn't seem crazy, unless it needs some sort of crazy programmer.

I haven't done much research but it looks like the development software is about $1000 for a single user license, and a programmer is about $150. I've got no idea if there's cheaper or free alternatives.