Skip to content

PaperNick/music-theory-interval-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interval builder and finder

Test Status

This package aims to serve as a base that can be used in music theory applications which rely on interval building and finding.

By using this module, you can build an interval starting from any note, in any direction (ascending, descending). You can also find the interval between two arbitrary notes in any direction (ascending and descending).

Dependencies

  • Python 3.7+

Usage

Building an interval above

from src.engine import IntervalCalculator
from src.enums import Note, Interval
calc = IntervalCalculator()
calc.add_interval_above(Note.G, Interval.MINOR_6TH)

<Note.E_FLAT: 4>

Building an interval below

from src.engine import IntervalCalculator
from src.enums import Note, Interval
calc = IntervalCalculator()
calc.subtract_interval_below(Note.A_FLAT, Interval.TRITONE)

<Note.D: 3>

Find the interval between 2 notes (ascending)

from src.engine import IntervalCalculator
from src.enums import Note, Interval
calc = IntervalCalculator()
calc.find_interval_ascending(Note.E, Note.B_FLAT)

<Interval.TRITONE: (6, 'TT', 'tritone')>

Find the interval between 2 notes (descending)

from src.engine import IntervalCalculator
from src.enums import Note, Interval
calc = IntervalCalculator()
calc.find_interval_descending(Note.A, Note.D_FLAT)

<Interval.MINOR_6TH: (8, 'm6', 'minor 6th')>

Interval building trainer

If you want to practice building intervals, start the CLI trainer:

python -m src.trainer

Run in auto-answer mode:

python -m src.trainer -a

Testing

Execute the unit tests:

python -m unittest src.tests

About

Music theory package for interval building and finding

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages