by Daniel | Jun 21, 2010 | actionscript
Recently I had to create a dynamic menu that required some text to wrap around an ellipse. Getting the rotation correct involved calculating the angle of the tangent around the ellipse which was a challenge. Also the letter spacing was tricky and I don’t think I have the best solution for this but it seems to work quite well.
Here is a quick demo I put together tonight of it in action
click to launch
download source CS5 (also requires minimalcomps Slider source)
by Daniel | May 30, 2010 | actionscript
I’ve been a long-time admirer of the work of David McCandless (http://www.informationisbeautiful.net/), and I finally had the chance to build one of his infographics in Flash. The project displays projected CO2 emissions from car journeys on Memorial Day across America. You can choose between 3 region groupings and 3 fuel types. The numbers involved are mind-boggling!
GE Memorial Day emissions link
by Daniel | May 3, 2010 | actionscript, Featured
[Edit: (6th May) This case is currently under appeal, so my understanding is that no precedents have been set yet. Also it has been pointed out to me that there are other issues to consider such as qualitative test for copyright and contrary sweat of brow. Any other legal opinions are welcome.]
On the 4th of February 2010, the Federal Court of Australia ruled that the Australian Band Men at Work reproduced 2 bars of an iconic Australian round “Kookaburra sits in the old gumtree” in their hit song “Down Under”. (link to ruling)
“Kookaburra” was written in 1932 by Marion Sinclair as an entry into a competition to produce an authentic Australian folk song. It has been a campfire favourite for generations since and is sung as a “traditional” song all around the world.
But it is also a little-known fact that the rights to the song were sold after the competition in 1932 to raise funds for the Girl Guides movement and under Australian law, the song is still “in copyright”.
The brief and playful nod to the song by Men At Work did not come to the attention of the owner of the copyright of “Kookaburra,” Larrikin Music Publishing Pty Ltd, until 2007 – more than 25 years later – when this obscure piece of music trivia was featured in a quiz show. Larrikin Music then sued the band.
I’m a huge fan of the “Down Under” song and also grew up singing “Kookaburra” at kindergarten but I never made the connection either until I read about this court case.
The ruling makes interesting reading, and the judgement is based on the following assumptions about melodic copyright infringement:
- Key is unimportant: relative pitch between notes is what “makes” a melody (point 177 in the ruling)
- Tempo is not significant as long as the two versions are “more or less the same”. (point 185)
The most interesting assumption
and precedent for me though is the length of melody in question.
The “Kookaburra” case is based on a single two-bar phrase. Two bars is all that is needed to prove copyright infringement.
Considering that this Kookaburra melody contains only crochets, quavers and rests (assuming a time signature of 4 / 4), there is a finite number of two bar melodies using these values.
If we divide the two bars up into ¼ notes (quavers – the shortest note value used in this melody) we get 2 bars with 8 “spaces” each:
Consider that we want to be able to include notes longer than a quaver, we must allow sustained notes, and also rests.
Using the range of one octave, and restricting the pitches to a major diatonic scale (1-8), we have 8 pitches, a value for a rest (0), and a value for a sustained note (9). This gives us 10 values to choose from for each note “space”.
Using this form of notation, the Kookaburra melody (above) would be written like this:
Now we have 16 note spaces in our two bars and 10 note values which
gives 10^16 possible melodies, or
If we play through these melodies one after the other, and each melody takes about 4 seconds to complete, our composition will take about 1268 million years. (I hope there is an interval)
The Australian Copyright Council Information Sheet states:
An original work which falls into one of the relevant categories is
automatically protected as soon as it is recorded in some way (for
example, written down, recorded on audio-tape, or saved in a digital
file). A work is “original” for the purposes of copyright law if it
has not merely been copied from another work, and it is the result of
skill or labour on the part of its author.
Obviously writing down all these melodies would be impossible, but it isn’t impossible to write a program to generate them, which is exactly what I have done.
I would say that this program is “the result of skill or labour on the part of its author” and hence is automatically protected by Australian Copyright Laws. Whether or not the code represents it being “recorded in some way… in a digital file” is another issue, but I think it probably does cover this.
This program is written in ActionScript 3.0 for Flash.
The Kookaburra two bar melody in question:
So presumably now I own the copyright of every possible (original) 2 bar one-octave melodic phrase. Give me a new song, and I’ll tell you where it already exists in my composition. This not only covers quavers, crochets and minims, but every note of length up to a breve (a double whole note). Nothing original can ever be composed again.
Speaking with my friend Chris Houston about the mathematical side of this, we realised that the beauty of using a one octave range is that with the rest and sustained values added, we have 10 choices per note position and can therefore use a base10 system to generate the melody.
This program stores the current playing melody and adds 1 to its number to generate next melody. If you start at the first melody:
0000 0000 0000 0000 (all rests and not very interesting)
the next melody will be
0000 0000 0000 0001 (a single “C” quaver at the end of the two bars, still pretty boring)
I’ve included in this program the ability to randomly generate a melody, (which is quite fun to play with and produces some interesting results) and also the ability to make it play a melody of your choice (via the address bar)
which will play up and down the scale.
Here are the first two bars or so from some other famous melodies:
Advance Australia Fair
Minuet in G from Children’s Bach (now in C!)
Obviously as this composition contains all of these melodies, it does infringe on many existing copyrighted works, including the Kookaburra melody, but everything that is original is now part of my composition and therefore a copyrighted melody.
The purpose of this composition isn’t to make million dollars from royalties and ruin music for everybody for the next 70 years, but to point out the flaws in the existing copyright laws. I don’t know what is right, but this ruling seems wrong.
Hopefully Larrikin Music Publishing Pty Ltd won’t be pursuing damages.
Chris Houston for valuable mathematical input
bit-101 for the wonderful minimalcomps
John Dalziel for the time-keeping The Computus Engine
by Daniel | Jan 16, 2010 | actionscript
Here is a brilliant post ‘Zooming in Flash & Flex’ on how to use the transform Matrix to zoom and rotate DisplayObjects. Daniel Gasienica writes well and has some great examples demonstrating to correct way to apply these transformations to your clips.
Using this method saves you messing around with the Point class and localToGlobal / globalToLocal methods. This solution is elegant and efficient.