Beispiel #1
0
 def ascending(self):
     notes = [self.tonic]
     notes.append(intervals.major_second(notes[0]))
     notes.append(intervals.major_third(notes[0]))
     notes.append(intervals.perfect_fifth(notes[0]))
     notes.append(intervals.major_sixth(notes[0]))
     return notes * self.octaves + [notes[0]]
Beispiel #2
0
def major_triad(note):
    """Build a major triad on note.

    Example:
    >>> major_triad('C')
    ['C', 'E', 'G']
    """
    return [note, intervals.major_third(note), intervals.perfect_fifth(note)]
def major_triad(note):
    """Build a major triad on note.

    Example:
    >>> major_triad('C')
    ['C', 'E', 'G']
    """
    return [note, intervals.major_third(note), intervals.perfect_fifth(note)]
Beispiel #4
0
def augmented_triad(note):
    """Build an augmented triad on note.

    Example:
    >>> augmented_triad('C')
    ['C', 'E', 'G#']
    """
    return [note, intervals.major_third(note),
            notes.augment(intervals.major_fifth(note))]
Beispiel #5
0
	def test_major_thirds(self):
		majors = {
				"C": "E",
				"C#": "E#",
				"Cb" : "Eb",
				"Cbb" : "Ebb",
				"F" : "A",
				"Fb" : "Ab",
				"B" : "D#",
				"Bb" : "D",
				"Bbb" : "Db",
				"B#" : "D##",
				"A" : "C#",
				"Ab" : "C",
				"A#" : "C##"
						}
		for x in majors.keys():
			self.assertEqual(majors[x], intervals.major_third(x),\
				"The major third of %s is not %s, expecting %s" % (x, intervals.major_third(x), majors[x]))
Beispiel #6
0
 def test_major_thirds(self):
     majors = {
         'C': 'E',
         'C#': 'E#',
         'Cb': 'Eb',
         'Cbb': 'Ebb',
         'F': 'A',
         'Fb': 'Ab',
         'B': 'D#',
         'Bb': 'D',
         'Bbb': 'Db',
         'B#': 'D##',
         'A': 'C#',
         'Ab': 'C',
         'A#': 'C##',
         }
     for x in list(majors.keys()):
         self.assertEqual(majors[x], intervals.major_third(x),
                          'The major third of %s is not %s, expecting %s'
                           % (x, intervals.major_third(x), majors[x]))
Beispiel #7
0
 def test_major_thirds(self):
     majors = {
         'C': 'E',
         'C#': 'E#',
         'Cb': 'Eb',
         'Cbb': 'Ebb',
         'F': 'A',
         'Fb': 'Ab',
         'B': 'D#',
         'Bb': 'D',
         'Bbb': 'Db',
         'B#': 'D##',
         'A': 'C#',
         'Ab': 'C',
         'A#': 'C##',
         }
     for x in list(majors.keys()):
         self.assertEqual(majors[x], intervals.major_third(x),
                          'The major third of %s is not %s, expecting %s'
                           % (x, intervals.major_third(x), majors[x]))
 def test_major_thirds(self):
     majors = {
         "C": "E",
         "C#": "E#",
         "Cb": "Eb",
         "Cbb": "Ebb",
         "F": "A",
         "Fb": "Ab",
         "B": "D#",
         "Bb": "D",
         "Bbb": "Db",
         "B#": "D##",
         "A": "C#",
         "Ab": "C",
         "A#": "C##",
     }
     for x in majors:
         self.assertEqual(
             majors[x],
             intervals.major_third(x),
             "The major third of %s is not %s, expecting %s" %
             (x, intervals.major_third(x), majors[x]),
         )
Beispiel #9
0
def create_interval_consonant(start_note):
    start = start_note
    options = [
        intervals.perfect_fifth(start),
        intervals.perfect_fourth(start),
        intervals.major_unison(start),
        intervals.major_third(start),
        intervals.minor_third(start),
        intervals.major_sixth(start),
        intervals.minor_sixth(start)
    ]
    end = options[(randint(0, len(options) - 1))]
    interval = intervals.determine(start, end)
    return interval
Beispiel #10
0
 def ascending(self):
     notes = Dorian(self.tonic).ascending()[:3]
     notes.append(intervals.major_third(notes[0]))
     notes += Dorian(self.tonic).ascending()[3:-1]
     return notes * self.octaves + [notes[0]]
Beispiel #11
0
'''
Created on Jan 6, 2017

@author: stephenkoh
'''

import mingus.core.notes as notes
import mingus.core.intervals as intervals

note = "C"
third_b = intervals.minor_third(note)
third_b_int = notes.note_to_int(third_b)
print("minor third: ", third_b, third_b_int)
third = intervals.major_third(note)
third_int = notes.note_to_int(third)
print("major third: ", third, third_int)
fourth_b = intervals.minor_fourth(note)
fourth_b_int = notes.note_to_int(fourth_b)
print("minor fourth: ", fourth_b, fourth_b_int)
fourth = intervals.major_fourth(note)
fourth_int = notes.note_to_int(fourth)
print("major fourth: ", fourth, fourth_int)