Yesterday we set up the MIDI music web application weβve been working on to take the first steps with composing, with HTML/Javascript Music Follow Up Tutorial as shown below, and as you may recall from this the idea that the GET method would cause URLs that are too long for the web browser with any length to your musical composition, and that weβd have to involve the POST method on an HTML form element, perhaps feeding this through to a server-side language like PHP β¦ well, it panned out this involvement of PHP and HTML forms was overkill for βplayingβ these long pieces β¦ for that we could resort to βhiddenβ input text fields β¦ but β¦ yes, thereβs always a but β¦ when we got to wanting to be able to save our compositions, and come back to them for playing or tweaking, or both, we could not avoid the use of a server-side language (for us, this is PHP) and the interface to that server-side language, an HTML form element β¦ basically because how else are you going to be able to save the composition to a file, and then reread that file? You need a language like PHP.
So, here we are, still needing to calibrate the Italian speed words methinks, but otherwise, now, we can (on laptops only, it looks like) β¦
- play a note
- play scales and arpeggios
- play a small tune β¦ and as of today β¦
- play a longer tune
- compose a tune you can play (but youβll need earplugs for our βRhapsody in Puceβ)
- save a composed tune and recall it for playing (where PHP needed)
β¦ but still no match for the complex scenarios sheet music can handle β¦ still, weβre getting there β¦ speaking of which β¦
- See the downloadable HTML and Javascript source code MyScale
html
- See the new downloadable PHP source code MyScale
php
- Try live
run of first few bars of FΓΌr Elise. Thanks to Wikipedia for help.
- Try Composer Mode live
run.
- Try live
run.
- See the downloadable HTML and Javascript source code differences from a day ago via MyScalehtml
Hope you enjoy the ideas. We got ours (with thanks) from β¦
Previous relevant HTML/Javascript Music Follow Up Tutorial is shown below.
We follow up on our HTML/Javascript Music Primer Tutorial as shown below, today, by setting our minds to a βfirst draftβ of a method to construct a tune in MIDI β¦ say βfirst draftβ because, it is often easier on a βfirst draftβ to involve GET parameters with a URL, for ease of testing. This idea is a βfirst draftβ because there are limits with URL lengths allowable this way, and in order to get around more involved examples than todayβs first few bars of FΓΌr Elise (by Beethoven), weβll need a subsequent draft that caters for POST parameters involving, perhaps, an HTML form and maybe calling on server-side PHP work β¦ weβll have to see.
So what can get sorted out with this βfirst draftβ idea? How about sorting out an internal protocol of communication of data? This type of decision is a hugely important part of the design phases of a project. Weβve opted for β¦
- comma separated word list
- special rules for the user regarding these, with respect to β¦
- one β+β sign at start or end signifies two notes are playing at once (during any and all ideas of below)
- rests β¦ via β0β
- volume β¦ via leading β0β value
- note (or rest) length β¦ via negative number (loosely) based on -1 = crotchet
- MIDI note (ie. sound frequency) β¦ via number as the MIDI note code or decimal frequency
- speed β¦ Italian words Largo or Larghetto or Adagio or Andante or Moderato or Allegro or Presto or slowx? or slowby? or fastx? or fastby?
β¦ eg. first few bars of FΓΌr Elise β¦ URL β¦
//www.rjmprogramming.com.au/HTMLCSS/MIDI.js-master/examples/MyScale.html?sheetmusic=largo,slowby3,64,-0.50,63,-0.50,64,-0.50,63,-0.50,64,-0.50,59,-0.50,62,-0.50,60,-0.50,+57,-1.0+,+33,-0.50+,+40,-0.50+,45,-0.50,48,-0.50,52,-0.50,57,-0.50
β¦ and, yes, realize sheet music can cater for much more functionality than above β¦ today is just a start, but feel free to β¦
- See the downloadable HTML and Javascript source code MyScale
html
- Try live
run of first few bars of FΓΌr Elise. Thanks to Wikipedia for help.
- Try live
run.
- See the downloadable HTML and Javascript source code differences from two days ago via MyScalehtml
Hopefully more to come, but, βconsider thisβ.
Previous relevant HTML/Javascript Music Primer Tutorial is shown below.
We discovered some great HTML and Javascript code to help make music with a web application, and for this we want to thank and congratulate mudcube for some really great software.
In addition to that we found at The Glass Armonica a wonderfully useful table to use as a basis for the user to βmake musicβ.
If youβve learnt a musical instrument, you may have self-taught yourself by playing songs, maybe on a guitar, by working out the basic chords, but, here, today, we start the βmusicβ ball rolling with some scales and arpeggios. If it was good enough for J.S. Bach, who are we mere mortals, to complain β¦ whinge, maybe β¦ but never complain. Learning the piano was given this book we just called βHanonβ which did a thorough job of making scale type practice more interesting, but personally, couldnβt wait to get to more melodic music.
Anyway, how do you feel about synthesised music? Guess a lot of people are okay with it, but thereβll be others who βtryβ to avoid it β¦ but think it might be pretty hard to completely avoid it now with so much involvement with computers and such. Maybe we should see some of this history according to Wikipedia, and what it has written regarding synthesiser (and while you are there, read about MIDI).
So the software, in its βinnardsβ will be concerned with calculating sound frequencies β¦ because itβs all about waves man person. If the music is long lasting, maybe a bit like a permanent wave, man person.
If you like, take a look at the HTML and Javascript code you could call MyScalehtml or execute a live
run.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
5 Responses to HTML/Javascript/PHP Compose Music Tutorial