back to list

Online Scale Generator v 0.1

🔗Mike Battaglia <battaglia01@...>

9/15/2009 5:15:29 PM

[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

🔗Charles Lucy <lucy@...>

9/15/2009 5:31:06 PM

I have been making good progress with my database of musical scales.

Based on ScaleCoding, meantone patterns and approximations of intervals. i.e. give or take 50 cents;-)

(dependent upon the tuning system chosen).

Although this is a somewhat different concept from how Mike is thinking.

see:

http://www.lucytune.com/scales/

for 2400 unique musical scales and how to sort, categorise, mix, find etc

Available in FileMaker format (with scripting, midi etc.) or as a flat database in .xls.

On 16 Sep 2009, at 01:15, Mike Battaglia wrote:

> [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
>
>
Charles Lucy
lucy@...

- Promoting global harmony through LucyTuning -

for information on LucyTuning go to:
http://www.lucytune.com

For LucyTuned Lullabies go to:
http://www.lullabies.co.uk

🔗Mike Battaglia <battaglia01@...>

9/15/2009 9:35:51 PM

I don't have much of a concept at all. Any scale you come up with can
be put into the applet, just like any scale you come up with can be
put into Scala.

I should have also mentioned that you can input cents value as well,
i.e. {0.0, 350.0, 700.0}.

-Mike

On Tue, Sep 15, 2009 at 8:31 PM, Charles Lucy <lucy@...> wrote:
>
>
>
> I have been making good progress with my database of musical scales.
>
> Based on ScaleCoding, meantone patterns and approximations of intervals. i.e. give or take 50 cents;-)
> (dependent upon the tuning system chosen).
> Although this is a somewhat different concept from how Mike is thinking.
> see:
> http://www.lucytune.com/scales/
> for 2400 unique musical scales and how to sort, categorise, mix, find etc
> Available in FileMaker format (with scripting, midi etc.) or as a flat database in .xls.
>
>
>
> On 16 Sep 2009, at 01:15, Mike Battaglia wrote:
>
> [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
>
> Charles Lucy
> lucy@...
> - Promoting global harmony through LucyTuning -
> for information on LucyTuning go to:
> http://www.lucytune.com
> For LucyTuned Lullabies go to:
> http://www.lullabies.co.uk
>
>
>

🔗Marcel de Velde <m.develde@...>

9/16/2009 3:19:01 AM

Hi Mike,

Some final notes:
> - There are going to be a ton of bugs. Let me know if you find any.
>

Oh wow this a great great idea!! :)
Thank you!

However, I'm sorry to say it doens't work for me.
After I click go i assume i have to click the link that sais "right click me
to save".
If I click it with my left mous button it will direct to me to page
with data:audio/midi;base64, with a long string behind it.
Quicktime tries to play but then gives a question mark, it doesn't know how
to play it.
If I right click the "right click me to save" the option of "store link as"
isn't in my options box.
But after I left click the link and then go back the previous page the save
link as option does appear but it gives me a html page as the file type to
save.

I'm using google chrome as my browser.

-Marcel