Music motifs
MotifSequenceGenerator can be applied directly to music-related setting, via Notes, with the function random_notes_sequence. In the Mixing basic drum patterns, this function (and others from JuliaMusic) are taken advantage of in real-life scenarios.
#
MusicManipulations.random_notes_sequence — Function
random_notes_sequence(motifs::Vector{Notes{N}}, q, δq = 0; weights)
Create a random sequence from a pool of notes (motifs) such that it has total length ℓ exactly q - δq ≤ ℓ ≤ q + δq. Notice that q is measured in ticks. Optionally pass keyword weights to sample different motifs with different weights (either as frequencies or as probabilities).
Return the result as a single Notes container, and also return the sequence of motifs used.
This function uses random_sequence from the module MotifSequenceGenerator, adapted to the Notes struct.