ELVIS-Project / vis-framework

Thoroughly modern symbolic musical data analysis suite.
http://elvisproject.ca/
31 stars 6 forks source link

Consider renaming inverted intervals to put the '-' sign between the quality and quantity strings. #367

Closed alexandermorgan closed 8 years ago

alexandermorgan commented 8 years ago

music21 would represent a descending interval as 'P-4' but in VIS we show the same interval as '-P4'. Both seem ok but we should consider getting in line with music21's representation. On a related note, there are straight-forward ways to get 7 of the 8 types of interval analyses we currently offer in VIS which could simplify our interval indexer. To take an example, say we have an interval: a = music21.interval.Interval('M-10') Here are 7 ways mentioned above:

Code Result Simple?/Quality?/Direction?
a.name 'M10' F/T/F
a.directedName 'M-10' F/T/T
a.semiSimpleName 'M3' T/T/F
MISSING 'M-3' T/T/T
a.generic.undirected 10 F/F/F
a.generic.directed -10 F/F/T
a.generic.semiSimpleUndirected 3 T/F/F
a.generic.semiSimpleDirected -3 T/F/T

To address the missing one, there is a.directedSimpleName but we want to distinguish between octaves and unisons so we would need a.directedSemiSimpleName but it isn't in music21. This has already been reported to music21.

alexandermorgan commented 8 years ago

The short answer is that music21 has no direct way to get the "missing" name from the chart above. But Myke has offered these two solutions. The first one currently works and the second one should work version 3. interval.prefixSpecs[i.specifier] + str(i.generic.semiSimpleDirected) i.diatonic.specifierAbbreviation + str(i.generic.semiSimpleDirected)

Regardless of how we decide to represent descending intervals, I think it's time we overhaul the complex indexer_func calls in interval.py. We already have 8 ways of computing intervals and there are still more desirable ones (using interval classes, using chromatic intervals, etc.) so we need a better solution than what we have.

alexandermorgan commented 8 years ago

@ahankinson brought up the good point that if we use an interval representation other than that of music21 we may run into trouble if we try to do something in music21 with the intervals we calculate (we don't do anything like this at the moment but it could easily happen in the future). This is actually not an issue because music21 can handle either representation of descending intervals, it just only outputs one type. In short, these two lines are functionally equivalent: a = interval.Interval('M-10') a = interval.Interval('-M10') A quick check showed them to have roughly equivalent performance too.

alexandermorgan commented 8 years ago

A simpler way to get this interval would be: a = interval.Interval('-M10') a.diatonic.directedSemiSimpleName

which returns 'M-3' but this doesn't solve the issue of us wanting the negative sign to come first.

alexandermorgan commented 8 years ago

Long story short, we decided not to do this and to just keep things the way they are.