Online Scale Generator v 0.1

14 views
Skip to first unread message

Mike Battaglia

unread,
Sep 15, 2009, 8:15:29 PM9/15/09
to tun...@yahoogroups.com, micro...@googlegroups.com
[cross posted between tuning and microtools]

Hey all,

Someone came up a long time ago with the idea of coming up with an
online scale generator applet to share scales online... I've been
working on just such a thing. It took me a long time, but progress has
completely stalled, so I'm releasing what I have so far. The logical
choice would have been to do this with some kind of PHP backend, but
my programming stubbornness got the best of me, and I decided it was
absolutely necessary that I do the whole thing using client-side
Javascript and data URI's. I got about halfway done before I realized
that IE doesn't support data URI's. D'oh. So for those of you with
firefox or safari, here it is:

http://michaelbattagliamusic.com.leaf.arvixe.com/microscalegen/midigenerator.html

The "michaelbattagliamusic.com.leaf.arvixe.com" domain is temporary
while I get some DNS stuff worked out. I'll repost the new URL when
it's up.

I wanted to come up with a notation that was cross- compatible with
scala SCL format. Consequently, you can copy and past a scala scale
right into the textbox, and it should work provided you leave the
first two checkboxes checked.
- The "Skip the first two lines" box will do exactly what it says,
as the first line in an SCL file is the name, and the second is the
number of scale degrees it contains, which are useless pieces of
information for our purposes here.
- The "put 1/1 in as first scale degree" does exactly what it
sounds like. If your scale is 5/4 3/2, a 1/1 will be inserted before
those as the first degree.
- The "base note" specifies which MIDI note you want 1/1 to be. 60
is middle C.

But wait! There's more! I have also included the ability to play more
than one note at once, albeit with no regard for the duration of the
chord. This extension to the scala scale format works as follows: to
play a chord, place all of the entries on the same line within curly
brackets ("{}"), separated by commas. So to play a I IV V I
progression, the input would look something like this:

{1/1, 5/4, 3/2}
{1/1, 4/3, 5/3}
{9/8, 3/2, 15/8}
{1/2, 3/4, 5/8, 7/8, 9/8, 11/8, 27/16, 17/8}

At least that's how -I- like my final I chords to sound. You might
want to uncheck the "skip the first two lines" and "insert 1/1"
checkboxes if you want to treat it as a chord progression sequencer.

So to a limited extent, we can now express chord ideas progressions
across the web as well as scales, without having to worry about
uploading MP3's or what not. Some of you may find the use of
in-browser MIDI here a bit restrictive, but hey, it works for me. I
don't even want to think about how I'd get OSC working with an app
like this.

One important bug you should know about for those of you with
Quicktime is that sometimes the first chord doesn't play back
automatically when the "Go!" button is clicked. This seems to be a bug
in Quicktime for some versions, but it can easily be fixed by stopping
the MIDI file and restarting from the beginning.

Some final notes:
- There are going to be a ton of bugs. Let me know if you find any.
- This would be better all around if it were server side and we
didn't have to deal with data URI's. The obvious choice for ease of
porting here seems to be either ASP or ASP.NET. Thoughts?
- If for any reason you want to host the page, or more importantly,
reuse some of my code, please send me an email first. Being as the
ASP.NET port is going nowhere, I figured I'd release what I have so
far just so people can use it. Consequently, the javascript source to
the MIDI engine is laid bare for all to see. I'm pretty sure that a
low-level MIDI/SMF implementation in JavaScript has never been done
before, and being as data: URI's are the next big web 2.0 rage, I
might clean the engine up a bit (read: a lot) and release it properly
if I get the time.

AKA, if you want to use my engine, send me an email first! Chances are
I'll let you use it anyway :) (On the other hand, if you're going to
make a multi-billion dollar web app with it, it might be nice if my
student loans weren't so big anymore too).

Happy tuning,
Mike

Reply all
Reply to author
Forward
0 new messages