I have worked during the previous weeks on some transpositions features for Flat. I will try to explain in this post what is the logic behind music intervals.

Intervals are defined with 2 values: diatonic and chromatic.
Diatonic

| Step | Diatonic | Name |
|---|---|---|
| C | 0 | unison |
| D | 1 | second |
| E | 2 | third |
| F | 3 | fourth |
| G | 4 | fifth |
| A | 5 | sixth |
| B | 6 | seventh |
Chromatic
| Step | Diatonic | Name | Chromatic | Prefix |
|---|---|---|---|---|
| C | 0 | unison | 0 | perfect |
| D | 1 | second | 2 | major |
| E | 2 | third | 4 | major |
| F | 3 | fourth | 5 | perfect |
| G | 4 | fifth | 7 | perfect |
| A | 5 | sixth | 9 | major |
| B | 6 | seventh | 11 | major |
Alterations
You can add alterations to base pitch steps. The diatonic value stays the same while the chromatic value changes.
Enharmonics
Two notes with the same sound but different writing are called enharmonic — for instance: E# and F, E and Fb, B and Cb.