asigalov61 commited on
Commit
51e919f
1 Parent(s): c3563d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -0
app.py CHANGED
@@ -211,6 +211,36 @@ def Generate_Chords_Progression(total_song_length_in_chords_chunks,
211
  chords_progression_summary_string = '=' * 70
212
  chords_progression_summary_string += '\n'
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  #========================================================
215
 
216
  print('-' * 70)
 
211
  chords_progression_summary_string = '=' * 70
212
  chords_progression_summary_string += '\n'
213
 
214
+ all_song_chords = []
215
+
216
+ for pc in f_song:
217
+ tones_chord = tuple(sorted(set([p % 12 for p in pc])))
218
+ all_song_chords.append([pc, tones_chord])
219
+
220
+ print('=' * 70)
221
+ print('Total number of chords:', len(all_song_chords))
222
+ print('=' * 70)
223
+ print('Most common pitches chord:', list(Counter(tuple([a[0] for a in all_song_chords])).most_common(1)[0][0]), '===', Counter(tuple([a[0] for a in all_song_chords])).most_common(1)[0][1], 'count')
224
+ print('=' * 70)
225
+ print('Most common tones chord:', list(Counter(tuple([a[1] for a in all_song_chords])).most_common(1)[0][0]), '===', Counter(tuple([a[1] for a in all_song_chords])).most_common(1)[0][1], 'count')
226
+ print('=' * 70)
227
+ print('Sorted unique songs chords set:', len(sorted(set(tuple([a[1] for a in all_song_chords])))), 'count')
228
+ print('=' * 70)
229
+ for c in sorted(set(tuple([a[1] for a in all_song_chords]))):
230
+ print(list(c))
231
+ print('=' * 70)
232
+ print('Grouped songs chords set:', len(TMIDIX.grouped_set(tuple([a[1] for a in all_song_chords]))), ' count')
233
+ print('=' * 70)
234
+ for c in TMIDIX.grouped_set(tuple([a[1] for a in all_song_chords])):
235
+ print(list(c))
236
+ print('=' * 70)
237
+ print('All songs chords')
238
+ print('=' * 70)
239
+ for i, pc_tc in enumerate(all_song_chords):
240
+ print('Song chord #', i)
241
+ print(list(pc_tc[0]), '===', list(pc_tc[1]))
242
+ print('=' * 70)
243
+
244
  #========================================================
245
 
246
  print('-' * 70)