Unify chordnames

Hey,

I asked myself why are some chord names written like a string e.g. chord(:c4, '+5') and some as symbol with a colon e.g. chord(:c4, :major)? I think a symbol like :+5 wouldn’t work. But is it possible and usefull to unify the chord names as a string?

Hi @stahnirockt,

I think one reason might be, that symbols in Ruby are quite efficient. Compared to symbols everytime a string will be used it’ll be represented as a new object (hope I did get this one right). So those chords, which are commonly used (which is definitely an assumption) are available as ‘slim’ symbols.

Unfortunately Ruby’s literal symbols aren’t as expressive as in some other languages, therefore, as you mention :+5 does’t work. The literal symbols are there because they’re slightly easier to type, but there’s no other major benefit. I have a global option turned on that makes all Strings immutable, so there’s very little performance/memory difference between the two.

However, if you’re looking to unify things, you can just use strings everywhere. For example: (chord :c4, "major")

2 Likes