Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions mingus/core/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,39 @@ def remove_redundant_accidentals(note):
val += 1
return result

def to_major(note):
""" convert note to relative major.

Examples:
>>> to_major('C')
'D#'
>>> to_major('D')
'F'
"""
note_int = note_to_int()
note_int += 3
if note_int > 11:
note_int -= 12
result = int_to_note(note_int)
return result

def to_minor(note):
""" convert note to relative minor.

Examples:
>>> to_major('C')
'D#'
>>> to_major('D')
'F'
"""
note_int = note_to_int()
note_int -= 3
if note_int < 0:
note_int += 12
result = int_to_note(note_int)
return result


def augment(note):
"""Augment a given note.

Expand Down