iGetIt! Music

Online music education courseware for non-musicians who want to learn how to write their own rock songs.

My Photo
Name: Jim Plamondon
Location: Austin, Texas, United States

This blog documents the development of JIMS iGetIt! Music System (JIMS). JIMS' goal is to help you Understand Music in 24 Hours™, if you are (a) a non-musician (b) who wants to learn how to write your own rock songs. Requiring no instrument other than your own computer, and without using traditional notation, JIMS is being designed to deliver a deep understanding of tonal structure...in just 24 hours.

Thursday, December 10, 2009

Sound synthesis solution...for now

Here's a new version of SoundTest that sounds much better (source code here):

The difference is that this new version calls sound-generating code from a beta version of the SonoFlash library. Assuming that this library will be offered at a reasonable price once it is released in final form, I expect to use it for most of my courseware's lessons.

Adobe has a list of requested features that one can vote for, and MIDI is on the list, but apparently it has never made the cut. Perhaps Adobe should acquire SonoFlash, and use its team (and cross-platform sound engine) to implement MIDI in Flash.

Labels: , , , ,

Tuesday, December 8, 2009

Sound synthesis problem

I spent the last month packing and moving, but I'm now back online (at last!).

Why doesn't this code work?



Here's what works:
  1. Click either "Play" button; a note will sound, and the button's name will change to "Stop".
  2. Click the same button again to silence the note; the button's name will change back to "Play."
  3. Click the other "Play" button; a different note will sound (an octave higher than the first note); click it again to silence it.
So far, so good.  :-)

Here's what doesn't work:
  1. Click on either "Play" button, sounding a first note.
  2. Click on the other "Play" button, sounding a second note while the first button is still sounding.
Bad things now happen.  The sounds do not blend (as one would expect octaves to do), but instead grate against each other in a nasty alternating, overlapping grind.  Also, the application's performance slows to a crawl. Click on either button, to silence its note, and you'll see that it takes forever for the button to respond to the click.

I'm not sure how to fix this.  The code seems to be working as intended. The flaw seems to be in how I'm using Flex/Flash's sound architecture -- that is, my tactics are correct, but my strategy's wrong.

Comments welcome.  :-)

Labels: , ,

Saturday, April 4, 2009

First Flash control: PitchSlider

To develop my forthcoming music education courseware using Adobe's Flash/Flex/AIR, I'm developing a suite of components that display and control musical information.  This is going well, considering. Although I have a Computer Science degree, I haven't written a line of code since 1992...17 years ago.  Climbing up the Flash/Flex/AIR/ActionScript/Eclipse/XML learning curve is fun but challenging.

My first Flash control is a slider that allows the user to choose a frequency (it works best if you drag the thumb slowly):


No big deal, but writing it helped me understand a lot of stuff, including Flash 10's new sound synthesis API SampleDataEvent. 

I've seen other posts in which the source code to such controls is easily available (by right-clicking on the control and choosing "View Source" from a pop-up menu), but I don't know how to support that feature. I can't find any documentation for it; apparently it's so "obvious" that it is never described. If a reader could please tell me how to add support for Flash's "View Source" feature -- in full newbie-tutorial detail -- I'd be happy to make the code available for this and subsequent iGetIt! controls.  (iGetIt!'s proprietary value is in the patent-pending iGetIt! Music System and the lessons based on it, not in its Flash controls.)

I expect to use the PitchSlider control (or something like it) to show the student that musical pitch (frequency) is continuous, varying in a smooth and unbroken manner. Some frequencies have names (such as 440Hz, which is named A4), and some do not, but all are musically equal. The structure of music is the same for all frequencies.  Obviously, this ignores a ton of psychoacoustic issues like the human ear's range of hearing and critical band, but... close enough, as a first approximation.

Labels: , , , ,