asigalov61 commited on
Commit
12a60b3
·
verified ·
1 Parent(s): 54a6376

Upload TMIDIX.py

Browse files
Files changed (1) hide show
  1. TMIDIX.py +5 -2
TMIDIX.py CHANGED
@@ -9598,8 +9598,11 @@ def escore_notes_to_text_description(escore_notes, song_name='', artist_name='')
9598
  #==============================================================================
9599
 
9600
  pitches = [e[4] for e in escore_notes if e[3] != 9]
9601
-
9602
- key = SEMITONES[statistics.mode(pitches) % 12]
 
 
 
9603
 
9604
  #==============================================================================
9605
 
 
9598
  #==============================================================================
9599
 
9600
  pitches = [e[4] for e in escore_notes if e[3] != 9]
9601
+
9602
+ key = -1
9603
+
9604
+ if pitches:
9605
+ key = SEMITONES[statistics.mode(pitches) % 12]
9606
 
9607
  #==============================================================================
9608