Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: utf8 hash keys revisited: How can i use musical symbols as hash keys?

by Jim (Curate)
on Oct 07, 2014 at 22:47 UTC ( [id://1103120]=note: print w/replies, xml ) Need Help??


in reply to Re^4: utf8 hash keys revisited: How can i use musical symbols as hash keys?
in thread utf8 hash keys revisited: How can i use musical symbols as hash keys?

If maintaining a one-to-one relationship of %helmholtz_to_midi keys to %midi_to_helmholtz keys is an important requirement, then, yes, you have to do something kludgy like use a compound identifier. For example:

    $helmholtz_to_midi{'a♯¹/b♭¹'}{midi_note_number} = 70;

and

    $midi_to_helmholtz{'70'}{helmholtz_note_name} = 'a♯¹/b♭¹';

But the inescapable musical fact remains:  there isn't a one-to-one relationship of MIDI note numbers to Helmholtz note names. There's a one-to-many relationship, just as there's a one-to-many relationship of pitches (440 Hz) to enharmonic notes (g𝄪¹, a¹, b𝄫¹).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1103120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found