Title: | Turn R into a Drum Machine |
---|---|
Description: | Includes various functions for playing drum sounds. beat() plays a drum sound from one of the six included drum kits. tempo() sets spacing between calls to beat() in bpm. Together the two functions can be used to create many different drum patterns. |
Authors: | James Martherus [aut, cre] |
Maintainer: | James Martherus <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0.9000 |
Built: | 2025-03-01 03:34:51 UTC |
Source: | https://github.com/jamesmartherus/drumr |
beat
plays a drum beat.
beat(drum = "snare", kit = "acoustic", expr = NULL)
beat(drum = "snare", kit = "acoustic", expr = NULL)
drum |
character string or number specifying which drum is to be played by specifying one of the built in sounds. The default is "snare". Every kit includes at least four pieces:
If |
kit |
character string specifying which kit is to be used. The default is "acoustic." Possible kits are:
If |
expr |
An optional expression to be executed before the sound. |
# Play a "snare" sound from the "acoustic" kit beat() # Play a bass sound from the hiphop kit. beat(drum="kick", kit="hiphop")
# Play a "snare" sound from the "acoustic" kit beat() # Play a bass sound from the hiphop kit. beat(drum="kick", kit="hiphop")
tempo
is a wrapper for Sys.time() that sets a tempo in bpm.
tempo(bpm = 120)
tempo(bpm = 120)
bpm |
A number specifying the tempo in beats per minute. Default is 120. |
# Set tempo at 60 beats per minute tempo(60)
# Set tempo at 60 beats per minute tempo(60)