Skip to content

Repository files navigation

Crates.io Version

Clave

Clave is a midi click-track generator. It generates single-track single-channel midi file with a customizable click pattern.

Note: click tracks are percussion in their nature. Because of this clave does not generate note off events (only note on).

Pregenerated Tracks

A lot of pregenerated tracks are available in tracks folder.

Installation

cargo install clave

Usage

By default Clave generates 1000 beats of 120bpm 4/4 clicks:

clave --out 44_120.mid

You can use command line arguments to customize the track:

 -b, --bpm <BPM> Track tempo (beats per minute) [default: 120]
--channel <CHANNEL> Midi channel [default: 10]
--beats <BEATS> Track length in number of beats [default: 1000]
--vel <VEL> Default note velocity [default: 63]
--acc-vel <ACC_VEL> Accented note velocity [default: 94]
--ghost-vel <GHOST_VEL> Ghost note velocity [default: 31]
--subs <SUBS> Number of subdivisions in a pattern [default: 1]
-p, --pattern <PATTERN> Click pattern [default: m>mmm]

Click Pattern

You can use --pattern together with --subs to create more sophisticated click patterns:

  • the pattern consists of pattern items optionally separated by spaces
  • each pattern item consists of the note:
  • and optional volume modifier:
    • > - accented note
    • , - ghost note
  • multiple notes can be played as a chord simultaneosly by surrounding them with ().

Default pattern is m>mmm which corresponds to 4/4 metronome click with accented first beat.

Pattern Examples

DescriptionSubsPattern
4/4 with ghost 8th2"m>m,mm,mm,mm,"
Son clave 3-22"crrcrrcrrrcrcrrr"
Son clave 2-32"rrcrcrrrcrrcrrcr"
Rumba clave 3-22"crrcrrrcrrcrcrrr"
Rumba clave 2-32"rrcrcrrrcrrcrrrc"
Cascara 2-32"h>rh>rhh>rhh>rhh>rh>rh"
Rock 4/42"(bh)h(sh)h(bh)h(sh)h"
Funk 4/44"(bh)h>hb s>rhh> bhh>b (s>h>)r(s>h>)r"
Funk with Ghost Notes4"(bh)s,hs> hs,hs, hs,(bh)r (s>h)rhr"

About

Midi click-track generator

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages