Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 31

Thread: MIDI Synth Shield for the Teensy

  1. #1
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236

    MIDI Synth Shield for the Teensy

    I've built a Teensy-sized hardware synth (a shield) with built-in polyphony (dozens of voices), and pre-made instruments for the standard general MIDI set plus a drum kit.
    I need it for my purposes to extend my Teensy-based midi controller. I am wondering if others need such a device, and/or would contribute to its design.
    The third revision is ordered at OshPark now.

    Basic features:
    - Polyphonic MIDI synth (dozens of simultaneous voices)
    - General-MIDI instrument coverage (GM1) plus one bank of GM2 percussion
    - Teensy form factor
    - Serial MIDI and SPI control through standard Teensy pins
    - Earphone jack output - Possibly a separate output back to the Teensy for subsequent processing?

    Paul, let me know if this conversation belongs elsewhere, or if you'd like to talk it through.

    Others let me know if you'd like to contribute/test.

    @OneHorse, I'd welcome a conversation since you've done add-ons on Tindy.

    Thanks, all!

    Dave
    Last edited by Davidelvig; 07-30-2017 at 11:36 PM.

  2. #2
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    Bringing this to the top once more. Any other interest in assisting in testing a MIDI synth board?

  3. #3
    Member
    Join Date
    Jan 2017
    Location
    Pella, Iowa, USA
    Posts
    85
    Quote Originally Posted by Davidelvig View Post
    Bringing this to the top once more. Any other interest in assisting in testing a MIDI synth board?
    You know that I am!!

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,323
    Quote Originally Posted by Davidelvig View Post
    Paul .... or if you'd like to talk it through.
    I'm probably not going to get directly involved. Far too much other stuff to do. But I am here and watching. I'm mostly keeping an eye out for any technical issues you might run into with the audio lib or other lower-level support code.

  5. #5
    Member
    Join Date
    Nov 2012
    Location
    Olympia, WA
    Posts
    52
    David-

    I'd be interested to know more about it. Are the general MIDI instruments from a chip like the VS1053 or SAM2195? Do you have any details on the synthesis engine? I'm all in favor of "dozens of voices"!

  6. #6
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    The current design is the VS1053.

    I was not aware on those chips from Dream (like the sam2195)

    I'd welcome a chat. Ill send you a message.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,323
    Maybe some or all of this could be done in software?

    https://github.com/TeensyAudio/Wavetable-Synthesis

  8. #8
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    Is this a potential Audio Lib addition?
    Am I getting this right that, I could:
    - convert a soundFont into a C++ wave table , and
    - use that wave table in a wave table synth object?

  9. #9
    Junior Member
    Join Date
    Feb 2016
    Posts
    10
    Not seeing this on OSHPark anywhere. Linky?

  10. #10
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    I've not posted the designs publicly.

  11. #11
    Junior Member
    Join Date
    Feb 2016
    Posts
    10
    Ah silly me. I've always toyed with doing a synthy type PCB with touch keyboard and some encoders. I was planning on sticking a teensy + audio card on it but I'll watch this with interest.

  12. #12
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    Boards are in, and the first one assembled works well as I use it.
    I'll be writing a library to make demonstration easy.
    You'll need a Teensy 3.2 or higher, and a pair of earbuds if you'd like to test.

    I'll have 4-5 to share for testing.

    Stay tuned.

  13. #13
    Member
    Join Date
    Jan 2017
    Location
    Pella, Iowa, USA
    Posts
    85
    Quote Originally Posted by Davidelvig View Post
    Boards are in, and the first one assembled works well as I use it.
    I'll be writing a library to make demonstration easy.
    You'll need a Teensy 3.2 or higher, and a pair of earbuds if you'd like to test.

    I'll have 4-5 to share for testing.

    Stay tuned.
    If I'm lucky enough to get one, first thing I'm going to do is whistle the "The Bridge on the River Kwai" song into it and have it whistle it back, MIDI style!

  14. #14
    Junior Member
    Join Date
    Mar 2017
    Posts
    19
    Will this board have a standard 5 DIN midi input?

  15. #15
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    It does not now. The input is from Teensy Serial1, and optionally SPI.
    DIN input could be added. The DIN connector would add more height, but not many new parts.
    What's the use you're anticipating?

  16. #16
    Junior Member
    Join Date
    Mar 2017
    Posts
    19
    Quote Originally Posted by Davidelvig View Post
    It does not now. The input is from Teensy Serial1, and optionally SPI.
    DIN input could be added. The DIN connector would add more height, but not many new parts.
    What's the use you're anticipating?
    I was thinking it would fit nicely with the project I'm planning, which is to put an embedded poly synthesizer (Teensy based) inside the body of an electric guitar so I don't need to connect to a PC/Mac for using guitar-to-MIDI tech. Although, a DIN input wouldn't be necessary for what I'm trying to do, just thought I might want to use it.

    I'm sort of vacillating between:

    1) using a standard hexaphonic guitar pickup with a USB MIDI receiver (Fishman TriplePlay) and getting a USB Host board (ordered with MIDI device installation) to communicate with a Teensy synth
    -- OR --
    2) converting 6 analog signals from a hexaphonic passive guitar pickup (Ubertar pickup) into digital signals in which I can perform FFT on and output as MIDI -- but this seems like it might be a bit out of my league. I've created a thread sort of detailing my thoughts on the second option.

    With the 1st option, I'm pretty sure I can just use serial com from the USB Host board in order to communicate with a Teensy setup from your project. The second option, I probably would be designing my own solution entirely.

    Although, I want to make sure the controls are decent (waveform selection, FM, etc) and that I could power it via batteries or rechargeable lipo, because that's what I'd want. I don't want it to be a floor pedal, it has to go inside the guitar.
    Last edited by graydetroit; 09-25-2017 at 05:31 AM. Reason: Words

  17. #17
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    Right, so you want to derive MIDI notes from each (analog) guitar string.
    I'm getting midi notes from one analog mic connected to the Teensy... getting pitch using fft1024 and picking the right midi note.
    The Teensy has 2 ADCs, I think. Seems like you'd need 6 ADCs!

    Back to my midi board, it can take in a polyphonic midi stream and synthesize any of the General MIDI instruments (plus 40+ drum sounds) through an onboard earphone jack.

    It seems that the 6-vibrating strings --> 6 frequencies is the main challenge.
    Are you open to using three Teensy 3.2s?
    Maybe the 3.6 has more ADCs than I know.

    There's lots of fun stuff after that in getting pitch bend and amplitude.
    Cool stuff, and with enough horsepower, it seems doable.

  18. #18
    Junior Member
    Join Date
    Mar 2017
    Posts
    19
    I was thinking that I could go with two of the ADS1015 boards for 8 ADC channels total, I would just need 2 I2C connections which I think the Teensy 3.6 can handle. The ADS1015 also has a programmable gain amplifier on it as well, I assume I'd need to amplify the pickup signals. The ADS1015 is 12-bit resolution and 3300 sampling rate. But I'm not sure if a Teensy 3.2 can handle all of that.
    Last edited by graydetroit; 10-02-2017 at 03:24 AM.

  19. #19
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    I've created and attached a graphic that shows how I am seeing the world around the MIDI synth board, and its context within my larger project..
    Click image for larger version. 

Name:	Analog-MIDI-Synth.jpg 
Views:	126 
Size:	86.8 KB 
ID:	11619.

    The "Dave's MIDI Synth Board" at the moment allows serial input (from a pin aligned with Teensy Serial1) and/or from a MIDI Type 0 file (e.g. from the uSD card on the Teensy 3.6. The output is to an on-board earphone jack. It is polyphonic, as long as the multiple notes come along a single MIDI stream. (MIDI Type 1&2 files are better suited to Multi-stream MIDI, and I don't support those now. Type 1 can be converted to Type 0).

    By the way, I'm doing nothing at present with the Filter/Morph/Augment in my project. Many Teensy guitar projects seem to create value there - making a digital version of an analog effects box.

    Your guitar project may need to invent (or find) all of the parts to the left of the MIDI Synth Board in the graphic. Teensy can fill most roles, except maybe 6 ADC's at once. Maybe 6 I2S's at once will be a problem for one Teensy as well. I have no experience there.

    So, a 6-note guitar chord could be sent to "Dave's MIDI Synth Board" as a stream of 6 MIDI NoteOn messages (taking about 5-6 milliseconds at MIDI speed), followed by a stream of MIDI Expression Controller messages (as the notes decay, say, every 5 milliseconds), and finally a stream of 6 NoteOff messages. You'll have a set of choices with MIDI about whether the 6 strings combine into one "MIDI Channel", and share one "volume" and one pitch bend, etc...... or are each on their own channel, with separate controls

    Fun stuff.

  20. #20
    Junior Member
    Join Date
    Mar 2017
    Posts
    19
    Looks great!

    Just a side note to re-iterate: I think 2 of these multichannel ADC boards (please see linked multi-channel ADC board from Adafruit) would provide the 6 digitized signals for processing, so I don't need 6 ADCs or 6 I2Cs. I just need the two multi-channel ADCs that provide at least 6 channels. All I'd need on the Teensy is 4 I2C pins (an SDA 0, SCL 0 and an SDA 1, SCL 1), so two concurrent I2C connections. Looks like the Teensy 3.2 supports this, but I'm not sure about how well the Teensy 3.2 would handle processing 6 channels (memory limit?). So that's why I think for my project it would be safer to go with Teensy 3.6.

  21. #21
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    Got it.

    You may need 6 AudioAnalyzeFFT1024 objects running simultaneously (I've used only 1 at a time), and those will use RAM and CPU.
    With only one FFT1024 running on a Teensy 3.2, you'll get a new freq every 12 milliseconds or so... most of which is waiting for 1024 samples (actually, Teensy is clever in reusing the newer half of a 1024 sample bucket as the older-half of the next sample bucket... otherwise, you'd wait 22+ milliseconds for each freq).

    You could simulate this now by having one audio input go to 6 AudioAnalyzeFFT1024 objects (using the GUI Audio Library tool)
    They should return identical results? and use the CPU and RAM and time as they will.

    If you can off-load the 6-times ADC work to another chip, and get it into the right Audio Library object for feeding into the FFT1024... that could just work.

  22. #22
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    A question, @graydetroit,
    The ADC chip you noted delivers I2C outputs.
    The Audio Library has the very different I2S inputs... and only through the Audio Shield, I think.
    Did you have a way to get the I2C into an Audio Library input!

    How about the TDM input mentioned here?
    https://www.pjrc.com/teensy/gui/?info=AudioInputTDM
    Last edited by Davidelvig; 09-28-2017 at 04:17 AM.

  23. #23
    Junior Member
    Join Date
    Mar 2017
    Posts
    19
    @Davidelvig - I am not planning on using the ADCs through the Audio Shield, but rather through the Teensy's I2C pins. I'm pretty sure the Audio Library will work without the Audio Shield, and the input from the ADCs will only be used for pitch detection, not for reproducing the signals via the Audio Shield ouput / headphone jack.

  24. #24
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    236
    OK. I just have never seen I2C into the Audio library.

  25. #25
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,323
    Quote Originally Posted by Davidelvig View Post
    Boards are in, and the first one assembled works well as I use it.
    I'll be writing a library to make demonstration easy.
    You'll need a Teensy 3.2 or higher, and a pair of earbuds if you'd like to test.

    I'll have 4-5 to share for testing.

    Stay tuned.
    Please ping me if you're selling these on a site like Tindie, or sharing the board on OSH Park. Would love to add it to the list on products page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •