Pages

Sunday, September 18, 2011

Setting up the model

Now that I know the basics of NME, let's get to work !

For my application I will need a score modelisation, I recall my first draft two years ago in as3, it wasn't as powerfull as I wanted, I'll try to do better this time.

I take a moment to imagine the internal representation of my score, I see a key, notes appearing randomly, from here it seems simple, maybe too simple, the score as I see it is too close to the first need of my applicaiton : putting random notes as it goes. If I were to show an whole score this won't stand.
I get away from my computer and begin to think how a score would be modeled in any other music software.
On a score we have two axis, one is time, sa time goes we increment a pointer to read the next symbols.
Notes are not the only symbols we encountre on a score so maybe it would be usefull to keep the possibility to represent other stuff like wait times.
On the other axis we have the height of the note, but keep in mind that notes may not be the only thing to represent.
Now I have plenty of ideas and thoughts are hard to hold, I begin to lose faith in my capacity to concentrate. It's time to move on and start implementing.
At this point the classical sheme for me is :
- create 3-4 classes and define their inheritence
- start defining attributes for the "entry point" class
- think these attributes could be part of the more generic class, create a class, redefine inheritence
- start implementing constructor of "entry point" class, need a super constructor, define every constructor in the parenthood
- think this one top level class is silly and serve no purpose, delete it, redefine inheritence subclass and constructor
- initialise attributes, if they are custom types create the constructor of those classes, go to point 4 then 2 then 3 then 4 again then 5
- at this point the model is pretty complex, no function implemenation except for some getter/setters, and I hit some design weirdness like a CRT
note : If you come across something like a CRT and you didn't intended to from the begining, you're probably overthinking your model
- think the model is too complex, see a brighter one, delete 3/4 of your classes, restart at point 1

Future me, if you've evolved from this and are able to think straight in those early moments of a project, I'm glad you did and I just want you to remember how long it took you to figure out this simple design.

No comments:

Post a Comment