[ad_1]
We place metallic foil notes on a panel and play our music by touching them, making a melody from a very authentic instrument.
Those that know a bit about music or have good recollections of the “music training” hours at secondary college (or secondary college, to place it in a contemporary manner), will definitely keep in mind that musical devices are divided into varied classes based mostly on how the roughly erudite musician operates them to provide notes: we now have 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 might fall into this class), pipe devices and so forth. We have now 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 might fall into this class), pipe devices and so forth. All of them have in widespread the truth that they work with out the necessity for contemporary expertise. It’s not by probability that they have been created a few years in the past when electrical energy or electronics have been unknown, and based mostly on quite simple and primordial bodily ideas.
What we want 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 might place amongst these with a keyboard, however which is performed by touching keys (we name them that regardless that they don’t seem to be) 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 now have conceived it as a big panel (Fig. 1) with metallic plates formed like musical notes utilized to it (it’s no coincidence that we now have determined to name it Sound Wall…), however anybody may give the “consumer” interface, and due to this fact the keyboard, the form, and look they like.
Fig. 1
The venture
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 will likely be reproduced) by the use of 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 related will detect the switch of the quantity of electrical cost to our physique and can ship a sign to the Arduino Uno, which, based on the loaded firmware, will command the technology of a sound utilizing the “collaboration” of the FT1414M board from Open Electronics, which we now have already used within the venture.
The breakout board contact is mainly a board for the administration of contact sensors, then to every pin NOTE and SEL we now have related 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 choose. These sound results are the Celesta (or celestial metallophone with hammers), the Carillon and two commonplace MIDI synthesizer sounds that are the FX2 (house weapon sort synthesizer) and the Sci-Fi FX8 (house sound synthesizer).
The breakout board for contact administration relies on Freescale’s MPR121QR2 chip, which is a capacitive contact sensor managed through 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. One among these jumpers connects the ADD pin to the bottom, so the I²C-Bus handle of the chip will likely be 0x5A. Utilizing two breakouts, on the second this jumper ought to 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 ability provide should be between 2.5 and three.6 Vdc, which the Arduino Uno does with its built-in regulator that gives voltage through pins 3V3 and GND.
The sound technology is finished by the Arduino FT1414M defend based mostly 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 numerous 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 system (the microcontroller governing the synthesizer), the VS1053B is used on this defend in serial mode.
The defend takes energy from the Arduino through the 5V pin and the widespread 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 related to a printed circuit jack to which headphones might be related. As well as, the identical output is related 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 through 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 knowledge that’s learn from the corresponding Arduino I²C bus. This occasion causes the Arduino to play the corresponding word, which is generated by driving the VS1053B’s inner MIDI synthesizer through serial, by the technology of a knowledge string on tx0, containing details about the corresponding word. The information 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, but it surely has the particularity of integrating a large-scale sound synthesizer based mostly on VLSI’s proprietary DSP (Digital Sign Processor) (i.e., the VS_DSP). It incorporates code and information reminiscence for the Ogg Vorbis, MP3, AAC, WMA and WAV PCM+ADPCM audio decoding codecs, in addition to a whole commonplace MIDI synthesizer; it communicates with the surface world through 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 shipped to a stereo A/D converter.
Because of software program plug-ins, the chip may 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 utility, 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 wish to strive it.
The musical notes produced are 12 per octave (i.e., the 7 notes plus halftones) and the potential octaves are 11, so the VS1053B covers an especially broad 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 information acquired: as you possibly can see, 128 sounds are potential for every “register” or impact, every recognized by a numerical worth that’s handed from the Arduino to the VS1053B in serial type 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 more in-depth take a look at the guts of our musical instrument, specifically the defend based mostly on VLSI’s VS1053B built-in circuit, which is able to producing a sure variety of musical notes by synthesizing the sounds of numerous 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 system (the microcontroller that controls the
circuit, which in our case is Arduino) additionally in SPI-bus mode. In reality, the VS1053B integrates a serial interface advanced 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 which Arduino provides its instructions, and a knowledge switch interface (SDI=Serial Information Interface) due to which the VS1053B can switch or purchase information streams to or from one other exterior system.
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 through the use of a microphone amplifier as an enter stage (for individuals 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 the serial port used as UART, which within the U1 is related to pins 26 (RX) and 27 (TX), related 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 D4, in order to arrange 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 mandatory, for instance if a distinct type of management is chosen, similar to 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 it’s essential do is write the firmware accordingly.
The defend takes energy from the Arduino through 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 widespread pin 42 (GBUF), which isn’t related to the analog floor, but in addition coupled, just like the sign traces, through R/C networks. The outputs of the U1 audio attain a stereo jack socket on the printed circuit board to which it’s potential to attach headphones since they’re related 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, based mostly on the homonymous built-in amplifier already outfitted with all of the exterior elements it wants and the quantity management potentiometer.
The firmware
Effectively, now that we now have defined what the {hardware} consists of, we will 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 defend.
On the code stage, we will see the “Play” operate, which is the one that permits the word to be performed if finger contact is detected on some “Contact” plate, in flip through the “noteOn” operate. The “checkInterrupt1” and “checkInterrupt2” capabilities are the primary to establish the important thing pressed by the NOTE breakout and the second for the SEL breakout. If a pressed secret’s 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 information supplied 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 word instructions and register or instrument setting instructions: within the first case, it makes the defend execute the corresponding word 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 word of the brand new instrument is performed to establish the change.
Concerning the capabilities, there are mainly 4 completely different devices, though we solely used 4 of them, however they’ll fluctuate 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 now have indicated “SEL” within the wiring diagram:
const int INSTRUMENT1=9;const int
INSTRUMENT2=11;const
int INSTRUMENT3=98;
const int INSTRUMENT4=104.
The devices supplied and set within the sketch are, based on Desk 2 which exhibits this system numbers of financial institution 0 of the midi VS1053B:
– 9 Celesta (or celestial metallophone);
– 11 Carillon;
– 98 FX2 soundtrack (house weapon-type synthesizer);
– 104 Sci-Fi FX8 (house sound synthesizer).
Relying on which metallic plate we contact, we’ll then get hold of 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 completely in these pages, so we present you three extracts which are probably the most vital: Itemizing 1 exhibits 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 information 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 information 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); // Permits 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 information 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 information 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); // Permits all 12 Electrodes set_register(0x5B, ELE_CFG, 0x0C);
In Itemizing 2 you’ll find 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 regarding the management of notes copy by the defend with VS1053B, through which the fixed int word assumes the worth of the word 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) | LSB); //16bits that make up the contact states for (int i=0; i < 12; i++) { // Test what electrodes have been pressed if(touched & (1<<i)) { touchStates[i] = 1; } else { touchStates[i] = 0; } } } 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) | LSB); //16bits that make up the contact states for (int i=0; i < 12; i++) { // Test what electrodes have been pressed if(touched & (1<<i)) { touchStates[i+12] = 1; } else { touchStates[i+12] = 0; } } } for (int i=0; i<24; i++) { Serial.print(touchStates[i]); } Serial.println(); }
Itemizing 3
void Play() { int word=30; for (int i=0; i<20; i++) { if ((touchStates[i]==1) && (touchPres[i]==false)) { noteOn(0, word, 127); touchPres[i]=true; } if ((touchStates[i]==0) && (touchPres[i]==true)) { noteOff(0, word, 127); touchPres[i]=false; } word++; } delay(100); }
Conclusions
Effectively, we expect we now have defined sufficient to arrange our musical instrument with contact and to configure it to be able to get hold of the specified sounds; as defined, the venture lends itself to a number of embellishments and provides you most freedom of expression when it comes to sensible implementation and selection of “keyboard”, whereas respecting the foundations indicated. The model proposed within the pictures on these pages is a suggestion, however every of you may give free rein to your creativeness by arranging the plates on the help you contemplate best suited and shaping the plates as you want.
OpenStore
[ad_2]