{"id":29672,"date":"2017-04-18T03:01:58","date_gmt":"2017-04-17T17:01:58","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=29672"},"modified":"2017-04-18T17:39:38","modified_gmt":"2017-04-18T07:39:38","slug":"piano-playing-web-application-mobile-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/piano-playing-web-application-mobile-tutorial\/","title":{"rendered":"Piano Playing Web Application Mobile Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.htm?tonic=%20\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Xcode SpriteKit Game Mobile Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano_playing.jpg\" title=\"Xcode SpriteKit Game Mobile Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Piano Playing Web Application Mobile Tutorial<\/p><\/div>\n<p>Our Piano Playing web application has moved on to a &#8220;second draft&#8221;.   Nothing has changed about it using those audio mp3 files from the other day when we presented <a target=_blank title='Xcode SpriteKit Game Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xcode-spritekit-game-primer-tutorial\/'>Xcode SpriteKit Game Primer Tutorial<\/a> to &#8220;reframe&#8221; their use for creating a client based web application featuring &#8230;<\/p>\n<ol>\n<li>simulated piano keys that can be pressed by the user &#8230; and\/or &#8230;<\/li>\n<li>the user can play some scales, arpeggios or chords with a nominated tonic note and in major or minor keys<\/li>\n<li>show a visual &#8220;cue&#8221; just below the piano keys to show the piano key note last played &#8230; we did start out on an <a target=_blank href='https:\/\/www.w3schools.com\/graphics\/svg_intro.asp' title='SVG information from w3schools'>SVG<\/a> type of solution based on the code of <a target=_blank title='Legend for and from HTML Map Element Web Server Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/legend-for-and-from-html-map-element-web-server-tutorial\/'>Legend for and from HTML Map Element Web Server Tutorial<\/a> where &#8220;overlays&#8221; appear in an HTML table &#8220;legend&#8221;, but trying &#8220;overlaying&#8221; in this way caused problems, so today we show our &#8220;visual&#8221; helpers overlaying the border down the bottom of the piano keys comprising &#8230;\n<ul>\n<li>HTML <a target=_blank href='https:\/\/www.w3schools.com\/tags\/tag_div.asp' title='HTML div information from w3schools'>div<\/a> elements &#8230; involving &#8230;<\/li>\n<li>CSS <a target=_blank href='https:\/\/www.w3schools.com\/cssref\/pr_border.asp' title='CSS border information from w3schools'>border<\/a>: 1px solid red; \/\/ initially, and also dynamically controlled &#8230; and with the usual &#8220;overlay&#8221; suspects &#8230;<\/li>\n<li>CSS <a target=_blank href='https:\/\/www.w3schools.com\/cssref\/pr_class_position.asp' title='CSS position:absolute information from w3schools'>position<\/a>:absolute; left: 0; top: 0;<\/li>\n<li>CSS <a target=_blank href='https:\/\/www.w3schools.com\/cssref\/pr_pos_z-index.asp' title='CSS z-index information from w3schools'>z-index<\/a>: 9;<\/li>\n<li>CSS <a target=_blank href='https:\/\/www.w3schools.com\/cssref\/css3_pr_opacity.asp' title='CSS opacity information from w3schools'>opacity<\/a>: 1.0; \/\/ initially, and also dynamically controlled<\/li>\n<\/li>\n<li>iOS mobile users (only) are presented with new HTML <a target=_blank title='HTML audio element information from w3schools' href='https:\/\/www.w3schools.com\/html\/html5_audio.asp'>audio<\/a> elements awaiting user &#8220;click\/touch&#8221; intervention, to make the audio happen, as per Apple requirements on audio media, here<\/li>\n<\/ol>\n<p>So with this second draft we associate audio &#8220;cues&#8221; with &#8220;visual&#8221; ones, and include functionality to cater for the mobile device habit of disallowing automated audio plays, by fitting in with this restriction, but use HTML audio elements, showing their controls, for users to push the Play buttons necessary to satisfy iOS media rules.  For today, as with WordPress 4.1.1&#8217;s <a target=_blank title='Piano Playing Web Application Mobile Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/piano-playing-web-application-mobile-tutorial\/'>Piano Playing Web Application Mobile Tutorial<\/a>, try the piano playing web application (with the HTML and Javascript <a target=_blank title='piano.htm' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.html-GETME'>piano.htm<\/a>), changed in <a target=_blank title='piano.htm' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.html-GETME'>this way<\/a> with respect to that previous &#8220;first draft&#8221;, at this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.htm'>live run<\/a> link (where, again, the C major scale, one octave is played first up), or, live also, below, in an HTML <a target=_blank title='HTML iframe element information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_iframe.asp'>iframe<\/a> &#8230;<\/p>\n<p><iframe style='width:100%;height:800px;' title='Click picture' src='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.htm?tonic=%20'><\/iframe><\/p>\n<p>We hope you like it.  Even with the iOS mobile version, you may find a secondary iOS user with the web application can help out the primary piano practicer, playing along with the scales played on a real piano.<\/p>\n<hr>\n<p id='ppwapt'>Previous relevant <a target=_blank title='Piano Playing Web Application Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/piano-playing-web-application-primer-tutorial\/'>Piano Playing Web Application Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.html?tonic=%20\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Xcode SpriteKit Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pianoplaying.jpg\" title=\"Xcode SpriteKit Game Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Piano Playing Web Application Primer Tutorial<\/p><\/div>\n<p>We hope you enjoy our new &#8220;first draft&#8221; of a Piano Playing web application.  We&#8217;re using those audio mp3 files from the other day when we presented <a target=_blank title='Xcode SpriteKit Game Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xcode-spritekit-game-primer-tutorial\/'>Xcode SpriteKit Game Primer Tutorial<\/a> to &#8220;reframe&#8221; their use for creating a client based web application comprising, essentially &#8230;<\/p>\n<ol>\n<li>audio files, thanks to <a target=_blank title='Useful link, thanks' href='http:\/\/www.caseyrule.com\/projects\/midi\/soundfonts\/FluidR3_GM\/agogo-mp3\/'>useful link<\/a><\/li>\n<li>image of piano, thanks to <a target=_blank title='openclipart' href='http:\/\/openclipart.org'>openclipart<\/a><\/li>\n<li>map tag creation, thanks to <a target=_blank title='mobilefish' href='http:\/\/www.mobilefish.com\/services\/image_map\/image_map.php'>mobilefish<\/a><\/li>\n<li>our Javascript logic to play scales or arpeggios or chords in major and minor keys, for the user&#8217;s listening &#8220;indulgence&#8221;, or perhaps to accompany a user learning the piano<\/li>\n<\/ol>\n<p>This first draft needs more work regarding tying audio &#8220;cues&#8221; with &#8220;visual&#8221; ones, and getting around the mobile device habit of disallowing automated audio plays.  That will be for future postings.  But for today, as with WordPress 4.1.1&#8217;s <a target=_blank title='Piano Playing Web Application Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/piano-playing-web-application-primer-tutorial\/'>Piano Playing Web Application Primer Tutorial<\/a>, try the piano playing web application (with the HTML and Javascript <a target=_blank title='piano.html' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.html_GETME'>piano.html<\/a>) at this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.html'>live run<\/a> link (where the C major scale, one octave is played first up), or, live also, below, in an HTML <a target=_blank title='HTML iframe element information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_iframe.asp'>iframe<\/a>, curiously the technique by which we play the audio files (allowing for a bank of 9 HTML iframe elements be able to play up to 9 notes at the same time, hopefully enough for most future functionality thoughts &#8230; time will tell) &#8230;<\/p>\n<p><iframe style='width:100%;height:800px;' title='Click picture' src='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/piano.html?tonic=%20'><\/iframe><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d29635' onclick='var dv=document.getElementById(\"d29635\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/music\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d29635' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d29672' onclick='var dv=document.getElementById(\"d29672\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/dom\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d29672' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Our Piano Playing web application has moved on to a &#8220;second draft&#8221;. Nothing has changed about it using those audio mp3 files from the other day when we presented Xcode SpriteKit Game Primer Tutorial to &#8220;reframe&#8221; their use for creating &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/piano-playing-web-application-mobile-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15,20,37],"tags":[1531,113,2183,342,354,476,477,576,587,590,626,652,745,795,800,2180,822,1536,876,894,1988,997,1094,1319,1496],"class_list":["post-29672","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-ios","category-tutorials","tag-arpeggio","tag-audio","tag-chord","tag-div","tag-dom","tag-game","tag-games-2","tag-html","tag-iframe","tag-image","tag-ios","tag-javascript","tag-map","tag-mobile","tag-mobilefish","tag-mp3","tag-music-2","tag-note","tag-opacity","tag-overlay","tag-position","tag-programming","tag-scale","tag-tutorial","tag-z-index"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/29672"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=29672"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/29672\/revisions"}],"predecessor-version":[{"id":29702,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/29672\/revisions\/29702"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=29672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=29672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=29672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}