-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor parameter.$PROPERTY to parameter.$UNIT
Before this patch parameters, which are identified by only one property (parameters that inherit from 'abc.SingleValueParameter'), had the naming convention 'the pivotal property must be named by itself'. So for instance the pivotal property 'frequency' of the parameter 'Pitch' was named 'frequency'. The following is a list of single-value parameters in 'mutwo.core' and 'mutwo.music' as it can be found before this patch: Pitch.frequency Volume.amplitude Duration.duration TempoPoint.tempo PitchInterval.interval Lyric.phonetic_representation While some of these names are ok (frequency or amplitude), some other names look more stupid and confusing (the duration of a duration, the interval of a pitch interval). Perhaps due to this an earlier version of 'PitchInterval' used the property 'cents', before it was refactored to 'interval' in mutwo-org/mutwo.music@e3372c7 to obey to the general naming convention. The idea of this patch is instead of renaming 'PitchInterval.cents' to 'PitchInterval.interval', we should rather change the global naming convention and use the unit instead of the property as the name: Pitch.frequency => Pitch.hertz Volume.amplitude => Volume.decibel [1] Duration.duration => Duration.beat_count TempoPoint.tempo => TempoPoint.bpm PitchInterval.interval => PitchInterval.cents Lyric.phonetic_representation => Lyric.xampa This rename has multiple advantages: - We no longer have stupid repetitions ('duration.duration' or 'interval.interval'). - It's more explicit now, as the unit of 'interval' could also be a multiplier or the unit of 'duration' could also be seconds. Now the names are less ambiguous. - Most names are shorter. This patch applies these changes in 'mutwo.core', e.g. it changes 'Duration' and 'TempoPoint'. When migrating to 'mutwo.core 2.0.0', 'mutwo.music' needs to apply the same change of naming convention to its own parameters. [1] This wouldn't only change the name, but also what this pivotal property is.
- Loading branch information
1 parent
c37ed72
commit 9f08dca
Showing
11 changed files
with
104 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.