You are on page 1of 19

Login(/account/login)

| SignUp(/account/gopro?sourcea=header&sourceaUrl=/id/ArduinoXylophone/?ALLSTEPS)
Explore (/tag/typeid/)
Create (/about/submit.jsp)
Contests
Community (/community/)
let's make (/contest/)
(/)
(/)

share what you make >


(/editInstructable/)

(/id/intel/)

(/tag/typeid/categoryworkshop/channelgardening/?sort=FEATURED)
(/tag/typeid/categoryoutside/channelbikes/?sort=FEATURE
(/tag/typeid/categorytechnology/chann

ArduinoXylophone byaudreyobscura(/member/audreyobscura/)
Download(/id/ArduinoXylophone/?download=pdf)

(/id/ArduinoXylophone/)

10Steps
Collection

IMadeit!

Favorite

Share

AboutThisInstructable
75,151views

License:

212favorites
audreyobscura
(/member/audreyobscura/)
audreyObscura.com
(http://www.audreyObscura.com)

(/member/audreyobscura/)
Follow

2653

Bio: iworkatinstructables!imakethings
withtechnology,eatpho,andplayelectric
ukulele.
Morebyaudreyobscura

(/id/GooglyEyeBikini)

(/id/PeachBerryTart)

(http://cdn.instructables.com/FQO/UQAX/H4AGIJOD/FQOUQAXH4AGIJOD.LARGE.jpg)

(/id/SolarPoweredDisco
BikeTrailer)
Tags:
arduino(/tag/typeid/categorytechnology/keyword
arduino/)
xylophone(/tag/typeid/categorytechnology/keyword
xylophone/)
midi(/tag/typeid/categorytechnology/keywordmidi/)
radioshack(/tag/typeid/categorytechnology/keyword
radioshack/)
piezo(/tag/typeid/categorytechnology/keyword
piezo/)
music(/tag/typeid/categorytechnology/keyword
music/)
awesome(/tag/typeid/categorytechnology/keyword
awesome/)

(http://cdn.instructables.com/FE6/E2YJ/H4AG8XHH/FE6E2YJH4AG8XHH.LARGE.jpg)

Related
ArduinoUnoXylophone
(http://www.instructables.com/id/Arduino
UnoXylophone/?
utm_source=base&utm_medium=related
instructables&utm_campaign=related_test)
ArduinoUnoCat
Xylophone
(http://www.instructables.com/id/Arduino
UnoCatXylophone/?
utm_source=base&utm_medium=related
WhatisMIDI?
(http://www.instructables.com/id/What
isMIDI/?
utm_source=base&utm_medium=related

MusicalMIDIShoes
(http://www.instructables.com/id/Musical
MIDIShoes/?
MIDIArduinoDrums
(http://www.instructables.com/id/MIDI
ArduinoDrums/?
utm_source=base&utm_medium=related
instructables&utm_campaign=related_test)
SeeMore(/tag/typeid/?q=)

ImadeaxylophonethatusesanArduinoMegatodetectwhenanoteisstruck,
andgenerateMIDIoutput.ThisprojectiswondefulbecauseIessentiallymadea
xylophone,adrumkit,andanyotherMIDIcontrolledsoundinstrument,withone
tool.ThefollowingstepswilloutlinewhatIusedtomakethisxylophone.

Step1:Youwillneed...

(http://cdn.instructables.com/FXV/JW7Z/H4AG4YEP/FXVJW7ZH4AG4YEP.LARGE.jpg)

(http://cdn.instructables.com/F9I/MYF8/H4AGJ86I/F9IMYF8H4AGJ86I.LARGE.jpg)

(http://cdn.instructables.com/F5N/1GUB/H4AGJ8J3/F5N1GUBH4AGJ8J3.LARGE.jpg)

ToconstructthexylophoneIusedthefollowingpartsfromRadioshack:
(http://cdn.instructables.com/F3C/23B9/H4AGJ8J1/F3C23B9H4AGJ8J1.LARGE.jpg)

(x1)ArduinoMega2560(Radioshack#276127
(http://www.radioshack.com/product/index.jsp?productId=12272877))
(http://cdn.instructables.com/FG2/C1VW/H4AGJ86J/FG2C1VWH4AGJ86J.LARGE.jpg)
(x12)PiezoElement(Radioshack#273073
(http://www.radioshack.com/product/index.jsp?productId=2062402))
(x12)1MOhmresistors(Radioshack#2711356

(http://www.radioshack.com/product/index.jsp?productId=2062351))
(x1)SingleCorewire(Radioshack#2781221
(http://www.radioshack.com/product/index.jsp?productId=2049742))
(x1)PrintedCircuitBoard(Radioshack#276170
(http://www.radioshack.com/product/index.jsp?productId=2102846))
(x1)USB2.0Cord(Radioshack#26714
(http://cdn.instructables.com/F0K/77N4/H4AGJFJL/F0K77N4H4AGJFJL.LARGE.jpg)
(http://www.radioshack.com/product/index.jsp?
productId=2103977&clickid=prod_cs#))
(misc)ElectricalTape(Radioshack#642373
(http://www.radioshack.com/product/index.jsp?productId=2103347))
(misc)Heatshrink(Radioshack#55048444
(http://www.radioshack.com/product/index.jsp?productId=12656262))
Thehousingforthexylophonewaseasytobuild.Iused:
1/4"plywood
1/8"acrylicsheeting
woodglue
1/4"vinyltubing
11/2"longmachinescrews.
2"maskingtape
Tools:
lasercutter
scissors
cottonswabs
smallflatheadscrewdriver

Step2:FreethePiezos,thensolderlongerleads.

(http://cdn.instructables.com/F9I/MYF8/H4AGJ86I/F9IMYF8H4AGJ86I.LARGE.jpg)

(http://cdn.instructables.com/FNF/FZYJ/H4AGJ86L/FNFFZYJH4AGJ86L.LARGE.jpg)

Forthisproject,Iusedpiezoelementstodetectwheneachnoteisstruckonthe
xylophone.Thesepiezosdetectvibration,oraknock.Oftentheelementscome
inahousing,toprotectthediscfrombeingbentorsmashedbutforthisproject
Ineededtoremovethemfromtheirplastic.
(http://cdn.instructables.com/FKS/2BM0/H4AGICHE/FKS2BM0H4AGICHE.LARGE.jpg)

Bygentlypressingaroundtheedgeswithmyfingers,youcouldheartheglue
crackapartfromtheplastic,Iloosenedthebottomofthecasing.Carefully,I
instertedaprecisionflatheadscrewdriver,andpoppedthebottomofthecase
off.
Thepiezoelementcouldthenberemovedfromtheoutsideofthehousing.
(http://cdn.instructables.com/F4V/6S8M/H4AGI66K/F4V6S8MH4AGI66K.LARGE.jpg)
BecauseIamusinganArduinoMegaBoard,Icouldhaveupto16Analog

inputs,or16Piezos.Idecidedtojustincludeanoctave&ahalf,12notes,soI
used12piezos.
Aftertheywerefreefromtheircase,Isolderedlongerwirestoeachpiezo
element,topreparethemtobeinsertedintothexylophone.WhenIwasdone
solderinglongerleadsontoeachpiezo,Iwrappedmysolderpointswithheat
shrinkorelectricaltape.

Step3:TheBarsandHousing.

(http://cdn.instructables.com/FY3/5J2H/H4AGDAKM/FY35J2HH4AGDAKM.LARGE.jpg)

(http://cdn.instructables.com/FNB/78PM/H4AGJ3RY/FNB78PMH4AGJ3RY.LARGE.jpg)

(http://cdn.instructables.com/FXU/ITUO/H4AG8UDO/FXUITUOH4AG8UDO.LARGE.jpg)
(http://cdn.instructables.com/FDL/7S03/H4AGIJW4/FDL7S03H4AGIJW4.LARGE.jpg)

IusedCorelDrawtodraftvectorfilesthatwouldguidethelasercutterforthe
housingandbarsofthexylophone.
Theacrylicbarswereeach10x2inches.Eachbarhastwoholesinthemthat
(http://cdn.instructables.com/F47/TFY8/H4AGJFKP/F47TFY8H4AGJFKP.LARGE.jpg)
willguideamachinescrewthroughthebar,andmounttothetoppanelofthe
woodenhousing.
ThewoodenhousingIdesignedis10.5x30x3inches.Itformsashallowboxthat
supportstheelectronicsembeddedwithinit.Iusedwoodglueandacottonswab
tosecureallofthecorners,andallowed24hourstocurebeforeIsandeddown
alloftheedges.
(http://cdn.instructables.com/FCK/A78A/H4DXIT0M/FCKA78AH4DXIT0M.LARGE.jpg)
TheCorelDrawfileforthebasehousingisattachedtothisstep.

xylophone.cdr

(/files/orig/FA7/95XS/H4AGJ93P/FA795XSH4AGJ93P.cdr)16KB

Step4:AttachthePiezostotheBars

(http://cdn.instructables.com/FRZ/4X9G/H4AG8W47/FRZ4X9GH4AG8W47.LARGE.jpg)

(http://cdn.instructables.com/FLU/JFWG/H4AG8UDN/FLUJFWGH4AG8UDN.LARGE.jpg)

(http://cdn.instructables.com/F72/6X9U/H4AG4YES/F726X9UH4AG4YES.LARGE.jpg)

IthreadedthePiezowiresthroughthemiddleholesinthetoppanelofthe
(http://cdn.instructables.com/F99/STGV/H4AG8UDP/F99STGVH4AG8UDP.LARGE.jpg)
housing.Then,Icenteredthepiezoelementoneachacrylicbar,andused2
inchbluemaskingtapetoadherethepiezotothebar.
(http://cdn.instructables.com/FBE/6JD5/H4AGDAKL/FBE6JD5H4AGDAKL.LARGE.jpg)

Step5:AttachtheBarstothetopPanel.
(http://cdn.instructables.com/F9N/TVNQ/H4AG8W4E/F9NTVNQH4AG8W4E.LARGE.jpg)

(http://cdn.instructables.com/FJS/QZY5/H4AGJ3RW/FJSQZY5H4AGJ3RW.LARGE.jpg)

(http://cdn.instructables.com/FX8/FOO5/H4B2N8VG/FX8FOO5H4B2N8VG.LARGE.jpg)

(http://cdn.instructables.com/FQC/SFG1/H4AGI66H/FQCSFG1H4AGI66H.LARGE.jpg)

Iused11/2"machinescrewsandnutstosecurethebarstothewooden
paneling.
Topreventexcessiveshakeorvibrationoneachbar,Idecidedtousevinyl
tubingasashockabsorberoneachmachinescrew.With12bars,Iused24
machinescrewsandnuts,and243/4"lengthsofvinyltubing.Threadthe
machinescrewthroughthebar,thenthevinyl,andslipitintothepaneling.
(http://cdn.instructables.com/FY5/RMWM/H4AFS68E/FY5RMWMH4AFS68E.LARGE.jpg)
Whenthescrewwasthroughthepanel,Iwasabletotwistonthenuttofully
secureittothepanel.
Alloftheseshouldonlybefingertight,toavoidstressonthepaneling,oronthe
bar.

Step6:Buildthecircuit.

(http://cdn.instructables.com/FB6/VMRG/H4AGICO1/FB6VMRGH4AGICO1.LARGE.jpg)

(http://cdn.instructables.com/F2C/9VZ1/H4B2N8VF/F2C9VZ1H4B2N8VF.LARGE.jpg)

(http://cdn.instructables.com/FXR/9Y4D/H4AGJ3RU/FXR9Y4DH4AGJ3RU.LARGE.jpg)

(http://cdn.instructables.com/FQT/THOY/H4B2N8VE/FQTTHOYH4B2N8VE.LARGE.jpg)

(http://cdn.instructables.com/FKE/HKRM/H4B2N8VB/FKEHKRMH4B2N8VB.LARGE.jpg)

(http://cdn.instructables.com/FJW/04UK/H4B2N8VC/FJW04UKH4B2N8VC.LARGE.jpg)

(http://cdn.instructables.com/F9F/59XL/H4AFS68D/F9F59XLH4AFS68D.LARGE.jpg)

(http://cdn.instructables.com/FY3/GKU5/H4AGJ3MT/FY3GKU5H4AGJ3MT.LARGE.jpg)

BeforeconnectingthepiezostotheArduino,Iconnecteda1megohmresistorin
paralleltothePiezoelementtolimitthevoltageandcurrentproducedbythe
piezo,andtoprotecttheanaloginputportsontheArduino.OnthePCB,I
markedwithapermanentmarkerwhichpiezogoestoeachanaloginputporton
theArduino.Ialsomadethesamemarkingsonthebackofthetopwooden
panel.
AfterIsolderedtheresistorsintoplace,Iranasmalljumperwirefromoneend
oftheresistor,tothelongestrailonthePCB,anddesignateditmygroundrail.
Next,Isolderedallofthepiezos'groundwiresintoplace,inlinewtihthesame
endofeachgroundedresistor.Thepositiveleadfromthepiezosissolderedin
tothesamerailastheotherendofeachresistor.
Icut12lengthsofgreenwiretobemy"signalwire"totheArduino.Eachsignal
wireissolderedintothesamepositiveresistedrailofthepiezo.

Thefritzing(http://fritzing.org/)diagramfileisattachedtothisstep.

Step7:ConnectingtotheArduino

(http://cdn.instructables.com/FXK/8UWG/H4AGI66A/FXK8UWGH4AGI66A.LARGE.jpg)

(http://cdn.instructables.com/FKE/HKRM/H4B2N8VB/FKEHKRMH4B2N8VB.LARGE.jpg)

Itookallofthesignalwires,andthegroundwirerunningfromthePCBand
markedeachonewithbluemaskingtape,writingwhichporteachwirewas
designatedto.Ithenfedallofthemarkedsinglecorewireintothe
correspondingportsoftheArduino.
AllremainingAnalogportsmustbegrounded!Otherwiseitwillaffectyourserial
outputfromthearduino.Iused4blackwires,runningfromthegroundrailofthe
(http://cdn.instructables.com/F0B/DB18/H4AGIJOF/F0BDB18H4AGIJOF.LARGE.jpg)
PCBdirectlytotheopenanalogportsoftheMegaboard.(A12,A13,A14,and
A15)
Whenyouhavecompletedyourcircuit,youcanloadthexylophoneprogram,or
sketch,ontotheArduinoboardfromtheArduinoDevelopingEnvironment
(http://arduino.cc/en/Main/Software).
HereisthesketchIused.
}
}
//*******************************************************************************************************************
//TransmitMIDIMessage
//*******************************************************************************************************************
voidMIDI_TX(byteMESSAGE,bytePITCH,byteVELOCITY)
{
status1=MESSAGE+midichannel
Serial.write(status1)
Serial.write(PITCH)
Serial.write(VELOCITY)
}

Step8:Powerandcommunication.

(http://cdn.instructables.com/FNH/V66S/H4AFZHFF/FNHV66SH4AFZHFF.LARGE.jpg)

(http://cdn.instructables.com/F9V/9LS4/H4AFSEU2/F9V9LS4H4AFSEU2.LARGE.jpg)

(http://cdn.instructables.com/FPA/OTDZ/H4AGDGVF/FPAOTDZH4AGDGVF.LARGE.jpg)

TheArduinocanbepoweredviaUSB,whichdoublesasacommunicationport.I
ranaUSBcablethroughthehousingofthexylophone.Bydrillingasmallhole,
thatwasbigenoughfortheendsofthecable,IcouldhidemostoftheUSBcord
48,676Views
inthehousing.
5
10
Instructables Collections
Idrilledasecondholetoholdmymallots.

14Favorited

(http://cdn.instructables.com/FKY/UPXP/H4AFSEU6/FKYUPXPH4AFSEU6.LARGE.jpg)
anouskadg

(/member/anouskadg/)
JoinedMay9th2014

Step9:SerialtoMidi

Follow

78

Message
recipientId=MU3GIGMHUY49V1N&linkTo=/member/anouskadg/)

(http://cdn.instructables.com/FNJ/WA5C/H4AGIEMZ/FNJWA5CH4AGIEMZ.LARGE.jpg)

TogetthexylophonecoupledwithmycomptuerIusedsoftwarecalledHairless
(http://projectgus.github.com/hairlessmidiserial/).Itconvertstheserialoutsignal
fromtheArduinointoaMIDIsignalthatprogramslikeGarageBand,Logic,and
Abletoncanreadandrecord.Besurethatthebridgeisrunningbeforeyoutry
andimportMIDIdatafromthexylophone.
Note:DisablethebridgewhiletryingtoupdatethesketchontheArduinoboard.
Youcannothavethebridgerunningwhiletryingtocommunicatetotheboard
fromtheArduinosoftware.

Step10:Jamit!

(http://cdn.instructables.com/FY6/CQ37/H4AFSEU7/FY6CQ37H4AFSEU7.LARGE.jpg)

(http://cdn.instructables.com/FID/3E63/H4AGIEN3/FID3E63H4AGIEN3.LARGE.jpg)

Afteryouareupandrunning,youcanplaythexylophonelikedrums.Record
yourbeattrack.ThenkickchangetheMIDIinstrumenttoabasssynth,and

recordarhythmtrack.Finallyturnitbackintoaxylophoneandcreateamelody
trackforthebestsongever.Thisthingisalotoffun!

Wehaveabenicecommentpolicy.
Pleasebepositiveandconstructive.

IMadeit!

AddImages

sonicmanipulator(/member/sonicmanipulator/)

MakeComment

8daysago

Reply

Hi.......IthoughtthesketchwouldbeperfectformydrumpadsbutwhenI
(/member/sonicmanipulator/)
compiledititsaidthissketch_Piezo1.ino:11:64:error:toomanyinitializersfor

'char[6]'
Errorcompiling.
MmmmmmI'manewbesonotsurehowtofix.
Claude

anouskadg(/member/anouskadg/) sonicmanipulator

4daysago

Reply

Change'charpinAssignments[6]'atthetopofthecodeto'char
(/member/anouskadg/)
pinAssignments[16]'andit'llwork)

RichusLV(/member/RichusLV/)

5daysago

Reply

13daysago

Reply

1yearago

Reply

Isitpossibletogetonlyonenoteforeachpiezo?
(/member/RichusLV/)

blackcamo(/member/blackcamo/)

arduinoeducationalFUN!anditischeapaschipsnow...
(/member/blackcamo/)

https://sites.google.com/site/arduinouk/

lpeavey(/member/lpeavey/)

MustyouusetheexactpiezoelementsfromRadioshack?Willanypiezo
elementswork?
(/member/lpeavey/)

massodax(/member/massodax/) lpeavey

2monthsago

Reply

thereisplentyof"readytouse"projectpiezoelementsforthisproject)
(/member/massodax/)
http://www.ebay.com/sch/i.html_odkw=10PCS+Piezo+El...

(http://www.ebay.com/sch/i.html_odkw=10PCS+Piezo+Elements+Sounder+Sensor+Trigger+Drum+Disc&_from=R40%7CR40&_osaca
butcarefullymakeachoiceofthesizewhatyouneed

NarWhaLs15(/member/NarWhaLs15/) lpeavey

1yearago

Reply

Youdon'tneedtousethePiezoelementsfromRadioshack(Ihope).
(/member/NarWhaLs15/)
HerearetheonesfromSparkfun:

https://www.sparkfun.com/products/10293
(https://www.sparkfun.com/products/10293)
Hopethishelped!

jeff.evans.5855(/member/jeff.evans.5855/)

(/member/jeff.evans.5855/)

7monthsago

Reply

ThisiswhatI'mlookingfor.IhaveaKorgNanoKeycontrollerthatIusenowto
inputnotesintomyFinalemusiccompositionprogram.ItusesUSBalso.Beinga
percussionist,Iaminterestedinbuildingamidi"marimba"toinputnotes.
Iseethatyouhaveused12notesinyourproject.Iwouldliketomakea25note,2
octavechromatic(bothnaturalsandaccidentals)instrumenttousewhen
composing.
IknowtheArduinoMegahas16inputs.WouldIneedamultiplextoaccommodate
allthekeys?Also,whatwouldthecodebetoaddmorenotes,including
accidentals?Coulditbesosimpletoconnectthepiezofromeachbartothe
correspondingkeysonthecontrollerthatIalreadyhave?Anysuggestionsor
pointerswouldbeveryappreciated.Thanks.

joeyjerry(/member/joeyjerry/)

9monthsago

Reply

arethesepadsvelocitysensitive?
(/member/joeyjerry/)

Anddowehavetomakeanychangeswhenwearemakingadrumkitinthis
way?

carter714(/member/carter714/)

10monthsago

Reply

MysonandImadethisprojecttogether.Wehadahardtimegettingthe
(/member/carter714/)
properresponsefromthenotekeys.Whenwewatchedthekeyboardviewin

Garagebandwenoticedafewdifferentnotesweresometimesplayingwhen
westruckonlyonekey.Weisolatedtheproblemtovibration.Wereplacedthe
vinyltubingwithrubberandfeltpadswithathroughholedrilledintothem.This
isolatedonlythenotewewantedtoplay.
Wehadtochangethecodeabittogetall12keystoplay.Idonotknowwhy
thechangesworkedsincethiswasourfirstproject,butwestudiedothercode
andexperimenteduntileverythingworkedasexpected.
Thisisagreatproject,fun,interesting,challenging,andweendedupwiththis
reallycooldevicethatcanbeeasilyswitchedtoproduceawiderangeof
instrumentsoundsastheoriginalauthorexplained.
Thefewlinesofcodewemodifiedwereasfollows:
WechangedthepinAssignmentsto[12].Infactweswitchedallarraysto[12].
WechangedthecharpinAssignmentstoanintfunction.
WeremovedallsinglequotesfromthepinAssignments[12]={A0,A1,...n}
ChangedPadCutOffvaluesto40
ChangedMaxPlaytimevaluesto70
Changedbytestatus1tobytestatus
Sethitavg=127
Weusedanoteoffvalueof128insteadofthenoteonwithvelocity0inthe
MIDI_TX(128,PadNote[pin],0)
AndintheTransmitMIDIsectionwechangedthestatus1statementtostatus.
Again,Idonotknowifthesewererequiredtomakeourprojectworkorwhyit
madeitwork,butitdidandwewantedtoshareandtelleveryonethatthisisa
greatprojecttobuild.

(http://cdn.instructables.com/F1F/SVD0/HVS19M7Y/F1FSVD0HVS19M7Y.LARGE.jpg)

audreyobscura(/member/audreyobscura/)(author) carter714
10monthsago

SoAWESOME!Sogladitworked<3it'spretty
(/member/audreyobscura/)
fun.Iamintheprocessofoverhaulingthis
projectbasedonthecodesuggestionsmadeon
thiscommentthread.Ireallyappreciatesuchan
awesomecommunity,itswonderfulthatthislittle
projecthasbecomesocollaborative:D

johnb28(/member/johnb28/)

Reply

1yearago

Reply

Higuys.Imadesomeprogressonthis.ButIcan'tseemtofigureoutwhymy
piezosandspittingoutallkindsofwackydata.hereissomethedebugMIDI
(/member/johnb28/)
messagesfromtheHairlessMIDIbridgeapplication.
Thisisallfromsuccessivestriesofthesamexylophonekey.Iwouldthinit
shouldalwaysbeputtingoutthesamenotenumberjustwithdiffering
velocities.Iseemtobegettingallkindaofnotesandaskpitchbending
information,whichmakesforwackysoundsinmyaudioprogram(Logic).Any
ideas?Ihaveithookeduplikeinstructed..
john

(http://cdn.instructables.com/F0D/YQ4K/HTCNIUTS/F0DYQ4KHTCNIUTS.LARGE.jpg)

cchisholm1(/member/cchisholm1/) johnb28

11monthsago

Reply

IwashavingasimilarproblemtoyoursandthisiswhatIdidtogetit
(/member/cchisholm1/)
working.

HeyGuys!Ijustfinishedthisproject.Fewthingstoconsiderforthose
ofyouhavingproblems.
First:youneedtomakesurethatyourpinsareinitializedas"int"NOT
"char"otherwiseyoumightonlyhaveafewofyourkeyswork.
Second:makesurethebaudnumber/serialportnumberissetto
115200bothinthecodeandinyourserialtoMIDIconverter.Iused
HairlesssoitshouldbeunderFile>Preferences
Third:(onlyappliestoAbletonandWindowsusersusers)Makesure
thatyouuseloopMIDItocreateavirtualMIDIportandthatserialto
MIDIconverter(Hairless)issetsothattheMIDIOutisloopMIDIPort
andMIDIInissettoloopMIDIPort.FromtheregointoAbletonandset
theControlSurfaceto"None"andInputasloopMIDIPortandOutput
asloopMIDIPort..
Hopethishelps!!
Thisisasuperfunproject

audreyobscura(/member/audreyobscura/)(author) johnb28
1yearago

Reply

11monthsago

Reply

Huh....thatsanewone.Iwonderifboostingthe
(/member/audreyobscura/)
resistorswouldcurbthat.ordon'tqualify4ofthe
Analoginsinthebeginningofthesketchsotryit
withA0A11foryourinputs?

cchisholm1(/member/cchisholm1/)madeit!
(/member/cchisholm1/)

HeyGuys!Ijustfinishedthisproject.Fewthingstoconsiderforthoseofyou
havingproblems.
First:youneedtomakesurethatyourpinsareinitializedas"int"NOT"char"
otherwiseyoumightonlyhaveafewofyourkeyswork.
Second:makesurethebaudnumber/serialportnumberissetto115200both
inthecodeandinyourserialtoMIDIconverter.IusedHairlesssoitshouldbe
underFile>Preferences
Third:(onlyappliestoAbletonandWindowsusersusers)Makesurethatyou
useloopMIDItocreateavirtualMIDIportandthatserialtoMIDIconverter
(Hairless)issetsothattheMIDIOutisloopMIDIPortandMIDIInissetto
loopMIDIPort.FromtheregointoAbletonandsettheControlSurfaceto
"None"andInputasloopMIDIPortandOutputasloopMIDIPort..
Hopethishelps!!
Thisisasuperfunproject

(http://cdn.instructables.com/F90/W8G9/HU77OAW5/F90W8G9HU77OAW5.LARGE.jpg)

johnb28(/member/johnb28/)

1yearago

Reply

Onemorething..Ithinktherewasasmalltypointhecode...Icouldonlygetit
(/member/johnb28/)
toworkwhenIusedthisinsteadofthelinethatwasinthere:char

pinAssignments[16]={

audreyobscura(/member/audreyobscura/)(author) johnb28
1yearago

Awesome!Thereverywellcouldbedoyoumind
emailingmeyourfinished.inofile?
(/member/audreyobscura/)
audrey@instructables.com

Reply

Irecentlytriedtorevivethisprojectinadifferent
formandranintosomestrangebehavior.Ithoughtit
wasbecauseIwastryingtouseanarduino
micro......
Thanks!
Audrey

johnb28(/member/johnb28/) audreyobscura

1yearago

Reply

HiAudrey.
(/member/johnb28/)

thiscodebelowseemstowork.theonlyissueImhavingnowisthat
whenIstrike,itseemstotriggermultiplenotes.notsureifitsbecause
ofexcessivevibrationorthecode...TheattachedpictureiswhatIget
fromhittingittwice,soinsteadofhearingcleartones,Imhearinga
combinationofxylophonetonesinLogic.Didyoueverhavethat
problem?
Gettingclose!
intpinRead
charpinAssignments[16]={
'A0','A1','A2','A3','A4','A5','A6','A7','A8','A9','A10','A11','A12','A13','A14','A15'}
bytePadNote[16]={
57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72}//MIDInotesfrom
0to127(MidC=60)
intPadCutOff[16]=
{
100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100}
//MinimumAnalogvaluetocauseadrumhit
intMaxPlayTime[16]={
90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90}//Cyclesbeforea
2ndhitisallowed
#definemidichannel1//MIDIchannelfrom0to15(+1in"realworld")
booleanVelocityFlag=true//VelocityON(true)orOFF(false)
//*******************************************************************************************************************
//InternalUseVariables
//*******************************************************************************************************************
booleanactivePad[16]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}//Arrayofflagsofpadcurrentlyplaying
intPinPlayTime[16]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}//Countersincepadstartedtoplay
bytestatus1
intpin=0
inthitavg=0

//*******************************************************************************************************************
//Setup
//*******************************************************************************************************************
voidsetup()
{
Serial.begin(115200)
}
//*******************************************************************************************************************
//MainProgram
//*******************************************************************************************************************
voidloop()
{
for(intpin=0pin<16pin++)//
{
//intpin=3
//for(pinRead=0pinRead<16,pin++){
hitavg=analogRead(pinAssignments[pin])
//Serial.println(hitavg)
//readtheinputpin
if((hitavg>PadCutOff[pin]))
{
if((activePad[pin]==false))
{
if(VelocityFlag==true)
{
//hitavg=127/((1023PadCutOff[pin])/(hitavgPadCutOff[pin]))//
Withfullrange(Toosensitive?)
hitavg=(hitavg/8)1//Upperrange
}
else
{
hitavg=127
}
MIDI_TX(144,PadNote[pin],hitavg)//noteon
PinPlayTime[pin]=0
activePad[pin]=true
}
else
{
PinPlayTime[pin]=PinPlayTime[pin]+1
}
}
elseif((activePad[pin]==true))
{
PinPlayTime[pin]=PinPlayTime[pin]+1
if(PinPlayTime[pin]>MaxPlayTime[pin])
{
activePad[pin]=false
MIDI_TX(144,PadNote[pin],0)
}
}
}
}
//*******************************************************************************************************************

//TransmitMIDIMessage
//*******************************************************************************************************************
voidMIDI_TX(byteMESSAGE,bytePITCH,byteVELOCITY)
{
status1=MESSAGE+midichannel
Serial.write(status1)
Serial.write(PITCH)
Serial.write(VELOCITY)
}

(http://cdn.instructables.com/F9I/LNNQ/HTD7SONA/F9ILNNQHTD7SONA.LARGE.jpg)

(http://cdn.instructables.com/FCV/JNE6/HTD7SOOG/FCVJNE6HTD7SOOG.LARGE.jpg)

johnb28(/member/johnb28/)

1yearago

Reply

Hi.Greatproject.OnethingIdpointoutthatIoverlookedistheoversizedtabs
(/member/johnb28/)
onthecase.Iknowyoumadeyourswithwoodanditindicatesyoursanded

themdown.Imayhavemissedthatimportantpoint.Iwentandhadsome
plexiglasslasercutwiththe.cdrfileyouattachednotrealizingthat.So,
everythingfitstogetherbutobviouslythetabsextendlongerthantheyneedto.
Andthismaterialdoesntsandaseasilyaswood.Justsomethingtoconsider.

phisitja(/member/phisitja/)

1yearago

Reply

1yearago

Reply

thankyouforyourinformationanddetailproject.
(/member/phisitja/)

Kosmo2(/member/Kosmo2/)

WecantbuyradioShackpartsinCanada,canyourecommendanequivelant
PiezoElementthatwecouldmaybepickupelsewhere?
(/member/Kosmo2/)
Thanks
Mick

brassclams(/member/brassclams/)

2yearsago

Reply

IsitpossibletouseanArduinoUno?Sorry,Ihaven'treadthroughyourtutorial
yetmaybeyouexplaintherewhytheMegaisnecessary.
(/member/brassclams/)
Robert

bricabracwizard(/member/bricabracwizard/) brassclams
2yearsago

Reply

Simpson_jr(/member/Simpson_jr/) bricabracwizard

Reply

Thisuses16outputpins,UNOhas14soyoucould
makeaxylophonewith14notesinsteadof16.
(/member/bricabracwizard/)

1yearago

Notexactlytrue,thisusesalotof_analoginput_pinsandtheUnoonly
got6ofthose.Thecompiledcodedoesconsumelessthen5KB
(/member/Simpson_jr/)
though,withsomecreativeprogrammingandanalogmultiplexerslike
the4051or4067anUnoorevenoldest8KBarduinowouldbeupto
thetask.

dBange(/member/dBange/)

1yearago

Reply

2yearsago

Reply

Nice!!!I'lltrytodothis:D
(/member/dBange/)

agomes6(/member/agomes6/)

Ijustcitedthishere:http://www.instructables.com/id/SimonGameXylophone
Version/
(/member/agomes6/)
Hopesomeonemergesthem:)

mmorlan62(/member/mmorlan62/)

2yearsago

Reply

Iloveaprojectwithatoollistthatstartswith"lasercutter."I'lljustpickthatup
atthelocalHomeDepot.:)
(/member/mmorlan62/)
Thanksforsharingtheproject.

LoveDrums(/member/LoveDrums/)

2yearsago

Reply

2yearsago

Reply

That'stremendous!
(/member/LoveDrums/)

dworki(/member/dworki/)

if(VelocityFlag==true)...:D...IstillrememberateacherLOLingatme
lookingatsimilarcodeIwrote...whataboutif(velocityFlag)...orif
(/member/dworki/)
(velocityEnabled)...makesthecodecleaner.
Butotherwiseilikethisinstructable.Niceidea.

zvizvi(/member/zvizvi/)

2yearsago

Reply

Veryneat!greati'ble,clearandsuperfun
Incaseyoudon'twanttosourceaMegajustforthoseextraanalogins,I'd
(/member/zvizvi/)
considerusinga4051multiplexer
(http://www.arduino.cc/playground/learning/4051)

neoroman(/member/neoroman/)

2yearsago

Reply

2yearsago

Reply

Wowgreat...!Iwanttomakeitformydaughter.
(/member/neoroman/)

naturalist71261(/member/naturalist71261/)

Groovyidea,nicecleanjobtoo!I'llbetthatyourfatherisproudofyou!
(/member/naturalist71261/)

fjordcarver(/member/fjordcarver/)

2yearsago

Reply

2yearsago

Reply

Huzzah!Beautiful.Thanksforthis!
(/member/fjordcarver/)

janw(/member/janw/)

Awesomeproject!
(/member/janw/)

Asatrainedmusicalinstrumentbuilder,Icanonlylookatitandloveit
instantly.ItwouldbeevennicerifithadthetypicalshapeofaXylophone
wherethehighernoteshavesmallerbarsthanthelowerones.
MaybeyoushouldcallitanAcrylophoneasxylophonecomesfromtheGreek
xyloswhatmeanswood.

elhobe(/member/elhobe/)

2yearsago

Reply

it'safantasticproject!playnotesviamidiwithamanualinputiscoolandfun!
(/member/elhobe/)

Thank'sforsharing:)

agomes6(/member/agomes6/)

2yearsago

Reply

IlikethissomuchthatIwillgiveitatryinasmallerscale3Dprintedversion
withdiginputsforstandardarduinousage....willkeepyouposted!!!
(/member/agomes6/)
Congratsthough,keepthemcoming:)

mamalove(/member/mamalove/)

2yearsago

Reply

2yearsago

Reply

BEYONDSUPER!
(/member/mamalove/)

PenolopyBulnick(/member/Penolopy+Bulnick/)

Thatisawesome!Ididn'tknowyouweredone.Itlooksgreat:D
(/member/Penolopy+Bulnick/)

Wehaveabenicecommentpolicy.
Pleasebepositiveandconstructive.

IMadeit!

AboutUs

AddImages

MakeComment

FindUs

WhoWeAre(/about/)

Facebook(http://www.facebook.com/instructables)

Advertise(/advertise/)

Youtube(http://www.youtube.com/user/instructablestv)

Contact(/about/contact.jsp)

Twitter(http://www.twitter.com/instructables)

Jobs(/community/PositionsavailableatInstructables/)
Help(/id/howtowriteagreatinstructable/)

Pinterest(http://www.pinterest.com/instructables)
Google+(https://plus.google.com/+instructables)
Tumblr(http://instructables.tumblr.com)

Resources

Mobile

ForTeachers(/teachers/)

DownloadournewappsforiOS,

ArtistsinResidence(http://www.autodesk.com/artistinresidence/home)
Join!
Join our newsletter: enteremail
GiftProAccount(/account/give?sourcea=footer)

AndroidandWindows8!

Forums(/community/)
Answers(/tag/typequestion/?sort=RECENT)
TermsofService(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |
Sitemap(/sitemap/)
PrivacyStatement(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |

Android
(https://play.google.com/store/apps/details?
id=com.adsk.instructables)

LegalNotices&Trademarks(http://usa.autodesk.com/legalnoticestrademarks/) | MobileSite(http://m.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2015Autodesk,Inc.

GoProToday(/account/gopro?sourcea=footer)

We'reHiring!(/community/PositionsavailableatInstructables/)

English

iOS
(https://itunes.apple.com/app/instructables/id586765571)
Windows
(http://apps.microsoft.com/windows/en
us/app/7afc8194c771441a9590
54250d6a8300)

You might also like