HTML/Javascript Music Follow Up Tutorial

HTML/Javascript Music Follow Up Tutorial

HTML/Javascript Music Follow Up Tutorial

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 …
    1. one “+” sign at start or end signifies two notes are playing at once (during any and all ideas of below)
    2. rests … via “0”
    3. volume … via leading “0” value
    4. note (or rest) length … via negative number (loosely) based on -1 = crotchet
    5. MIDI note (ie. sound frequency) … via number as the MIDI note code or decimal frequency
    6. 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 …

Hopefully more to come, but, “consider this”.


Previous relevant HTML/Javascript Music Primer Tutorial is shown below.

HTML/Javascript Music Primer Tutorial

HTML/Javascript Music Primer Tutorial

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 MyScale.html 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.

This entry was posted in eLearning, Tutorials and tagged , , , , , , . Bookmark the permalink.

5 Responses to HTML/Javascript Music Follow Up Tutorial

  1. anal kratom says:

    Thank you for writing this tremendous top quality article. The details in this material confirms my point of view and you truly laid it out properly. I could never have written an article this great.

  2. Together with just about every little thing that appears to become creating throughout this specific topic matter, numerous of the points of view occur to become relatively radical. Even so, I am sorry, for the reason that I can not give credence for your complete technique, all be it refreshing none the much less. It looks to me that your remarks are generally not entirely validated and in reality you will be your self not totally convinced of the assertion. In any situation I did appreciate looking at it.

  3. I’d always want to be update on new weblog posts on this internet web site , bookmarked ! .

  4. There is noticeably big dollars to comprehend this. I assume you might have created certain good points in functions also.

  5. But another intelligent weblog! Completely cannot wait for a whole lot a lot more!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>