# MIDI Triggered Audio Player (to line out)

**URL:** <https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618>\
**Category:** Finding Parts\
**Created:** [30 September 2021 02:55 UTC](https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618 "2021-09-30T02:55:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig179402](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Craig179402](https://forum.core-electronics.com.au/u/Craig179402)\
**Post date:** [30 September 2021 02:55 UTC](https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618/1 "2021-09-30T02:55:32Z")

</div>

Hi Forum!

My goal is to build a small audio player for a guitar pedal board where a particular file on an SD card can be triggered when one or more MIDI message are received.

Ecosystem:

- Morningstar MC-6 MkII midi controller
- SingularSound BeatBuddy
- SingularSound Aeros Loop Station
- Fractal Audio FM-3

There are other items, but that’ll do for background!

So the MC-6 can send a midi message to devices in the MIDI chain to set up to for the song (patches etc), begin playing, pause playing, transition to song parts etc.

The BeatBuddy has an auxiliary in 3.5mm stereo jack that can mix with the BB generated audio and pass to a PA etc.

The device I build can be either USB or 9V DC powered from the pedalboard power supply (which puts out centre negative, but can be swapped).

From the research I have done so far, products like the SparkFun MP3 seem to be limited by the number of pins that are available to select a track. I envisage having lots of tracks (for example, up to 6 tracks per song, played in any given sequence depending on which part is selected on the BeatBuddy).

Major requirements…

- 5pin 3.3V MIDI in and out(/through) - MIDI channel selectable. Worst case is that I could add a MIDI splitter box on the board to mirror its input to another cable on the chain and just have MIDI in on this device. I could also use some other form of box or device to take a 5pin MIDI cable and convert it to serial comms input on the arduino…i’d rather keep the number of additional devices to a minimum and I don’t want to have to have a computer or ipad etc to drive the rig…
- Would be great if the playback speed of the audio file could be controlled also (for example, if the default tempo is 120bpm, and I chose to slow it down via the beat buddy, that could trigger a percentage change in the playback speed of the audio - that’s possibly getting a bit too adventurous!
- SD-Card for audio files - media format not a big deal but number of files is a bigger deal (80+). card needs to be accessed from outside the enclosure
- USB or 9VDC powered…
- 3.5mm line out
- Enclosed case - needs to be relatively rugged as it would stay on the pedal board

I’ve been looking at the “Adafruit Music Maker MP3 shield for Arduino” (ADA1790) to be paired with the Arduino Uno R3 (A000066), but nothing’s set in stone. I wasn’t keen to just buy stuff and find out that I can’t do something. I’m very new to the physical board stuff, but I’ve been a programmer for 40 years - C, C++, C#, Basic etc, but not had much to do with logic boards.

Any hints or references to previous projects would be greatly appreciated!  
Craig

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [1 October 2021 01:39 UTC](https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618/2 "2021-10-01T01:39:16Z")

</div>

Hey Craig,

Welcome to the forum mate! That project sounds great!

Yes, most of the WAV and MP3 triggers can only store as many tracks as they have closable inputs which do get quite limiting if you need to store a large amount of music which you need to trigger based on various inputs (also, depending on the form of Audio Compression used in the filetype which will affect the memory requirements, particularly of longer tracks).

> **[What Is Audio Compression (And Why Should You Care)? — Audioengine](https://audioengineusa.com/explore/what-is-audio-compression-and-why-should-you-care/)**
>
> Imagine a top-of-the-line supercar made by one of the most exceptional car brands: German, Italian—you name it.Once the final shine is added to the exquisite Murano leather seats inside, and that flashy shiny beast rolls off the factory line, it...

> **[MP3 Trigger](https://core-electronics.com.au/mp3-trigger-33785.html)**
>
> Make some noise with your next project! The MP3 Trigger board is built to make MP3 sound integration easier than ever. The board has 18 external trigger pins that will directly trigger pre-selected MP3 tracks, and a full-duplex serial control port...

What _sounds_ 😅 like the best solution as you’ve described is to use a BeatBuddy for your pedal, along with your MC-6 to send MIDI messages out appropriately. Some hardware that you may be able to use to throw this together would be a Teensy 3 or 4 (probably the 4) with some appropriate breakouts to be able to connect to MIDI and an Audio Adaptor board for storing all of the tracks you’re looking to trigger based on the messages. It’s quite a different project, but Ken’s Euclidean that he designed should have plenty of useful info for getting started and if you’re after tutorials for using the Teensy, we’ve got plenty of those available on the site completely free too (although I admit some are getting a little older now, definitely worth a read though, there should be a tutorial about using USB MIDI too if I remember correctly):

> **[The Euclidean](https://core-electronics.com.au/projects/the-euclidean)**
>
> I'm an amateur musician but a pretty serious classical & jazz pianist, and this project arose out of my interest in exploring the difference between writing music for synthesisers and music for piano.  I work as a mathematician, so I am also...

> **[Using Teensy with Arduino IDE - Video Tutorial](https://core-electronics.com.au/videos/using-teensy-with-arduino-ide)**
>
> If you’ve come looking for how to get your Teensy board up and running using the Arduino IDE, then you’ve come to the right place. Whilst you can use the standard Teensy loader application to flash compiled code directly to your Teensy, most people...

> **[Core Electronics | Core Electronics Australia](https://core-electronics.com.au/tutorials/teensy/)**
>
> Core Electronics is a retailer for electronics in Australia including Arduino, Raspberry Pi, Sparkfun and Adafruit products. Fast shipping and support.

> **[Teensy 4.1 (Headers)](https://core-electronics.com.au/teensy-4-1-headers.html)**
>
> The Teensy 4.1 is the newest iteration of the astoundingly popular development platform that features an ARM Cortex-M7 processor at 600MHz, with a NXP iMXRT1062 .. read more

> **[Audio Adapter Board for Teensy 4.0](https://core-electronics.com.au/audio-adapter-board-for-teensy-4-0.html)**
>
> This audio adaptor lets you easily add high quality 16 bit, 44.1 kHz sample rate (CD quality) audio to your projects with Teensy 4.0 (Rev D). It supports stereo .. read more

---

<div class="post-metadata">

**Author:** ![Craig179402](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Craig179402](https://forum.core-electronics.com.au/u/Craig179402)\
**Post date:** [1 October 2021 06:04 UTC](https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618/3 "2021-10-01T06:04:46Z")

</div>

Thanks Bryce - that’s extremely useful. I have splashed out and purchased a selection of stuff and watched a couple of videos about how it all works and it seems to me that it should work well, perhaps apart from an enclosure. I’ll prototype it up and see how I go (when I eventually get delivery!).

Cheers

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [1 October 2021 06:24 UTC](https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618/4 "2021-10-01T06:24:45Z")

</div>

Hey Craig,

I’m wondering if @John136772 might be able to chime in on this one eventually, he does some awesome stuff with MIDI, audio, and teensies.

Cool project, keen to see it develop!  
-James

In the mean time, check out his youtube:

> **[Expensive Notes](https://www.youtube.com/channel/UCRMFJWXNEPePkKS9frWLYlA)**
>
> A place for Synth Noodles

---

<div class="post-metadata">

**Author:** ![John136772](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/john136772/32/5416_2.png) [@John136772](https://forum.core-electronics.com.au/u/John136772)\
**Post date:** [1 October 2021 08:20 UTC](https://forum.core-electronics.com.au/t/midi-triggered-audio-player-to-line-out/11618/5 "2021-10-01T08:20:44Z")

</div>

Yes Teensy plus its audio shield is the most powerful combination for this sort of stuff. The teensy 4.1 has an SD card slot, and although I haven’t used it, it’s more than capable of holding sounds and playing them. The pjrc forum is very helpful and has a dedicated Audio project thread. Also, the best/easiest way to program it is using the Arduino IDE and the Teedsyduino add-on which is C based.
