Making a Distinctive Digital Musical Instrument: The Sound Wall – Open Electronics

We place metallic foil notes on a panel and play our music by touching them, making a melody from a really unique instrument.
Those that know somewhat about music or have good reminiscences of the “music schooling” hours at secondary faculty (or secondary faculty, to place it in a contemporary approach), will definitely do not forget that musical devices are divided into varied classes primarily based on how the kind of erudite musician operates them to supply notes: we’ve wind devices (flute, oboe, clarinet, mouth organ, and so forth.) percussion devices (drums, piano, and so forth.), string devices (guitar, bass, violin, but in addition the traditional harpsichord may fall into this class), pipe devices and so forth. We’ve got wind devices (flute, oboe, clarinet, mouth organ, and so forth.), percussion devices (drums, piano, and so forth.), string devices (guitar, bass, violin, but in addition the traditional harpsichord may fall into this class), pipe devices and so forth. All of them have in frequent the truth that they work with out the necessity for contemporary know-how. It isn’t by probability that they have been created a few years in the past when electrical energy or electronics have been unknown, and primarily based on quite simple and primordial bodily ideas.
What we wish to suggest to you in these pages is one thing a bit uncommon, as a result of it’s an digital musical instrument that we may place amongst these with a keyboard, however which is performed by touching keys (we name them that despite the fact that they aren’t) which aren’t pressed however are merely touched or touched. As you possibly can see within the pictures of the prototype on these pages, we’ve conceived it as a big panel (Fig. 1) with metallic plates formed like musical notes utilized to it (it’s no coincidence that we’ve determined to name it Sound Wall…), however anybody can provide the “consumer” interface, and due to this fact the keyboard, the form, and look they like.
Fig. 1
The undertaking
Let’s see what it’s all about, additionally with the assistance of the wiring diagram on these pages: our instrument is nothing greater than an Arduino Uno board interfaced to the plates (by touching them along with your fingers, the sound can be reproduced) via MPR121CAPTOUCH breakouts, that are contact sensors and which within the circuit are proportional in quantity to the notes. Each time we contact a metallic plate, the breakout board to which it’s electrically linked will detect the switch of the quantity of electrical cost to our physique and can ship a sign to the Arduino Uno, which, in accordance with the loaded firmware, will command the technology of a sound utilizing the “collaboration” of the FT1414M board from Open Electronics, which we’ve already used within the undertaking.
The breakout board contact is mainly a board for the administration of contact sensors, then to every pin NOTE and SEL we’ve linked some aluminum plates with any form (particularly musical notes and geometric shapes) in order that urgent the finger on them, can act as a button; every board reads a sure variety of plates-notes and to be actual 18, of which 14 for the notes (two octaves precisely …) and 4 to set the mode of execution, or simulated devices or “results” if you happen to want. These sound results are the Celesta (or celestial metallophone with hammers), the Carillon and two customary MIDI synthesizer sounds that are the FX2 (area weapon kind synthesizer) and the Sci-Fi FX8 (area sound synthesizer).
The breakout board for contact administration relies on Freescale’s MPR121QR2 chip, which is a capacitive contact sensor managed by way of an I²C interface. The chip can individually management as much as 12 electrodes and a most of 8 LEDs (when the pins will not be configured as electrodes), which is why you see two of them in our design. On the backside of the PCB are 4 jumpers (pads with tracks), all of that are closed for the default setting. Considered one of these jumpers connects the ADD pin to the bottom, so the I²C-Bus handle of the chip can be 0x5A. Utilizing two breakouts, on the second this jumper must be opened, thus giving the board the handle 0x5B. The jumpers additionally join the SDA, SCL and IRQ pins to 10 kohm pull-up resistors. The breakout doesn’t have a voltage regulator, so the facility provide have to be between 2.5 and three.6 Vdc, which the Arduino Uno does with its built-in regulator that gives voltage by way of pins 3V3 and GND.
The sound technology is finished by the Arduino FT1414M defend primarily based on the Ogg Vorbis/MP3/AAC/WMA/MIDI audio decoder chip (VS1053B) produced by VLSI.
It permits a sure variety of musical notes to be generated by synthesizing the sounds of a lot of musical devices, each melodic and percussive, following instructions given by a knowledge channel; the instructions accepted might be in varied codecs, together with the favored MIDI, which has been the usual used for many years to interface music synthesizers and digital keyboards to the PC.
For communication with the host machine (the microcontroller governing the synthesizer), the VS1053B is used on this defend in serial mode.
The defend takes energy from the Arduino by way of the 5V pin and the frequent GND; 5 volts is equipped by the PAM8043 amplifier module, whereas 3.3 volts and 1.8 volts are equipped by the LDO linear regulators (MIC5504-1.8YM5-TR and MIC5504-3.3YM5-TR).
The VS1053B built-in amplifier has a stereo audio output linked to a printed circuit jack to which headphones might be linked. As well as, the identical output is linked to a low-power BF amplifier (not included within the defend) with low-impedance outputs that raises the sign stage sufficient to drive a pair of 3-watt, 4-ohm impedance audio system.
The mini-amplifier code PAM8403POT is mounted by itself adapter board and plugged into the defend by way of a socket.
The electronics meeting is proven in Fig. 2 utilized to the panel from the entrance.
Fig. 2
The way it works
Now let’s see how the entire thing works, beginning with the digital keys: by putting your finger or hand on a sensor blade, we trigger the breakout board to output a string of information that’s learn from the corresponding Arduino I²C bus. This occasion causes the Arduino to play the corresponding observe, which is generated by driving the VS1053B’s inside MIDI synthesizer by way of serial, by way of the technology of a knowledge string on tx0, containing details about the corresponding observe. The info is in MIDI format and is due to this fact decoded by the VS1053B. The VS1053B is a multistandard codec and decoder of many codecs, nevertheless it has the particularity of integrating a large-scale sound synthesizer primarily based on VLSI’s proprietary DSP (Digital Sign Processor) (i.e., the VS_DSP). It comprises code and knowledge reminiscence for the Ogg Vorbis, MP3, AAC, WMA and WAV PCM+ADPCM audio decoding codecs, in addition to an entire customary MIDI synthesizer; it communicates with the surface world by way of a serial interface, which might be configured as SPI.
Contained in the VS1053B is a multi-rate stereo DAC and audio preamplifier stage.
with a stereo model of the output filter. The built-in amplifier additionally helps PCM/ADPCM audio encoding, utilizing both a microphone amplifier or a high-level line enter with a built-in preamplifier for the enter sign to be encoded; the enter sign is distributed to a stereo A/D converter.
Because of software program plug-ins, the chip may also carry out lossless FLAC decoding like that of a high-quality recording in Ogg Vorbis format. The built-in sound synthesiser with a normal MIDI interface has two banks of “results” akin to musical devices and referred to as GM1 (for melodic devices) and GM2 (for percussion devices); in our software, we use the GM1 financial institution, however by modifying the
firmware you possibly can change the instrument if you happen to really feel prefer it and need to strive it.
The musical notes produced are 12 per octave (i.e., the 7 notes plus halftones) and the attainable octaves are 11, so the VS1053B covers a particularly huge musical vary, nicely past that of the piano (which has 7 octaves plus a C). Desk 1 summarises the person notes by correlating them with the worth of the info acquired: as you possibly can see, 128 sounds are attainable for every “register” or impact, every recognized by a numerical worth that’s handed from the Arduino to the VS1053B in serial kind in binary format.
Desk 1
The primary prompts instrument 1, which is the Celesta (or hammer metallophone), the second the music field, the third the space-weapon synthesizer, and the fourth the Sci-Fi FX8 synthesizer (a sound from a science fiction movie). The above sounds and all these that may be developed throughout the GM1 financial institution are described in Desk 2.
Desk 2.
The midi defend
Allow us to now take a better have a look at the guts of our musical instrument, specifically the defend primarily based on VLSI’s VS1053B built-in circuit, which is able to producing a sure variety of musical notes by synthesizing the sounds of a lot of musical devices, each melodic (together with the harp and organ) and percussion, following instructions given by a knowledge channel; the instructions accepted might be of varied codecs, together with the favored MIDI, which has been the usual used for many years to interface musical synthesizers and digital keyboards to the PC.
For communication with the host machine (the microcontroller that controls the
circuit, which in our case is Arduino) additionally in SPI-bus mode. Actually, the VS1053B integrates a serial interface complicated that has two interfaces: a management interface (SCI=Serial Command Interface) that’s used to manage the operation of the chip and that in our case is the one by way of which Arduino provides its instructions, and a knowledge switch interface (SDI=Serial Information Interface) due to which the VS1053B can switch or purchase knowledge streams to or from one other exterior machine.
Of the 2, the one that may be configured to function in TTL or SPI serial mode is the SCI, the management interface. The built-in sound synthesizer relies on a VLSI proprietary DSP (Digital Sign Processor), referred to as the VS_DSP. The synthesized sounds are transformed by a multi-rate stereo DAC, the output of which is a BF amplifier with a filter to chop down the conversion residues.
The built-in circuit additionally helps PCM/ADPCM audio coding, both by utilizing a microphone amplifier as an enter stage (for many who want to use a microphone as a supply) or by taking the sign from a line enter and sending it to a stereo A/D converter. In our defend, Arduino manages the VS1053B by way of the serial port used as UART, which within the U1 is linked to pins 26 (RX) and 27 (TX), linked respectively to digital pins D3 and D2 of the Arduino (that are due to this fact reserved); the latter additionally manages the reset of the U1, by way of D4, in order to organize it to obtain instructions.
Fig. 3
The three traces in query have pull-ups on the aspect of the VS1053 and are managed by the Arduino pins utilizing resistors in collection; three jumpers (JRX, JTX and JRST) on the defend’s printed circuit board permit them to be disconnected, if crucial, for instance if a unique type of management is chosen, reminiscent of SPI.
In any case, there are three traces to permit interfacing to SPI, since one acts as a knowledge channel, one as a reset and the opposite as a clock; all you must do is write the firmware accordingly.
The defend takes energy from the Arduino by way of the 5V pin and GND; on board it has LDO regulators to acquire 1.8 volts (MIC5504-1.8YM5-TR) and three.3 volts (MIC5504-3.3YM5-TR) to energy the assorted phases of the VS1053B.
The VS1053B built-in amplifier has a stereo audio output situated on pins 39 (R channel) and 46 (L channel) referring to the frequent pin 42 (GBUF), which isn’t linked to the analog floor, but in addition coupled, just like the sign traces, by way of R/C networks. The outputs of the U1 audio attain a stereo jack socket on the printed circuit board to which it’s attainable to attach headphones since they’re linked to a low-power BF amplifier with low-impedance outputs.
The identical R and L traces attain the inputs of the PAN8403 amplifier module, which raises the sign stage sufficient to drive a pair of 3-watt, 4-ohm impedance loudspeakers; the U4 module is the PAM8403, primarily based on the homonymous built-in amplifier already outfitted with all of the exterior parts it wants and the amount management potentiometer.
The firmware
Effectively, now that we’ve defined what the {hardware} consists of, we are able to see how the sketch loaded into Arduino works to manage our musical instrument, i.e., studying the standing of the contact sensors (metallic plates or foils) and producing the corresponding instructions to the MIDI shield.
On the code stage, we are able to see the “Play” perform, which is the one that permits the observe to be performed if finger contact is detected on some “Contact” plate, in flip by way of the “noteOn” perform. The “checkInterrupt1” and “checkInterrupt2” features are the primary to establish the important thing pressed by the NOTE breakout and the second for the SEL breakout. If a pressed secret is detected I set the placement “i” within the “touchStates” array for the pressed key to the worth “1”, or “0” if not pressed. The sketch is structurally and conceptually easy, as a result of after initializing the traces and defining the variables it reads the state of the plates from the info offered by the 2 touch-sensitive breakout boards if a contact is detected. If this occurs, the firmware initially identifies the corresponding enter and distinguishes between observe instructions and register or instrument setting instructions: within the first case, it makes the defend execute the corresponding observe by sending a MIDI command string, whereas within the second case, it orders the VS1053B on the defend itself to set the corresponding instrument.
At any time when a brand new instrument is chosen from the 4, a observe of the brand new instrument is performed to establish the change.
Relating to the features, there are mainly 4 totally different devices, though we solely used 4 of them, however they will differ with out issues by altering the quantity to the fixed const int.
The selection of devices is linked to the second breakout the place we’ve indicated “SEL” within the wiring diagram:
const int INSTRUMENT1=9;const int
INSTRUMENT2=11;const
int INSTRUMENT3=98;
const int INSTRUMENT4=104.
The devices offered and set within the sketch are, in accordance with Desk 2 which reveals this system numbers of financial institution 0 of the midi VS1053B:
– 9 Celesta (or celestial metallophone);
– 11 Carillon;
– 98 FX2 soundtrack (area weapon-type synthesizer);
– 104 Sci-Fi FX8 (area sound synthesizer).
Relying on which metallic plate we contact, we’ll then acquire notes that can reproduce the sound of the corresponding instrument.
The sketch that manages our Sound Wall is somewhat giant to have the ability to report it fully in these pages, so we present you three extracts which might be essentially the most important: Itemizing 1 reveals the setup for the 2 playing cards that purchase the alerts associated to metallic contacts, i.e., the contact sensors.
Itemizing 1
void mpr121_setup(void){ set_register(0x5A, ELE_CFG, 0x00); // Part A - Controls filtering when knowledge is > baseline. set_register(0x5A, MHD_R, 0x01); set_register(0x5A, NHD_R, 0x01); set_register(0x5A, NCL_R, 0x00); set_register(0x5A, FDL_R, 0x00); // Part B - Controls filtering when knowledge is < baseline. set_register(0x5A, MHD_F, 0x01); set_register(0x5A, NHD_F, 0x01); set_register(0x5A, NCL_F, 0xFF); set_register(0x5A, FDL_F, 0x02); // Part C - Units contact and launch thresholds for every electrode set_register(0x5A, ELE0_T, TOU_THRESH); set_register(0x5A, ELE0_R, REL_THRESH); set_register(0x5A, ELE1_T, TOU_THRESH); set_register(0x5A, ELE1_R, REL_THRESH); set_register(0x5A, ELE2_T, TOU_THRESH); set_register(0x5A, ELE2_R, REL_THRESH); set_register(0x5A, ELE3_T, TOU_THRESH); set_register(0x5A, ELE3_R, REL_THRESH); set_register(0x5A, ELE4_T, TOU_THRESH); set_register(0x5A, ELE4_R, REL_THRESH); set_register(0x5A, ELE5_T, TOU_THRESH); set_register(0x5A, ELE5_R, REL_THRESH); set_register(0x5A, ELE6_T, TOU_THRESH); set_register(0x5A, ELE6_R, REL_THRESH); set_register(0x5A, ELE7_T, TOU_THRESH); set_register(0x5A, ELE7_R, REL_THRESH); set_register(0x5A, ELE8_T, TOU_THRESH); set_register(0x5A, ELE8_R, REL_THRESH); set_register(0x5A, ELE9_T, TOU_THRESH); set_register(0x5A, ELE9_R, REL_THRESH); set_register(0x5A, ELE10_T, TOU_THRESH); set_register(0x5A, ELE10_R, REL_THRESH); set_register(0x5A, ELE11_T, TOU_THRESH); set_register(0x5A, ELE11_R, REL_THRESH); // Part D // Set the Filter Configuration // Set ESI2 set_register(0x5A, FIL_CFG, 0x04); // Part E // Electrode Configuration // Set ELE_CFG to 0x00 to return to standby mode set_register(0x5A, ELE_CFG, 0x0C); // Allows all 12 Electrodes set_register(0x5A, ELE_CFG, 0x0C); //***************** seconda scheda con indirizzo 0x5B ************************ set_register(0x5B, ELE_CFG, 0x00); // Part A - Controls filtering when knowledge is > baseline. set_register(0x5B, MHD_R, 0x01); set_register(0x5B, NHD_R, 0x01); set_register(0x5B, NCL_R, 0x00); set_register(0x5B, FDL_R, 0x00); // Part B - Controls filtering when knowledge is < baseline. set_register(0x5B, MHD_F, 0x01); set_register(0x5B, NHD_F, 0x01); set_register(0x5B, NCL_F, 0xFF); set_register(0x5B, FDL_F, 0x02); // Part C - Units contact and launch thresholds for every electrode set_register(0x5B, ELE0_T, TOU_THRESH); set_register(0x5B, ELE0_R, REL_THRESH); set_register(0x5B, ELE1_T, TOU_THRESH); set_register(0x5B, ELE1_R, REL_THRESH); set_register(0x5B, ELE2_T, TOU_THRESH); set_register(0x5B, ELE2_R, REL_THRESH); set_register(0x5B, ELE3_T, TOU_THRESH); set_register(0x5B, ELE3_R, REL_THRESH); set_register(0x5B, ELE4_T, TOU_THRESH); set_register(0x5B, ELE4_R, REL_THRESH); set_register(0x5B, ELE5_T, TOU_THRESH); set_register(0x5B, ELE5_R, REL_THRESH); set_register(0x5B, ELE6_T, TOU_THRESH); set_register(0x5B, ELE6_R, REL_THRESH); set_register(0x5B, ELE7_T, TOU_THRESH); set_register(0x5B, ELE7_R, REL_THRESH); set_register(0x5B, ELE8_T, TOU_THRESH); set_register(0x5B, ELE8_R, REL_THRESH); set_register(0x5B, ELE9_T, TOU_THRESH); set_register(0x5B, ELE9_R, REL_THRESH); set_register(0x5B, ELE10_T, TOU_THRESH); set_register(0x5B, ELE10_R, REL_THRESH); set_register(0x5B, ELE11_T, TOU_THRESH); set_register(0x5B, ELE11_R, REL_THRESH); // Part D // Set the Filter Configuration // Set ESI2 set_register(0x5B, FIL_CFG, 0x04); // Part E // Electrode Configuration // Set ELE_CFG to 0x00 to return to standby mode set_register(0x5B, ELE_CFG, 0x0C); // Allows all 12 Electrodes set_register(0x5B, ELE_CFG, 0x0C);
In Itemizing 2 you will see that the portion of the sketch that offers with the precise administration of the MPR121 breakout bar, i.e., the touch-sensor management. Lastly, we report, in Itemizing 3, a final piece of code in regards to the management of notes copy by the defend with VS1053B, through which the fixed int observe assumes the worth of the observe to be performed every time.
Itemizing 2
void readTouchInputs() if(!checkInterrupt1()) //learn the contact state from the MPR121 Wire.requestFrom(0x5A,2); byte LSB = Wire.learn(); byte MSB = Wire.learn(); uint16_t touched = ((MSB << 8) if(!checkInterrupt2()) //learn the contact state from the MPR121 Wire.requestFrom(0x5B,2); byte LSB = Wire.learn(); byte MSB = Wire.learn(); uint16_t touched = ((MSB << 8) for (int i=0; i<24; i++) Serial.print(touchStates[i]); Serial.println();
Itemizing 3
void Play() int observe=30; for (int i=0; i<20; i++) if ((touchStates[i]==1) && (touchPres[i]==false)) noteOn(0, observe, 127); touchPres[i]=true; if ((touchStates[i]==0) && (touchPres[i]==true)) noteOff(0, observe, 127); touchPres[i]=false; observe++; delay(100);
Conclusions
Effectively, we expect we’ve defined sufficient to organize our musical instrument with contact and to configure it with the intention to acquire the specified sounds; as defined, the undertaking lends itself to a number of embellishments and provides you most freedom of expression by way of sensible implementation and selection of “keyboard”, whereas respecting the principles indicated. The model proposed within the pictures on these pages is a suggestion, however every of you can provide free rein to your creativeness by arranging the plates on the help you contemplate most fitted and shaping the plates as you would like.