[kln2-devel] Solfeggio notation design proposal
Brought to you by:
wiecko
|
From: Fernando C. <fer...@ya...> - 2004-03-08 01:08:55
|
Hi all,
My name is Fernando Cuenca and I have been entrusted to implement the
Solfeggio (aka Do-Re-Mi) notation in KLearnNotes. I have been looking at
the code and I'd like to share some design ideas on how to implement the
new functionality.
Since I'm new to this group, though, let me introduce myself first. I'm
originary from Cordoba, Argentina but I'm now living in Toronto, Canada,
where I work for a software development company. I studied music throught
all my chilhood and the piano for a few years in my late teens (I'm 32
now). I have recently decided to restart my piano playing, but I realized
that if I want this attempt to be lasting I need to improve the skill that
prompted me to abandon it years ago: my sight-reading (it really sucks
:-). In any case, that's how I came across KLearnNotes.
Now, to the Do-Re-Mi issue: as far as I could see by scanning through the
code, currently the notes are stored in the orderOfNotes global char array
(declared in klearnnotes2.h). That array is used in several places, mainly
to get the note name (which usually is put into a QString object); in
other cases, is used to get the ascii value associated with the note.
What I'm planning to do is to replace that array with a new class, which
will provide for both kinds of access (QString and int) and a notation
switching mechanism:
class ScaleNotation
{
public:
// ... other declarations...
enum ScaleNote { evB = 0, evA, evG, evF, evE, evD, evC }
QString GetNote(ScaleNote) const;
int GetNote(ScaleNote) const;
static const ScaleNotation* GetCurrentNotation();
static void SwitchNotation(ScaleNotation*);
};
In a first pass, I will refactor all the existing code to use this class
(which will be a Singleton, to provide a unique, globally accessible
instance). I'll commit this change to CVS, so everybody else can start
working with this instead of the global array. Later, I will add the GUI
components, for which I will need some guidance, since I don't have
experience with Qt/KDE development.
Well, that's the idea. Any comments will be appreciated.
Saludos!
Fernando.
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
http://search.yahoo.com
|