2017-01-01 (Su) Tough Pi-ano

So far the assumption was that a synthesizer would be the only way to get usable sound from a Raspberry Pi Zero. The Piano Hat had code for interfacing with Sunvox, a free synthesizer that ran on all the common operating systems but that code did not work. Another Piano Hat example didn’t use a synthesizer, it just played .wav files. No research was done into method since it was assumed the files could not play simultaneously but that was incorrect. Fortunately.

A quick video was made which showed the Piano Hat, mounted to a Pi Zero, playing piano notes in different octaves. It should be possible to use Python to play files similarly but using the GPIO raw inputs instead. In fact, this should not be difficult. It will still be necessary to change octaves based on a thumbwheel switch but this is still only a matter of reading GPIO and playing the appropriate sound file.

Example code in Piano Hat

The example code for the .wav playing Piano Hat will be dissected in order to find out how it should be done. This is likely a very simple process well known to anyone who regularly plays with Raspberry Pis.

To do:
  • Figure out GPIO recognition in Python
  • Figure out how to play .wav files from Python
  • Write Python code to play audio when triggered by GPIO
  • Add code to change octaves based on GPIO input

The rest of the posts for this project have been arranged by date.

First time here?

Completed projects from year 1.
Completed projects from year 2



This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.

All information in this blog, or linked by this blog, are not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property or similar, is the responsibility of those involved in the replication.

All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by Brian McEvoy, cannot be used to claim property or assets.

Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim claim property or assets based on their post.

This blog, including pictures and text, is copyright to Brian McEvoy.


2016-06-01 (W)

Comments