saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.32k stars 115 forks source link

Get The Note #53

Closed amitgur closed 10 years ago

amitgur commented 10 years ago

Hello

I am looking for a way to get the note only from teoria note:

v = teoria.note('Bb4');

v.something() will get me 'Bb';

Any ideas ?

Thanks I have released a first demo of my project using Teoria, Thank You! http://www.windsoloist.com

saebekassebil commented 10 years ago

Hi Amit,

What about

note.name().toUpperCase() + note.accidental()

I realize that this is a bit verbose, but I recken that it'll do?

Your project looks brilliant!

amitgur commented 10 years ago

Hey For Bb4 note.name will give B dropping the flat sign. At the moment I implimented it like this

var str1 = teoriaNote.toString(), str2 = str1.charAt(0).toUpperCase() + str1.slice(1); noteStr = str2.substring(0, str2.length - 1);

This solved the case but it will be nice to add it to wish list for later develop.

Thanks for the compliment Jakob

saebekassebil commented 10 years ago

You don't really need to do all that string magic,

note.name().toUpperCase() + note.accidental()

should do. Closing as this seems solved by above.