No such thing as a small change | |
PerlMonks |
Design for converting between musical formats ?by benn (Vicar) |
on Aug 12, 2003 at 11:16 UTC ( [id://283141]=perlquestion: print w/replies, xml ) | Need Help?? |
benn has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Brethren,
I'm about to plunge into some code to convert various musical note formats back and forth - "BB-" <->"Bb2" <->"bf3" etc. Looking around, I guess there are between 5 and 10 different formats that I'll eventually want to build in. My problem is how to structure this. Possible options would appear to be...
One wrinkle is that different formats may require / return additional parameters - ABC format, for instance, sets up a key and a default octave as part of its header, so they may need to be passed in ("F" in the key "D" would convert to "F#" etc.). Atm, I'm favouring the named parameter style (easy to maintain and pass extra parameters ) but I'd be grateful for any input before I "get my coding pencil out" :) Cheers, Title edit by tye
Back to
Seekers of Perl Wisdom
|
|