Author Topic: Arduino compatible guitar effects board  (Read 9217 times)

Blackaddr

Arduino compatible guitar effects board
« on: March 25, 2017, 08:54:06 AM »
Arduino is a very popular platform for novice programmers to get up and running with audio projects without worry about the hard part of dealing with configuring the peripherals on a microcontroller.

The Teensy boards are compatible with Arduino and offer much faster performance.  The most powerful board is the Teensy 3.6, it's 180 MHz with real hardware floating point support. This is actually powerful enough to experiment with decent effects, even frequency domain pitch shifting, etc.

The problem with the shields for these various arduino boards is they operate at line level, and usually from 3.3V.  As soon as you want to plug a guitar in, there is a host of issues.  Guitars need very high impedance inputs otherwise the pickups get loaded.  Typically 500K to 1M, but line level is usually 10K.  There is a big issue with signal levels.  Line line level is usually around 1vpp, but guitar signals can be as low as tens of millivolts for vintage low-output pickups, several volts for active pickups, and if you put a regular pedal in front of it, it could get up near 9vpp depending on the circuit design.

Finally, the boards always seem to have 3.5mm jacks, not 1/4" jacks.

Ultimately, the requirement for a digital effect for use with guitar is a 9V powered input buffer with high impedance, with appropriate circuitry to either boost the signal up to line-level, or attenuate the signal down to line level to ensure the ADC isn't damaged.

I've designed my own board to meet all these requirements featuing a WM8731 codec.

The technical discussions that went into the design can be found on the Teensy forum here:
https://forum.pjrc.com/threads/42678-Teeny-Guitar-Audio-Board
and the schematic is in post #46
https://forum.pjrc.com/threads/42678-Teeny-Guitar-Audio-Board?p=137884&viewfull=1#post137884

Here's some renderings of the board.  The gerbers left for the board shop today!


Find more Guitar DSP and modelling info at my website:
www.blackaddr.com
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

rotylee

Re: Arduino compatible guitar effects board
« Reply #1 on: March 26, 2017, 09:14:03 AM »
have you seen
http://www.axoloti.com/
based on the STM32F4
?


free electron

Re: Arduino compatible guitar effects board
« Reply #2 on: March 26, 2017, 11:28:13 AM »
Looking at the schematic... looks like the SPI memory chips are not getting power? (VSS/GND pins floating)

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #3 on: March 26, 2017, 04:13:04 PM »
@rotylee
I had not seen the Axoloti. Took a look at it, t's not for guitars. It's inputs are only +5V and not high impedance. You need a +9V capable high impedance preamp before a guitar can drive something that is meant for line-level.

It also appears to be custom software?  The nice thing about Arduino is we can all agree it isn't going anywhere for the forseeable future, so I made my addon board compatible with the Teensy.

@free electron
Good eye!  I'd better fix that. Thanks!

« Last Edit: March 26, 2017, 04:52:36 PM by Blackaddr »
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

Firesledge

Re: Arduino compatible guitar effects board
« Reply #4 on: March 27, 2017, 03:16:38 AM »
Great project! I’m following this closely, as I am also designing an audio interface.
Pédale Vite, multi-FX pedalboard

free electron

Re: Arduino compatible guitar effects board
« Reply #5 on: March 27, 2017, 03:27:45 AM »
I wouldn't leave the ~HOLD inputs floating either. Since you are not using the quad spi mode, it's perfectly fine to connect them directly to the VCC.

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #6 on: March 27, 2017, 09:42:06 AM »
I wouldn't leave the ~HOLD inputs floating either. Since you are not using the quad spi mode, it's perfectly fine to connect them directly to the VCC.

I could have swore there was a weak internal pull up that line but can't find any mention of it in the datasheet now. Bastards!
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

glennalday

Re: Arduino compatible guitar effects board
« Reply #7 on: May 22, 2017, 02:08:59 AM »
This is a nice project. The only problem is that teensy is hard to find on some places. I am planning on using the arduino Due but I really want it to be same form factor as nano.  :-[

orbitbot

Re: Arduino compatible guitar effects board
« Reply #8 on: May 22, 2017, 02:32:45 AM »
I ordered a Teensy directly from their website ( https://pjrc.com/ ), even with international shipping it ended up being cheaper than trying to find anything more local, exchange rate and all.

kat

  • member2
  • *
  • Posts: 21
  • Total likes: 3
  • Physicist, feminist, aspiring tone geek
Re: Arduino compatible guitar effects board
« Reply #9 on: May 25, 2017, 07:33:16 AM »

I had not seen the Axoloti. Took a look at it, t's not for guitars.


Whether you think of it as "for" guitars or not, the Axoloti works beautifully with a guitar... I'm currently having so much fun with mine that it threatens to destroy the rest of my life!  Once you get used to it, the visual patching interface with the Axoloti is quite a bonus and very powerful.

But I also just picked up a Teensy and I am quite interested in your project - thanks for sharing!

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #10 on: January 14, 2018, 10:56:42 AM »
Hey guys, just to give you an update in case some of you DIYers are interested in getting into playing with DSP audio effects.

This project did continue development and the audio shield turned out quite well, and I've got a few built units left.

The full schematic and pictures are available, click the "datasheet" link here for the schematic, its at the end of the document.

I also have an open source library I'm working to make using the board even easier here on github.

The Teensy audio library makes the coding part far easier than a lot of audio platforms because you don't deal directly with the audio data transfers, it's all done magically for you in the background.

All you have to do is connect virtual patch cables between effects (using AudioConnection) just like on a pedal board. The I2S input and output objects are usually the start and end of the chain to get audio in and out of the board. Everything else in between is the effects chain.

I've posted an example program in my library that the uses reverb, delay and a basic cabinet sim using classes already in the Teensy audio library here.

They're all open source so you can use them as a reference to start experimenting with building your own. Let me know what you guys think.
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

briandress

Re: Arduino compatible guitar effects board
« Reply #11 on: January 30, 2018, 01:48:45 PM »
so you could use this to process things like a shimmer reverb? or a convolution reverb?

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #12 on: January 30, 2018, 03:04:00 PM »
You can write any effect that fits within the process and memory capabilities of the Teensy. The makers of Arduino Teensy (PJRC) have already created an open-source effects library (including a basic reverb). If you want to create more complex reverbs you can use the Teensy as a platform to do so.

PJRC make an audio shield as well, but it it's not suitable (electrically) for guitar use. My board allows you to plug a guitar, guitar pedal, or line level source directly in. All the appropriate analog supplies and preamps are on-board. I also add optional off-chip SRAM because delay effects can easily consume a lot of microprocessor ram storing audio which is better done by off-chip storage and keep the on-chip RAM reserved for your program's computational needs.

The Teensy Audio Library is a great way to start looking at how effects like flanger, chorus, reverb, delay are done in digital processing are made. Most of them are fairly basic (they quite function) so it's easy to add your own controls and a parameters on top of something that already works.
« Last Edit: January 30, 2018, 03:09:11 PM by Blackaddr »
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #13 on: February 24, 2018, 08:30:17 AM »
New AudioEffect available for Arduino Teensy! The audio library that comes with Teensyduino has many effects already but for delay it only has a basic digital one. I wanted something that sounds more like an analog delay, with more features, like feedback, mix, etc.

I've just pushed a release to the open-source BAGuitar library. I've added a new effect called AudioEffectAnalogDelay. It models the various filter responses in the Boss DM-3 analog delay pedal. It is written entirely in C/C++  using the standard Arduino IDE.

It is based on research published in this paper:
http://www.cs.sfu.ca/~tamaras/cmpt889projects/tristan/references/RaffelSmith_DAFx10_P42.pdf

Here's a quick video showing off some delay settings. All audio processing is being done in real time using a Teensy and the audio shield described in this thread. The GUI you see on the right is simply a basic software application I'm using to control the Teensy over USB-MIDI.

I have also released this GUI as a free application that runs on the host and can control anything that shows up as a MIDI device.


You can download the free software (BAMidiTester) seen in the video here:
http://www.blackaddr.com/downloads/

To celebrate this milestone, the Teensy Guitar Audio Shield boards are on sale for 15% off for a limited time at Tindie:
https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

audioartillery

Re: Arduino compatible guitar effects board
« Reply #14 on: March 13, 2018, 04:36:36 PM »
Got my boards in yesterday and got one up and running very quickly.  Sounds great so far, just need to start porting one of my effects over to it.

Are there any examples of integrating pots/switches to control the effects?  I see the external GPIO headers so that's straightforward enough, but didn't see anything in any BlackAddr or Teensy Audio examples for that.

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #15 on: March 13, 2018, 05:25:33 PM »
For mechanical switches, most people use the Arduino 'Bounce' library to debounce switches. See https://www.pjrc.com/teensy/td_libs_Bounce.html

For pots, you can read them as long as they are on 'A' capable pins on the teensy. I.e. A1, A2. See https://www.pjrc.com/teensy/tutorial4.html and the Teensy pinout at https://www.pjrc.com/teensy/pinout.html

The TGA Pro has several GPIOs for switches. There are 3 possible pins for analog pots. One is GPIO header pin EXT5 (as A13) , the other two are solder pads TP1 and TP2 (A15 and A14).

I personally prefer use a dedicated MIDI controller to control my effects while I'm playing. This ensures any control limitations are based on the MIDI controller, rather than the pins on the Teensy. I just like to have my MIDI controller and audio processing as separate devices. This also gives you a great excuse to design your own MIDI controller!

When I'm developing and testing, I use the free app you see above in the video to just control the effects over USB MIDI from the BAMidiTester GUI application.

I use this MIDI controller when I play with my band, and when I'm controlling the TGA Pro without the computer running. It has MIDI 5 pin connectors on the back.


« Last Edit: March 13, 2018, 05:27:34 PM by Blackaddr »
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

orbitbot

Re: Arduino compatible guitar effects board
« Reply #16 on: March 13, 2018, 06:02:54 PM »
I also received my board at the end of last week, but I'm still waiting for the Teensy to arrive...  :'( In the meantime I managed to come up with a few questions;

I'm guessing the preamp gain switch (4) is only hardware-switchable, no software control?

Looking at the schematic at the end of the User Guide, are the unused pins (anything with --x , fe. pins 27-33) on the Teensy tied to ground or can they still be used? Or are only the exposed EXT-pins still available for I/O?

There was a note about the J9 jumper to be connected if the teensy is powered by external power instead of the USB, is it possible to power from either by hooking up something like the diode option on the teensy board? https://forum.pjrc.com/threads/42168-How-to-external-power-Teensy-3-6-and-switch-between-USB-power-and-external

Are there any traces at all around the FID1 fiducial marker, or would it be possible to make a cut up until the midi connector and about half way to the standoff to remove the corner bit?

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #17 on: March 13, 2018, 09:01:42 PM »
Great questions! Hopefully I can be of help.

I'm guessing the preamp gain switch (4) is only hardware-switchable, no software control?
The hardware switch provides 0db/+12db of gain, however there is also -34.5db to +12db of software controlled gain in the CODEC's preamp. You can control this with the setLeftInputGain(val) and setRightInputGain(val) functions on the BAAudioControlWM8731 class. Take a look at the BAAudioControlWM8731.h file here to see all the available CODEC controls functions. For example...
Code: [Select]
/// Set the input gain of the codec's PGA for the left (TRS Tip) channel.
/// @param val an interger value from 31 = +12dB . . 1.5dB steps down to 0 = -34.5dB
void setLeftInputGain(int val);

/// Set the input gain of the codec's PGA for the right (TRS Ring) channel.
/// @param val an interger value from 31 = +12dB . . 1.5dB steps down to 0 = -34.5dB
void setRightInputGain(int val);
[/quote]

Looking at the schematic at the end of the User Guide, are the unused pins (anything with --x , fe. pins 27-33) on the Teensy tied to ground or can they still be used? Or are only the exposed EXT-pins still available for I/O?
All the 'X' pins are 'no connects'. They are unused, hence floating, not grounded. You hint at a good point. There is nothing stopping you soldering to the Teensy socket pins and using them. They are not part of the GPIO convenience class, but you can still use them like any regular Arduino pin by using their pin number. For example, if you wanted to use the pin 24 labelled '37_SCL1_A18_PWM' as an analog input, you can reference the "logical" pin name, not the physical pin number.
Code: [Select]
pinMode(37, INPUT); // note the pin has logical name "37", not "29" which is the physical pin.
int value = analogRead(18); // note that logical pin 37 is analog input "A18"

There was a note about the J9 jumper to be connected if the teensy is powered by external power instead of the USB, is it possible to power from either by hooking up something like the diode option on the teensy board? https://forum.pjrc.com/threads/42168-How-to-external-power-Teensy-3-6-and-switch-between-USB-power-and-external
I've not tried the solution in that article so I cannot comment on it's effectiveness or safety. Most people who want external power cut a track on the Teensy board and supply power themself. On the TGA Pro, J9 is designed to be a jumper to avoid that when used with DB1, a bridge rectifier (not installed by default). The idea is you could install DB9, then install headers on J9 and use a jumper to connect the external power provided at J2. You then install the J9 jumper when USB cable is disconnected, and remove it when USB is connected. No need to cut traces. The bridge rectifier ensures you can't get the polarity wrong on the power at J2. No matter which way you hook it up, the bridge rectifer will put + and - on the right tracks.

Are there any traces at all around the FID1 fiducial marker, or would it be possible to make a cut up until the midi connector and about half way to the standoff to remove the corner bit?
There are no tracks under FID1, or the area between FID1 and the standoff. They are only under the MIDI connector in that region.

If you have anymore questions, post them here, and I'll do my best to help.
« Last Edit: March 13, 2018, 09:04:04 PM by Blackaddr »
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com

orbitbot

Re: Arduino compatible guitar effects board
« Reply #18 on: March 14, 2018, 04:53:40 PM »
Thanks for the swift replies! I'm not sure if I fully understood the following;

There was a note about the J9 jumper to be connected if the teensy is powered by external power instead of the USB, is it possible to power from either by hooking up something like the diode option on the teensy board? https://forum.pjrc.com/threads/42168-How-to-external-power-Teensy-3-6-and-switch-between-USB-power-and-external

I've not tried the solution in that article so I cannot comment on it's effectiveness or safety. Most people who want external power cut a track on the Teensy board and supply power themself. On the TGA Pro, J9 is designed to be a jumper to avoid that when used with DB1, a bridge rectifier (not installed by default). The idea is you could install DB9, then install headers on J9 and use a jumper to connect the external power provided at J2. You then install the J9 jumper when USB cable is disconnected, and remove it when USB is connected. No need to cut traces. The bridge rectifier ensures you can't get the polarity wrong on the power at J2. No matter which way you hook it up, the bridge rectifer will put + and - on the right tracks.


So to simplify a bit, do I need to care about powering the TGA Pro separately, or can I just assume that if I can power the Teensy board properly (externally or through the USB) the TGA will also get the current it requires?

Blackaddr

Re: Arduino compatible guitar effects board
« Reply #19 on: March 14, 2018, 05:23:22 PM »
So to simplify a bit, do I need to care about powering the TGA Pro separately, or can I just assume that if I can power the Teensy board properly (externally or through the USB) the TGA will also get the current it requires?

That is correct. As long as the USB cable is attached, both boards will have all the power they need. When you're ready for an externally powered solution (say inside an enclosure), there are several options available to you.

So...just to summarize...
Normally the Teensy gets power +5V from the USB. It will then use this to generate +3.3V for the processor. It then provides both the +5V (VIN) and the +3.3V (VDD) on it's pins.

The TGA directly uses the +3.3V VDD for the digital circuits, and it uses the +5V with several regulators to create clean, low-noise +3.3V and +9V voltages need for the analog bits of the codec, and the guitar preamp.

If in the future, you want to mount the boards in a pedal enclosure and use it without a USB cable connected, that's where you have some options. There are ways to do external power to the Teensy board and have it feed the TGA, or you can have the TGA pro powered externally, and feed the Teensy.

For now, I suggest just focus on having fun, play around with all the cool USB features the Teensy offers (USB audio, USB MIDI and USB serial!) and when you're ready to install in an enclosure, help is available, both from me and the Teensy community.
« Last Edit: March 14, 2018, 05:25:49 PM by Blackaddr »
Blackaddr Audio
Digital Modelling Enthusiast
www.blackaddr.com