Sine synthesizer with PureMVC

Screenshot

Screenshot

The past weeks I’ve been learning PureMVC. It had been on my mind for some time, and now that a project (a pianoroll type MIDI editor) became too complicated and the lack of structure took the fun out of programming I figured it was time for a nice new clean framework.


I read the ‘Framework Overview with UML’, the ‘Implementation Idioms and Best Practices’ and memorized the famous conceptual diagram with it’s interconnected cloud of meaningfull data blobs (see picture). I looked up some basic tutorials, ‘Minimalist MVC example using the PureMVC Framework’, ‘Building a Flash site using PureMVC’ and found this useful page: ‘PureMVC in a week’. And then felt ready for some PureMVC action of my own.

The PureMVC conceptual diagram

The PureMVC conceptual diagram

And I must say: It’s not as complicated as I feared it would be. The first hurdle is a bit high with a lot of concepts and rules to remember, but then it quickly becomes clearer what part of the code goes where. My previous framework experience was with Cairngorm which is MVC based as well, so that definitely helped me to get my head round PureMVC.

Here is my first PureMVC test project, done to check how the audio programming stuff would integrate with the framework: It’s a small synthesizer that plays sine waves. Only sine waves. You can use keys on the computer keyboard to play the synth as a piano keyboard (see picture for the keys) and use Z and X to switch octaves and C and V to change the volume. This keyboard layout was taken from Ableton Live. I like the way it works there. So thank you Ableton.


Get Adobe Flash player

The source files are available again : Download the source files here.

Take note however that there is no FLA file. This is an ActionScript only project made in FDT. But if you want to compile it in Flash, it will probably work if you set App.as as the document root.

Use the computer keyboard to play

Use the computer keyboard to play

This entry was posted in ActionScript. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted July 23, 2009 at 06:50 | Permalink

    Hi Wouter and welcome in PureMVC community.

    Make sure you read my other blog post PureMVC actors and their responsibilities. You can find there presentation of 4 main actors(facade, mediator, proxy, command) and source code examples.

    I love PureMVC and everything new i learn about this framework i post on my blog.

    Mariush T.
    http://mariusht.com/blog/

  2. Posted August 11, 2009 at 13:41 | Permalink

    Grappig dat jij ook met flash en geluid bezig bent… dat wist ik helemaal niet, heb je dit project van mij wel eens gezien?

    http://www.youtube.com/watch?v=cz0G3bozGNw

    http://www.youtube.com/watch?v=gC-07Hgwc6g

  3. Martin
    Posted November 3, 2009 at 01:12 | Permalink

    Hi again,
    Just one stupid question: did you have any reason to choose PureMVC rather than Cairngorm (or maybe other MVC frameworks), or was it just an experience?
    Regards,
    Martin

  4. admin
    Posted January 7, 2010 at 23:53 | Permalink

    Hi Martin,
    Well, the main reason is that the stuff on this blog is all Flash and Cairngorm can only be used with Flex as far as I know. I did use Cairngorm a few times. It’s OK, but I’m much happier to use PureMVC. I feel PureMVC is more flexible. It gives me more freedom in how to set up my projects. But I’ve yet only used it in small projects. It might be that the tighter structure of Cairngorm makes large projects more manageable.

Post a Comment

Your email is never published nor shared. 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>