Ocarina of Sole(noid)
.
Our team created a self playing Ocarina. An Ocarina is a flute type wind instrument that plays notes by covering air holes and blowing into a mouthpiece. This project uses solenoids to cover and uncover the holes of the ocarina in conjunction with an embedded processor to play specific tunes and scales.
Hardware
Components:
Setup and Connections:
The Ocarina was set onto a wooden slab and hanger wire was put into place around it. This hanger wire was bent in appropriate ways and the Solenoids were attached with little pads on the end so that they would be covering the finger holes when not activated. When activated the holes would be uncovered as the solenoid retracted.
Ocarina Setup
Because of the lack of solenoids and the size/placement of the holes it was decided that our team would cover the 8th, 9th, and 10th hole while the 11th and 12th would always be open. This allowed for a range of 11 notes and one rest sequence. Below are how the set up was made and what notes were accessible.
Hole Number | Coverage | mbed |
---|---|---|
1 | Pad | P25 |
2 | Pad | P26 |
3 | Pad | P27 |
4 | Pad | P28 |
5 | Pad | P23 |
6 | Pad | P22 |
7 | Pad | P21 |
8 | Covered | None |
9 | Covered | None |
10 | Covered | None |
11 | Covered | None |
12 | Covered | None |
Fibble | Pad | P24 |
Fingering Chart
Hole (Pin) | C | D | E | F | F# | G | G# | A | A# | B | C | Rest |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 (P25) | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
2 (P25) | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
3 (P25) | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
4 (P25) | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
5 (P25) | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 |
6 (P25) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
7 (P25) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
Fibble (P25) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Pin Connections
Because there are 8 sets of MOSFETs and solenoids, in the chart below they are numbered based on their finger hole from the above section.
mbed | MOSFET (1) | Solenoid (1) | MOSFET (2) | Solenoid (2) | MOSFET (3) | Solenoid (3) | MOSFET (4) | Solenoid (4) | MOSFET (5) | Solenoid (5) | MOSFET (6) | Solenoid (6) | MOSFET (7) | Solenoid (7) | MOSFET (Fibble) | Solenoid (Fibble) | External Power Supply |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Vin | 5V | ||||||||||||||||
GND | JP2-2 GND | JP2-2 GND | JP2-2 GND | JP2-2 GND | JP2-2 GND | JP2-2 GND | JP2-2 GND | JP2-2 GND | GND | ||||||||
P21 | JP2-3 Control | ||||||||||||||||
P22 | JP2-3 Control | ||||||||||||||||
P23 | JP2-3 Control | ||||||||||||||||
P24 | JP2-3 Control | ||||||||||||||||
P25 | JP2-3 Control | ||||||||||||||||
P26 | JP2-3 Control | ||||||||||||||||
P27 | JP2-3 Control | ||||||||||||||||
P28 | JP2-3 Control | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP1-1 | - | ||||||||||||||||
JP1-2 | + | ||||||||||||||||
JP2-1 RAW | JP2-1 RAW | JP2-1 RAW | JP2-1 RAW | JP2-1 RAW | JP2-1 RAW | JJP2-1 RAW | JP2-1 RAW | 5V |
Because of the nature of the solenoids, our external power source was a 5V/10A source. This was because each solenoid pulled about 1A apiece.
Solenoc Software
The Ocarina of Solenoids is driven by a basic software design implemented in the below (Playing a Song) code. Each Song is constructed in the "buildSong()" function in the Song class. The Song class contains a vector of note/length pairs which is iterated through in the Solenoc function playSong(). This playSong function interfaces the HardwareController and Song classes, where the binary representation of each note is returned through one of Song's member functions, getBinrayNote.
Inside getBinaryNote, each note is represented as a string (notes C, D, E, F, etc.) and converted to a 8-bit binary number. Every individual bit in this number represents a control bit for an individual solenoid in the array of solenoids. The binary representation is returned back up to Solenoc where HardwareController is called with playNote(binaryRepresentation), where the solenoids are driven using the DigitalOut pins on the MBED.
Playing an Arpeggio
Playing a Song
Import programSolenocarina
Self-playing Ocarina!
Team Members
Please log in to post comments.