drum_machine: Create drum sequence.

Description Usage Arguments Value Examples

View source: R/drum_machine.R

Description

Creates drum sequence as named list. Emulates a 16-step drum sequencer.

Usage

1
drum_machine(..., note_length = NULL, rep = 1)

Arguments

hh

(optional) Takes numbers from 1 to 16, which represent the hi-hat's positions in a 16-step sequence.

kick

(optional) Takes numbers from 1 to 16, which represent the kick's positions in a 16-step sequence.

snare

(optional) Takes numbers from 1 to 16, which represent the snare's positions in a 16-step sequence.

Value

A named list with notes in positions corresponding to the hits. This list has 'seq' as its class attribute, which means that it can be fed into the create_midi function to be converted into a hexadecimal MIDI sequence.

Examples

1
2
drum_machine(hh = 1:16, kick = seq(1,16, by = 4),
snare = c(5, 13))

datadiarist/midiR documentation built on April 1, 2020, 4:29 a.m.