MIDI and Teensy 3.2

The goal is to be able to use the Akai MPK mini 25 as a set of inputs for doing sound design with a Teensy 3.2 Arduino device and an Audio Shield.  There are some limitations that I have not been able to sort out to get the midi interface to work properly – e.g. to detect MIDI inputs over USB.  I have tried three different Teensy setups (2 x 3.2 and 1 x 3.6), and three different computers (Intel NUC, an ASUS motherboard – Z17, and a MacBook Air) running Arduino 1.8.1 or 1.8.2 and the Teensyduino software 1.37 & 1.38.  I just can not get the board to detect MIDI events (both using the serial port and simply blinking a LED).

However, I can get working the function of the Teensy to send MIDI.  Using the Button Example and Reaper DAW software, I can get the Teensy 3.2 w/the audio shield to communicate with Reaper and send messages to play notes.  All this is mystifying to me, but I know eventually I will get this sorted.  I have swapped cables as well, and nothing works to get Teensy to receive MIDI messages.

I will post the problem to the forum and see what responses I can get… and search the web for problems with Teensy in the receive mode.  This is important because I want to use the 8 pots and 8 pads to configure the functionality of the Teensy – for creating more interactive feedback from changes in state say from knobs and button pushes.

To be continued!

Posted in How To | Leave a comment

New Pomo Timer

It was time to re-do the pomodoro timer and make it simpler and more reliable.  to that end, I decided to use a Teensy 3.2 (overkill) and a Sparkfun Serial Seven Segment display.  The code is pomo_s7s_1011 and is in the dropbox project folder.

The white 3mm LEDs indicate state (5 min/25 min countdown) and with 220 ohm resistors are too bright, but this is a small defect.  Otherwise the system is working very well and on a small proto board on top of an altoids tin.

pomo timer layout
Pomo timer HW Layout with Teensy 3.2 & Sparkfun Serial 7 Segment Display

There are simply 2 switches, 2 LEDs, 1 speaker out, and 1 serial out for the sparkfun serial display.  The pins are 3 & 5 for the pushbuttons, 2 & 7 for the LEDs, pin 4 for the speaker output (driving directly a small microspeaker from an iPhone), and the serial port, pin 1, running at 9600 Baud.  The push buttons select either: 5 or 25 minutes duration, and the other resets the timer when a time out condition exists.



Posted in How To | Leave a comment

Generating Music on iOS with AudioShare

AudioShare (2.7.4) is a file organizer for iOS that helps one record from various applications, apply special effects, perform editing, and then save the file locally or to other locations, such as Dropbox.  It is very easy to use, efficient, and extremely handy – serving a number of really needed functions.  I discovered this App, and learned how to use it with the book “Ipad Music School: A Hands-On Introduction” by Clif Johnston – you can learn about more at https://www.amazon.com/dp/B00ZOQ4AFG/ref=rdr_kindle_ext_tmb

The workflow to use AudioShare to record, edit and upload a music performance using another iOS App:  DRC (audio synth) is as follows:

  • Setup: Press Mic Button, Select Mic w/(+), and Select App (DRC); Turn on Monitor and Press Record
  • Record: Switch to App (DRC), play tune sequence, then press lower left arrow to return to AudioShare
  • Save: Press Record again  to stop recording, Edit by pressing Tools in upper right, trim and normalize piece, save when done; Edit file name by holding file name until menu appears where you can edit and move file into folder
  • Upload: Press button on bottom showing icon for uploading, select proper location in iOS system file message box, select DropBox and file where appropriate

That is all there is to using AudioShare. It also works with many other applications and collaborates with signal processing/effects Apps as well.




Posted in Audio, How To, Music | Comments Off

Teensy Drum Synthesizer

I’ve recently started to learn about and practice with Teensy’s audio library, and their companion shield.  The reason that I have gone this route is that the Mozzi library uses lower fidelity DACs that result in too much noise, even though they promise 12 bits.  There are just too many artifacts.

I have built a simple drum synthesizer using the amazing audio design tool from PJRC – which you have to check out!  https://www.pjrc.com/teensy/gui/

Here is the project I’v built using brass strips as keys – simple on/off but responsive keys to the digital inputs of a Teensy 3.2 digital inputs (4-8).


And here is the input prototype, made from yardsticks, thin hobby plywood and brass strips:


The audio design tool is a simple front end for arduino sketches to enable hooking up audio components/signal processing blocks quickly and integrate into a sketch.  Here is the block diagram for this project:


Way cool, isn’t it!  Finally, I coded it into the Arduino IDE with a polling mechansim for the 5 switches, and the source file is “sD_tAd_419.ino” and it creates incredible sounds, especially for 5 second note times.


Posted in How To | Comments Off

Step Sequencer Using Mozzi

Recently completed is a step sequencer that combines many different subsystems to yield a nice sounding and playful platform.  We hope that this provides enough documentation so that when I come back to this project, I can actually get up to speed quickly and accurately.  I have decided to document projects both on line via 47meters & via a paper file to keep at my home office.  Here is what the project looks like – the whole system:

Below is the schematic for the project.  Basically it consists of a filter module and a rail splitter block.  The filter module consists of a first order LPF at 7 KHz, followed by a Sallen-Key second order filter at at 8 KHz, followed by another first order LPF at 7 KHz.

Here is the wiring on the white board:

[Software Architecture] – [ Digital Realization] – [ Analog System] – [ Audio Output ]

The project looks like the following two images.  Note, that I think that the so called ‘white boards’, or ‘poke boards’, or ‘solder-less breadboards’ provides an amazing almost permanent construction medium.  I really believe that unless you plan mass production, that you stick with white boards.

I will start with the important Software Architecture (lifted from the Mozzi playbook):

Update Control

The system design consists of a sequence array that contains the notes and their relative position (all notes in MIDI integer values), which is part of a loop that tests a ‘note ready’ condidiont.  If this is satisfied, the the note frequencies are updated, and the next note cycle is initiated.

And the table for the Digital Pins:

Update Audio

This cycle, run at very high speed is responsible for the DAC response to the note(s) instantaneous value, the envelop value, and an overall mixer value to balance the sound between multiple oscillators.

Here is the filter used to reconstruct the audio and filter out excessive (out of band noise):

Just to make sure it was working properly, here is the frequency response, showing approximately a 4th order Low Pass Filter:

Low Pass Filter Response of 4th Order at 8 KHz


Posted in How To | Comments Off

ARM Capacitance Sensor

The Teensy 3.2 is an amazing small Arduino, and it uses a powerful ARM processor running at 96 MHz.  One of the benefits of this part is that it has a multitude of sensor inputs (on the order of 12) that can be used as switches or similar sensors.

This is a plot from a sketch with approximately 1 ms sample rate (I think it is more like 10 ms sample rate because I was simulating a button press).  I plan to use this as a synthesizer input for generation of electronic music.  Note the baseline is 1000 units, which is much higher than a normal open pin value of 17 or so.  This is due to the length of wires, the layout and the brass pad of approximately .5 x .8 inches.

The C++ (Arduino) code used to create this is, and the plot was performed in the LibreOffice application Calc.
void setup(void)

void loop(void)

Posted in Arduino, Commonplace, Hobbies, How To | Tagged , , , | Comments Off

Amazon Headphones & Amplifier

Amazon has a pair of very inexpensive on the ear headphones that I thought would be perfect for a variety of low fidelity uses where I did not want to bother with in the ear/earbud type transducers.  Also, it provides a good balance of noise blocking, comfort and bass response.  These headphones, sold under their ‘Basics’ label are very inexpensive and highly regarded (what ever that means) by the Amazon customers that evaluated them.  They can be found at: https://www.amazon.com/AmazonBasics-Lightweight-On-Ear-Headphones-Black/dp/B00NBEWB4U  And they have an average rating of 4.3 of 5.0.

Also, I wanted to build a simple, optimized amplifier to drive these headphones for a variety of uses from Arduino projects (Mozzi based music synthesizer to amateur radio applications), but their specifications were not readily available.  In this post we will describe the headphones and then the amplifier used to drive them.

The over the ear headphones have a diaphragm size of 36 mm and an impedance of approximately 32 Ohms.  By using a simple flat plate coupler and an inexpensive sound pressure meter (not well calibrated, but probably close) the sensitivity was measured as 72mv at 1 KHz to generate 94 dB SPL.  This should be checked, but is directionally correct.


The schematic shows the use of two unity gain, low voltage followers as drivers.  One is a virtual ground, the other is a unity gain follower.


Here is what the circuit looks like functioning as a follower after the Teensy 3.2 that I am using to run some Mozzi sound synthesis routines.  The circuit, using TLV2462 Op Amps (really great low voltage op amps), can generate almost 1.2 VRMS which generates almost 116 dB SPL with these headphones, which is plenty loud off of a 5 volt supply!  Note that I put the headphones in parallel, so it is 16 ohms and the output is current limited.

Posted in Arduino, Commonplace, Hobbies, How To | Tagged , , , , | Comments Off

Posting Photos in Lightroom CC

I’ve switched to using Adobe’s CC photo sharing facility for sharing photographs with others.  Although you can not add text, you can show a nice ‘light table’ image of all photos at once, and you can then click on photos that you like.

Here are the instructions on how to do this from Lightroom’s help:

Step 1 of 6
Sign in to Lightroom
From the Lightroom desktop app, click “Get started with Lightroom on mobile” in the top left corner of the workspace.
Click “Sign In” and enter your Adobe credentials or create an Adobe user ID and password, if you don’t already have one.

Step 2 of 6
Sync collections
When you sync a collection in Lightroom desktop, you share your photo collection on Lightroom on the web and in Lightroom on mobile.
In the Lightroom desktop app, click the arrow next to Collections to see a list of your photo collections. As you hover your mouse to the left of a collection, the Sync icon appears (as shown). Click the Sync icon for the collections you wish to share.
Step 3 of 6
View your collection on Lightroom on the web
Go to Lightroom on the web. On this page, select “Try Lightroom on the web” and sign in with your Adobe user ID and password.
Tip: To do this from Lightroom desktop, right-click (Windows) or control-click (Mac) the collection you wish to share, and in the context menu, select Lightroom mobile Links > View on web.

Posted in How To, Photography | Tagged , , | Comments Off

BMP180 Barometric Sensor, Sparkfun Serial Seven Segment & Feather Cortex M0 Processor

Project for portable Arduino work that also allows integration and experimentation with BMP180 Barometric Sensor breakout board.  It also has a pushbutton input and a photo transistor, and a voltage divider to measure current.  I plan to use this in the future to measure current draw for Arduinos and also the KX3.

Original documentation is from Oct 6, 2016 and is recorded in the Green notebook.  This project incorporates some unusual libraries and should be a benchmark/standard for future projects.  The libraries include:
  • The hardware uses a small 5cm x 7cm substrate board, on which the feather and s7s is mounted.  The various components are also attached to the substrate
  • The BMP180 is attached to the feather breadboard area
  • The substrate board is attached to a Mintz tin by high strength loop and hook adhesive pads – on on Mintz tin,  and the other on the substrate

The software looks like:

  • Adafruit Unified Sensor Library
  • SERCOM Library to allow use of multiplexed hardware IO as the Feather does not do software serial (also includes pin Peripheral function)
  • Standard Seven Segment library, but uses SERCOM, not software serial
  • Arduino Code:  hwSer_180_s7s_f_nov12a, stored in the Ubuntu and Mac Book Air computers
  • The Feather sometimes requires the use of the reset button to load new software

The code looks like the following:

  • Setup  the serial ports, the pressure sensor, and the seven segment display
  • Displays the code date of 1112
  • Loop: gets sensor data (if valid), and then prints it to the console monitor and then formats it for display on the seven segment, and displays the pressure and temperature alternating every second. 
  • The temperature is in degrees f, and the pressure is in millibars

Schematic Diagram of the system:



Posted in Arduino, Commonplace, Hobbies, How To, Projects | Tagged , , , , | Comments Off

Python on Pi

Recently, I have added a sensor shield (Sense Hat) to an Raspberry Pi3 that has an 8×8 array of neoPixel LEDs.  As a simple challenge, I wanted a python script to display the real time quotes of a stock, using the scrolling API that came with the shield.

Sense Hat & RPi3

This time I used a distributed development environment, and I think I will never go back to doing development on the Pi unless forced to do so.  I used Microsoft Visual Code to develop the python script, and then Filezilla to transfer the source to the pi.  After loading python updates, I then use ssh to run the script and the display is output on the shield.

The mechanical configuration consists of the Sense Hat simply plugging into the RPi, and the sandwich attached to a space frame made from aluminum robotics extrusions.  The RPi is attached to the space frame using the ultra strong hooks and loops bonding system by 3M.  Note that the system looks ‘upside down’.  This was intentional since it minimizes cables coming out of odd places, and improves the looks.


  • SSH 10.0.0.xx -l pi /yes / password.  Fill in xx with the actual network address of the pi on your local LAN.
  • python py927.py.  This command executes the most current version on the pi.  This file also prints out the same data as being displayed on the serial console, if you choose to further debug the program.
Posted in Commonplace, Hobbies, How To, Raspberry Pi | Tagged , , | Comments Off