From 907a9919aa763460abf9917f8f4686058c1d3c8c Mon Sep 17 00:00:00 2001 From: Adam <57573881+AdamCarter11@users.noreply.github.com> Date: Thu, 18 Nov 2021 22:45:47 -0800 Subject: [PATCH] random note --- note_maker/_util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/note_maker/_util.py b/note_maker/_util.py index 25f2d4f..ca52ccb 100644 --- a/note_maker/_util.py +++ b/note_maker/_util.py @@ -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)