trop.modus
View Source
0from music21 import * 1from trop.dictionaries import* 2from trop.scales import * 3 4class Modus: 5 ''' Byzantine Mode class, defined by 6 Parameters 7 ---------- 8 mode_num: int 9 Number of the mode (between 1 and 8) 10 11 Attributes 12 ---------- 13 mode_num: int 14 Number of the mode (between 1 and 8) mod 15 mode_type: str 16 Genus of the mode (diatonic, soft chromatic, hard chromatic or enharmonic) 17 18 Methods 19 ------- 20 get_scale 21 Generation of the note names as a music21 scale object 22 ''' 23 def __init__(self, mode_num): 24 assert mode_num in list(range(1,9)),"Please enter the mode-number as a digit." 25 self.mode_num = mode_num 26 self.mode_type = mode_types[self.mode_num] 27 28 29 30 def get_scale(self): 31 ''' class method for the retrieval of note names 32 Parameters: 33 ---------- 34 mode_type: str 35 type of the mode (diatonic, soft chromatic, hard chromatic, enharmonic) 36 37 Return: 38 ---------- 39 mode_notes: music21 scale 40 music21 scale object containing the note-names 41 ''' 42 43 mode_notes = scale_gen[self.mode_type] 44 45 return mode_notes 46 47 48 49
View Source
6class Modus: 7 ''' Byzantine Mode class, defined by 8 Parameters 9 ---------- 10 mode_num: int 11 Number of the mode (between 1 and 8) 12 13 Attributes 14 ---------- 15 mode_num: int 16 Number of the mode (between 1 and 8) mod 17 mode_type: str 18 Genus of the mode (diatonic, soft chromatic, hard chromatic or enharmonic) 19 20 Methods 21 ------- 22 get_scale 23 Generation of the note names as a music21 scale object 24 ''' 25 def __init__(self, mode_num): 26 assert mode_num in list(range(1,9)),"Please enter the mode-number as a digit." 27 self.mode_num = mode_num 28 self.mode_type = mode_types[self.mode_num] 29 30 31 32 def get_scale(self): 33 ''' class method for the retrieval of note names 34 Parameters: 35 ---------- 36 mode_type: str 37 type of the mode (diatonic, soft chromatic, hard chromatic, enharmonic) 38 39 Return: 40 ---------- 41 mode_notes: music21 scale 42 music21 scale object containing the note-names 43 ''' 44 45 mode_notes = scale_gen[self.mode_type] 46 47 return mode_notes
Byzantine Mode class, defined by
Parameters
mode_num: int Number of the mode (between 1 and 8)
Attributes
mode_num: int Number of the mode (between 1 and 8) mod mode_type: str Genus of the mode (diatonic, soft chromatic, hard chromatic or enharmonic)
Methods
get_scale Generation of the note names as a music21 scale object
View Source
32 def get_scale(self): 33 ''' class method for the retrieval of note names 34 Parameters: 35 ---------- 36 mode_type: str 37 type of the mode (diatonic, soft chromatic, hard chromatic, enharmonic) 38 39 Return: 40 ---------- 41 mode_notes: music21 scale 42 music21 scale object containing the note-names 43 ''' 44 45 mode_notes = scale_gen[self.mode_type] 46 47 return mode_notes
class method for the retrieval of note names
Parameters:
mode_type: str type of the mode (diatonic, soft chromatic, hard chromatic, enharmonic)
Return:
mode_notes: music21 scale music21 scale object containing the note-names