DIYstompboxes.com

DIY Stompboxes => Digital & DSP => Topic started by: Blackaddr on March 25, 2017, 08:54:06 AM

Title: Arduino compatible guitar effects board
Post by: Blackaddr 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 (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 (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!
(https://forum.pjrc.com/attachment.php?attachmentid=10107&d=1490319703)(https://forum.pjrc.com/attachment.php?attachmentid=10108&d=1490319704)(https://forum.pjrc.com/attachment.php?attachmentid=10109&d=1490319706)

Find more Guitar DSP and modelling info at my website:
www.blackaddr.com (http://www.blackaddr.com)
Title: Re: Arduino compatible guitar effects board
Post by: rotylee on March 26, 2017, 09:14:03 AM
have you seen
http://www.axoloti.com/
based on the STM32F4
?

Title: Re: Arduino compatible guitar effects board
Post by: free electron 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)
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr 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!

Title: Re: Arduino compatible guitar effects board
Post by: Firesledge on March 27, 2017, 03:16:38 AM
Great project! I'm following this closely, as I am also designing an audio interface.
Title: Re: Arduino compatible guitar effects board
Post by: free electron 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.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 27, 2017, 09:42:06 AM
Quote from: free electron 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.

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!
Title: Re: Arduino compatible guitar effects board
Post by: glennalday 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.  :-[
Title: Re: Arduino compatible guitar effects board
Post by: orbitbot 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.
Title: Re: Arduino compatible guitar effects board
Post by: kat on May 25, 2017, 07:33:16 AM
Quote from: Blackaddr on March 26, 2017, 04:13:04 PM

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!
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr 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 (https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/) 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 (https://github.com/Blackaddr/BAGuitar).

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 (https://github.com/Blackaddr/BAGuitar/blob/master/examples/BA4_TGA_Pro_delay_reverb/BA4_TGA_Pro_delay_reverb.ino).

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.
Title: Re: Arduino compatible guitar effects board
Post by: briandress on January 30, 2018, 01:48:45 PM
so you could use this to process things like a shimmer reverb? or a convolution reverb?
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr 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.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr 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 (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/ (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/ (https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/)
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery 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.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr 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 (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 (https://www.pjrc.com/teensy/tutorial4.html) and the Teensy pinout at https://www.pjrc.com/teensy/pinout.html (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.
(http://blackaddr.com/wp/wp-content/uploads/2016/12/microMIDI-768x507.jpg)

Title: Re: Arduino compatible guitar effects board
Post by: orbitbot 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?
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 13, 2018, 09:01:42 PM
Great questions! Hopefully I can be of help.

Quote from: orbitbot on March 13, 2018, 06:02:54 PM
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 (https://github.com/Blackaddr/BAGuitar/blob/master/src/BAAudioControlWM8731.h) to see all the available CODEC controls functions. For example...
/// 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]

Quote from: orbitbot on March 13, 2018, 06:02:54 PM
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.
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"


Quote from: orbitbot on March 13, 2018, 06:02:54 PM
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.

Quote from: orbitbot on March 13, 2018, 06:02:54 PM
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.
Title: Re: Arduino compatible guitar effects board
Post by: orbitbot on March 14, 2018, 04:53:40 PM
Thanks for the swift replies! I'm not sure if I fully understood the following;

Quote from: Blackaddr on March 13, 2018, 09:01:42 PM
Quote from: orbitbot on March 13, 2018, 06:02:54 PM
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?
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 14, 2018, 05:23:22 PM
Quote from: orbitbot on March 14, 2018, 04:53:40 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.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on March 16, 2018, 01:25:23 AM
Hey, I noticed on the second board I have that one of the jacks had no solder on half of its pins. I don't have the other board handy so can't comment on it.

No big deal, I can touch that up, but thought you'd want to know.

(http://imgur.com/G0IDJV1m.jpg)
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 16, 2018, 08:45:41 AM
Quote from: audioartillery on March 16, 2018, 01:25:23 AM
Hey, I noticed on the second board I have that one of the jacks had no solder on half of its pins. I don't have the other board handy so can't comment on it.
No big deal, I can touch that up, but thought you'd want to know.

Very sorry about that. Every board goes through electrical/functional testing and a visual inspection. Most assembly issues are caught during functional test, but clearly I missed some pins during visual check.

It sounds like you're pretty confident with an iron so touching those up with some solder should ensure everything is good. If for any reason you don't feel comfortable with that, I can solder it for you, with shipping entirely at my expense.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on March 16, 2018, 11:21:04 PM
Hey, so I wanted to try out this BAMidiTest program.  Are there any instructions for that?  I saw there's an Xcode project included, but it won't compile (needs some Juce library headers).  I added the JUCE/modules path to the Xcode project and was able to compile but it hits an assert in MidiMessage::controllerEvent shortly after startup.  I don't know anything about JUCE so I'm lost at this point.

I thought maybe I  could open up the BAMidiTester.jucer file from Projucer and have it build but it complains I need to set some module path.  Is there a way to get that to work?
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 16, 2018, 11:57:37 PM
You can download the Windows version of the program here:
http://www.blackaddr.com/downloads/ (http://www.blackaddr.com/downloads/)

To compile the project yourself, you'll need to install the JUCE SDK. If possible, use the precompiled Windows version above. It also works under Linux on WINE. I don't have a Mac so I can't advise on how to run a Windows program on Mac.

Once you get BAMidiTester loaded, in the Arudino IDE, set your Teensy port to "Serial + MIDI" when connected via USB.  Then load the BAMidiTester. The Teensy should show up as a MIDI device in the program.

If you build and load the AnalogDelayDemo on your Teensy board, you'll be able to control the effect parameters with the knobs in the BAMidiTester program. You should see the effect of changing the knobs as MIDI messages in the Arduino's IDE Serial Monitor if everything is working.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on March 17, 2018, 12:52:25 AM
Ok, so spent a little more time on this. 

The Windows exe runs under Wine on OSX.  It's unhappy about a font so none of the text renders.  Changing the knobs didn't seem to have any effect on the serial output.

I looked a little harder at the assert on the native OSX build and the deal is MidiMessage(MidiMessage::controllerEvent() requires the channel number to be between 1 and 16.  Your test code is trying to operate on channel 0 which is invalid.  Maybe an older version of Juce allowed 0?

In any case, while I can now run the test program and see the BlackAddr input and output, knobs don't seem to have any effect.  I tried changing the part in the delay demo that shifts the midi channels from 1-16 to 0-15 but that did not seem to have an effect.

I know literally nothing about midi so not sure how to debug this.  But if we an sort it out I'm happy to provide an OSX binary if you want to have it available for download.

Edit:  got it to work!  The issue was with the example code actually.  Here's the fix:

diff --git a/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino b/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino
index 3cb413a..6f674f2 100644
--- a/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino
+++ b/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino
@@ -131,7 +131,7 @@ void loop() {
       channel = usbMIDI.getChannel(); // which MIDI channel, 1-16
       data1 = usbMIDI.getData1();     // first data byte of message, 0-127
       data2 = usbMIDI.getData2();     // second data byte of message, 0-127
-    if (type == 3) {
+    if (type == 0xb0) {
       // if type is 3, it's a CC MIDI Message
       // Note: the Arduino MIDI library encodes channels as 1-16 instead
       // of 0 to 15 as it should, so we must subtract one.


I don't really understand why 3 would ever be a CC message, CC is type 0xb0 according to the MIDI documentation I found.  Typo?  Nice to have this working though.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 17, 2018, 12:16:00 PM
Glad you got it working! Looks like the latest version of the MIDI library in Teensyduino has redefined what getType() returns. It was originally enums, then it was integers equal to the enums, now it's back to enums matching the real bytes sent (which is good!)

I'll update my Teensyduino and then update the example.

I've also updated the BAMidiTester application. You can download it here:
http://www.blackaddr.com/downloads/BAMidiTester/ (http://www.blackaddr.com/downloads/BAMidiTester/)

I've added a box next to the "SAVE" button where you can specify which midi channel you want. You were correct that JUCE expects MIDI channel to be 1-16 in the code. My version of JUCE seems to accept 0, but that must have changed. I've updated the code to use the channel specified in the GUI by the user.

<rant>
MIDI channels are really 0-15, because that's what's sent in a MidiMessage. It's a 4-bit value, it's impossible to send '16'. But many humans (musicians?) seem to struggle with the concept of counting from zero, so many MIDI products call the channels 1-16, and map it back to 0-15 as I do in the Teensy example code.
</rant>

I've got some avenues to investigate where I may be able to compile for MacOS via virtual machine. If that works I'll put out an Apple version. Failing that, I'll try to get the fonts working under MacOS/WINE.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 17, 2018, 11:17:35 PM
@audioartillery
I managed to build and test a Mac OS version by using virtual machine. I've added the application to the following location. If you don't mind, let me know if it works, correct fonts, etc.
http://www.blackaddr.com/downloads/BAMidiTester/BAMidiTester_macOS_v1.1.0.zip (http://www.blackaddr.com/downloads/BAMidiTester/BAMidiTester_macOS_v1.1.0.zip)
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on March 21, 2018, 11:10:29 PM
Quote from: Blackaddr on March 17, 2018, 11:17:35 PM
@audioartillery
I managed to build and test a Mac OS version by using virtual machine. I've added the application to the following location. If you don't mind, let me know if it works, correct fonts, etc.
http://www.blackaddr.com/downloads/BAMidiTester/BAMidiTester_macOS_v1.1.0.zip (http://www.blackaddr.com/downloads/BAMidiTester/BAMidiTester_macOS_v1.1.0.zip)

It runs and talks to the delay demo.  For some reason I don't see the analogDelay print value changing from 15%.  I don't remember if it did before, but I see messaging from the effect saying values are changing and the effect is bypassed and enabled etc.  Seems fine.

I have a local hack on the test app to add a couple more knobs and remove the piano keyboard.  It might be convenient to provide the MIDI test in such a configuration -- when you're early in development on an effect a lot of controls can be handy.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 22, 2018, 08:31:26 AM
The percentage should drop to nearly 2% or so (on a T3.6) when you bypass the effect via knob A.

I wrote the BAMidiTester as a very general purpose tool I use for a lot of MIDI projects around the house, as well as to provide something that someone else can use as a starting point to customize and add upon.

Sounds like that's exactly what you've done! Congrats, getting your head around JUCE is not the easiest thing to do, I find it a bit obtuse. Personally Qt/QML is the best language for GUI design IMHO, but JUCE is built from the ground up for audio/midi processing, and it's integration with VST can't be beat.

I've also just added to BAGuitar the ability to program your own filters for AnalogDelay and added a few pre-defined ones to give, bright, warm, and dark tones. You can see a summary in this post here (https://forum.pjrc.com/threads/49977-New-audio-effect-AudioEffectAnalogDelay?p=172486&viewfull=1#post172486).

My longer term plans for this year are to continue adding MIDI controlled effects to the library, then created a virtual pedalboard application with JUCE built solely for working with the TGA Pro.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on March 23, 2018, 11:49:46 PM
Hey, the AnalogDelayDemo example project has a name.c file with a MIDI name defined there and instructions to change it if we want our own name to show up.  I've copied that project and modified that but it doesn't appear that file has any effect.  Is there something else I need to do to get that to work?
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on March 24, 2018, 09:03:01 AM
That has to do with the Teensy midi library. I just used one of their demo examples in mine, haven't tried changing the name. I away on a business trip and can't check the Arduino IDE but I think you find the midi name demo in Teensy usb midi examples. Try changing the name in that one. If it doesn't work, if you haven't yet created an account on the PJRC forums, now is a great time. For advanced Teensy library stuff, the community there is pretty helpful.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on March 24, 2018, 11:15:28 AM
Quote from: Blackaddr on March 24, 2018, 09:03:01 AM
That has to do with the Teensy midi library. I just used one of their demo examples in mine, haven't tried changing the name. I away on a business trip and can't check the Arduino IDE but I think you find the midi name demo in Teensy usb midi examples. Try changing the name in that one. If it doesn't work, if you haven't yet created an account on the PJRC forums, now is a great time. For advanced Teensy library stuff, the community there is pretty helpful.

It turns out changing the stuff in name.c works, but OSX caches the name so you have to do a little dance with the MIDI configuration on OSX to forget that device.  Doing that works and my name shows up.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on April 05, 2018, 08:00:40 PM
audioartillery asked me about mounting the board in an enclosure.

The board purposefully comes with 1/4" jacks that have a nut on the end. This will let you mount the board securely to the enclosure using the three 1/4" jacks. No need for standoffs or other mounting. To drill the 3 holes, use an offset of 20.5mm between their centres. I recommend centre punching your enclosure first, drill a pilot hole with something like a 1/8" drill bit, then finish the hole with a 3/8" drill bit.

Here's some bad ASCII art to illustrate, where the X's are your centre marks. I suggest you sanity check the 20.5 mm offset with a ruler against your board to convince yourself the offset is correct before you start drilling. Also check your 3/8" bit against the size of the thread nut to convince yourself again you've got the right bit.
X - - - - - 20.5mm - - - - - X - - - - - 20.5mm - - - - -X

To connect MIDI jacks, rather than try to drill aligning holes I recommend using your preferred chasis mount MIDI DIN jack, then fly wire them to the MIDI connectors on the board, matching up pin-to pin with the pre-installed connectors. Note that for MIDI OUT, you only need 3 wires, connecting pins 2 (GND), 4 and 5. For MIDI IN, you only need to connect pins 4 and 5 (no GND because MIDI is optically isolated).

I'll draw up a diagram when I get a chance and add to the online manual.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on April 05, 2018, 08:09:48 PM
Thanks.  I had measured 0.800" centers which is nearly 20.5mm.  I'll correct my design with the exact measurement.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on June 01, 2018, 07:57:14 AM
I've added a mechanical drawing to the end of the datasheet (https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/). It now shows the PCB dimensions, as well as provides a drilling guide for mounting holes for the TRS jacks. This should help anyone making enclosures.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on June 11, 2018, 05:58:42 PM
Cool, that's helpful.  I ended up building a primitive 3d model for my use since pedal enclosures tend to be tight by nature and the vertical clearances on the board matter a lot.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on September 23, 2018, 12:02:03 PM
I've been out of stock for the past 3 months but finally the new hardware revision Model B is available.

Biggest changes based on feedback was to mount the Teensy on the same side as the connectors (not an easy task!) in order to reduce the minimum height.

Also, people wanted an easier way to prototype with some basic controls (knobs, switches, LEDs) so an expansion board with all these controls is also available that plugs directly into the TGA pro board itself, no extra soldering required.

Finally, the board can be ordered without the MIDI connectors installed if you are trying to install in a small enclosure and don't need MIDI.

The new model is available on Tindie here (https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/)

(http://blackaddr.com/wp/wp-content/uploads/2018/09/TGA_PRO_revb.jpg)(https://cdn.tindiemedia.com/images/resize/sQTSb0OC8dJJ2lM_0KB1Mu8wnzQ=/p/fit-in/653x435/filters:fill(fff)/i/55776/products/2018-09-09T13%3A17%3A05.071Z-TGA_PRO_Expansion_Board.jpg)
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on September 24, 2018, 12:29:02 AM
Nice! Looks a lot more enclosure friendly. Though I'm loving the giant enclosure I built for mine.

Any thoughts on making a board that eliminates the Teensy? At scale these could be cheap enough for small volume pedal production but the Teensy is expensive.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on October 06, 2018, 08:31:05 AM
@audioartillery some people love tiny enclosures so they fit on an overstuffed pedal board, I get that. I used to follow that mentality until I got fed up with trying to tap-dance on the board with the tip of my shoe while changing effects. It's SOOO much easier when stomp switches are well spaced apart on big multi-effect pedals. You can confidently change effects without looking down and worrying about accidentially hitting two switches at once, etc.

I think the big thing here was to reduce the height so that the board can still be used in enclosures that are only a little over 1" in height.

As for integrating the Teensy directly, that would significantly increase my assembly costs because of the BGA and probably make it too expensive to build in low volumes. Even if you buy the micro yourself, you still need to buy the TEENSY bootloader chip to make it work with the Teensy ecosystem. I may offer a configuration in the future where there are NO connectors pre-installed. This would allow you to solder the Teensy right to the board and wire everything else to jacks. This would make custom enclosures even easier to design. The difficulty for me is I need to test the boards, which is much harder to do with no connectors.

Regarding enclosures and physical controls, to further make it easier to customize the physical controls for your project, I've added some code to the BALibrary. I'll put the details in a post below.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on October 06, 2018, 08:34:23 AM
BAPhysicalControls was written for incorporating pots, rotary encoders, switches and outputs (LEDs/relays) into your Teensy project.

By having controls managed by a class object, it allows code that needs to interact with the controls do so with that single object, rather than using globals or functions with lots of paramters. Switches usually work best with momentary (rather than latching switches) because they are more flexible. A latching switch can be emulated in software from a momentary hardware switch but the reverse is not true.

The class also uses some wrappers around each type to add a little more functionality. Typical use is create an instance of the PhysicalControls, then add() controls to it by registering them to a handle. Use the handle to query the inputs or control the outputs.
// Examples
BAPhysicalControls controls(NUM_SWITCHES, NUM_POTS, NUM_ENCODERS, NUM_LEDS); // This will create the object with enough memory for all the controls you will be adding. Use zero for unused control types.

// Register the controls. For example, 2 switches, 1 pot, 1 encoder, 1 output LEDs
unsigned sw1Handle = controls.addSwitch(SW1_PIN); // SW1_PIN here is the logical pin on the Teensy
unsigned sw2Handle = controls.addSwitch(SW2_PIN);

// Pots require the pin as well as the min and max calibration values. swapDirection depends on pot orientation. E.g. make sure clockwise means increase, not decrease.
// Calibration ensures the range goes all the way from 0.0 to 1.0.
unsigned pot1Handle = controls.addPot(POT1_PIN, min, max, swapDirection); // The logical analog pin number on the Teensy. E.g. A16, A17,etc.
unsigned encoderHandle = controls.addEncoder(PIN_A, PIN_B, swapDirection); // The encoder needs two input pins.
unsigned outputLed = controls.addOutput(LED_PIN);

// Check for switch toggling (pressed and released) or held down (pressed).
// Outputs can be set with setOutput(value) or simply toggled. In this example, turn the LED on whenever the switch is pressed (held down)
if (controls.isSwitchHeld(sw1Handle)) { controls.setOutput(outputLed, 1); }
else { controls.setOutput(outputLed, 0); }

if (controls.isSwitchToggled(sw2Handle)) { // returns true if switch has been pressed and released since last check }

// Pots will return true if changed, and put the new value in the provided float.
float potValue;
if (controls.checkPotValue(pot1Handle, potValue)) { //returns true if new reading is available. potValue is passed by reference so it will be overwritten with the new value }

// Rotary encoders will provide the net change in position since the last call. E.g. -5 means 5 points counterclockwise, +3 is 3 units clockwise, etc. 0 means no change.
if ( controls.getRotaryAdjustUnit(encoderHandle) != 0) { // rotary encoder has moved }




You can find the code in the BALibrary here https://github.com/Blackaddr/BALibrary (https://github.com/Blackaddr/BALibrary)

The code was written to make it super easy to work with Expansion Control Board for the TGA Pro audio shield (https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/). It has controls for 2 switches, 3 pots and 2 LEDs. An example of controlling my Analog Delay effect with this class can be found here (https://github.com/Blackaddr/BALibrary/blob/master/examples/Delay/AnalogDelayDemoExpansion/AnalogDelayDemoExpansion.ino).
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on October 06, 2018, 10:21:54 PM
Awesome, I'll check out the control library. Maybe it can replace what I've written so far.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on August 07, 2019, 01:03:54 PM
Hey, I just noticed the new Teensy 4.0 boards (https://www.pjrc.com/store/teensy40.html) are out.  Will these drop into the TGA and just work?  I'm doing ok with the 3.6 but the 4.0 is a considerable performance improvement.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on August 07, 2019, 04:38:48 PM
Quote from: audioartillery on August 07, 2019, 01:03:54 PM
Hey, I just noticed the new Teensy 4.0 boards (https://www.pjrc.com/store/teensy40.html) are out.  Will these drop into the TGA and just work?  I'm doing ok with the 3.6 but the 4.0 is a considerable performance improvement.

According to the PJRC website the 4.0 is mostly pin compatible with the features of the 3.2, so in theory yes it should work. However, when you look at the PJRC pinout diagrams for the 3.2 vs 4.0 I don't see a lot of the same functionality on the same pins.

That said, based purely on the Teensy 4.0 pinout diagram it appears the Teensy 4.0 is incompatable with the PJRC audio board which I doubt is the case so I'm optimistic! I've already ordered a Teensy 4.0 for myself and will test with the TGA Pro once it arrives to see if there is any compatibility issues.
Title: Re: Arduino compatible guitar effects board
Post by: Blackaddr on August 09, 2019, 07:59:28 AM
Now that more details about the PJRC Teensy 4.0 is out, its confirmed it does not have pin compatibility with the I2S (audio) or SPI busses. The PJRC audio board is also not compatible with the Teensy 4.0. I will be making a small adapter board to covert the TGA Pro socket to accept a Teensy 4.0 and make that available since it's just pin assignment that has changed. Otherwise it's compatible.
Title: Re: Arduino compatible guitar effects board
Post by: audioartillery on August 11, 2019, 08:37:34 PM
Quote from: Blackaddr on August 09, 2019, 07:59:28 AM
Now that more details about the PJRC Teensy 4.0 is out, its confirmed it does not have pin compatibility with the I2S (audio) or SPI busses. The PJRC audio board is also not compatible with the Teensy 4.0. I will be making a small adapter board to covert the TGA Pro socket to accept a Teensy 4.0 and make that available since it's just pin assignment that has changed. Otherwise it's compatible.

Awesome, I know a couple people plus myself that are hoping to upgrade to a 4.0.