I havealloftheseintheGetHubbarddepositorylinkedintothedescriptionofthisvideo, butit's alsoprettyeasytofindthesetypesoffilesonlineanddownloadthemforfreeorevenjustrecordyourown.
Thenextthingweneedtodoisjustgiveit a titlewillcall a piano, andthenwe'regoingtohave a stylesheetaswellas a Javascriptpage.
Sowe'regonnaneedtocomeinhere, andwe'regonnawanttoaddin a linksowe'lljustsaylinkAndthisisgoingtobeforStilesNaziSS, whichwe'regoingtocreateinjust a littlebit.
Andwe'realsogoingtoneed a scripttag, whichisjustgoingtobescriptoutJs.
Nowwehaveblackfallby a whitekeyfallbyBlackie, fullbyweightandblack.
Andthenfinally, ouronelastwakey.
Andasfornewswith D d flat.
Andherewehave e andwehave e footandwehaveour f whichisgoingtogointoour G flatRGare a a flat, sir.
Andthen, eh?
Thenhere, befootandfinallybe.
Andthat's allofourdifferentnotessetupaswellasallofourdifferentclassesfor a differentkeys.
Butinordertoplaythesesounds, weneedtohaveaudiotagsforeachoneofournotefilesherebecauserightnowwecan't accessthesefilesunlesstheirinnerHTMLsowecandojustcreateanaudiotagandhisaudiotechisgoingtohavean i d.
Thisisgoingtomakeitsoit's possibletosendtoourpianointhemiddleandthenalsotodothiscenterandwe'regonnausedisplayflux, justifycontentcenterand a lineitemsinthecenter.
Ifyou'reunfamiliarwithhowfluxboxanddisplayflexworks, I haveanentirevideoonit.
Thenextthingwehaveisourkeyselector, asbullsarewhiteclassandourblackclasshere, and I'm gonnastartwiththewhiteclass, actually, becauseit'llmakeitreallyeasytofigureoutwhatweneedtodoin a blackclassandthenwhatwehavetosharebetweenthemSothefirstthing I wanttodosaidhereis I wanttosetourwithandinourcase, I'm justgonnasetthewithheretobe 100 pixels, andthenwealsoneedtosettheheight.
Andifwesaythat, youcanseeourkeysorshowingup, butthey'respacedoutfromeachother, wewanttheBlackKeystoshowupontopoftheWhiteKeys, and a reallyeasywaytodothatistomakethemarginleftandthemarginright B negativesowecanchangethemarginrighthereandthemarginleft.
Also, wecanchangethismarginleftandmarginrighttobe a calculationwhichtakesintoaccountourwithandwejustwanttodivideitbynegativetoessentially, wewanthalfofourwithandwewantittobenegative.
Wewanttodothiswheneverweclickonthekeyandallwewanttodoisrun a functionwhichisgoingtocall a functioncalledplaynotewithourkey, andwe'regonnacreatethisplaynotefunction.
Soinordertosaveyoutheboredomofwatchingmetypeoutallthesedifferentletters, youcanseewehave a variablewithallofourwhitekeys, andthisisgoingtobeessentiallythebottomrowofyourkeyboard, everysingleletterinit, andthentheBlackKeysisgoingtobetherowabovethat, whichcorrespondwithwheretheseblackkeyswouldalignonthatrowofyourkeyboard.
Andnowallweneedtodoissetup a eventlistenerthat's goingtolistentowhenwepressthesekeysandactuallyallowustoplaythenoteforthekeyThatrepressedsowecandoiswecancomeintohere.
Andnow, if I comeoverhereandholddownthekey, younoticeit's onlygonnaplaythatnoteonce, andit's notgoingtorepeatitoverandoverandoveragain, whichisincrediblyannoying.