Skip to content

Commit

Permalink
random note
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamCarter11 committed Nov 19, 2021
1 parent ab7c718 commit 907a991
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions note_maker/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def add_notes(midi, track, channel, notes, time, duration, volume):
for note in notes:
midi.addNote(track, channel, note, time, duration, volume)

def random_note():
lst = list(notes.items())
return (random.choice(lst)[1])

def random_common_chord(root):
return random.choice(common_chords)(root)

Expand Down

0 comments on commit 907a991

Please sign in to comment.