[D66] DFA: Paradiddle paradise

René Oudeweg roudeweg at gmail.com
Tue Jul 4 20:04:02 CEST 2023


L.S.

´t was weer een coding dagje...:

https://github.com/juggao/paradiddle

Opgave: Hoe genereer ik van een willekeurige file een general MIDI 
percussie file mbv een statemachine.

1. Genereer PAPAMAMA's mbv van de pama.py 'PAPAMAMA' statemachine:

https://github.com/juggao/dfa/blob/mama/pama.py

2. Transformeer de PAPAMAMA's in "RRLL" format

https://github.com/juggao/paradiddle/blob/main/lr.py

3. Genereer mbv l2randmidi.py een percussie MIDI file (MIDI channel 10)

https://github.com/juggao/paradiddle/blob/main/lr2randmidi.py

default output_file = "about.mid"

4. Speel de MIDI file af mbv Rosegarden en optioneel export het naar een 
audiofile:

https://www.rosegardenmusic.com/


R.O./
Venlo


--
README.pm:

Generates a MIDI file with drum paradiddles from a text with "LRRLLRRR"

Download the pama.py statemachine from my dfa repository
Download the dfa.py statemachine from my dfa repository

Install rosegarden to play the generated midifile (default = 155 BPM)

python lr2randmidi.py -h usage: l2randmidi.py [-h] [-f FILENAME] [-b 
BPM] [-v VERBOSE] [-o OUTPUT]

Generates a MIDI file from a "LLRRLLLRR" string

options: -h, --help show this help message and exit -f FILENAME, 
--filename FILENAME -b BPM, --bpm BPM -v VERBOSE, --verbose VERBOSE -o 
OUTPUT, --output OUTPUT

(c) 2023 René Oudeweg

Example:

$ python pama.py dfa.py | python lr.py | python lr2randmidi.py -b 220 | 
rosegarden about.mid


Ref:

https://en.wikipedia.org/wiki/Drum_rudiment#Diddle_rudiments




More information about the D66 mailing list