Skip to content
/ cane Public

A small MIDI sequencer DSL designed around vectors and euclidean rhythms

License

Notifications You must be signed in to change notification settings

Jackojc/cane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cane

The beatings will continue until a banger is made

Cane is a small vector language designed for making beats with realtime MIDI.

c++ issues pull requests license discord

Example

# Constants
let
	bpm 120
	note 60 # Middle C

let
	qn bpm * 4 # Quarter Note
	hn bpm * 2 # Half Note
	fn bpm     # Full Note

# MIDI Channels
let
	c_bd 1 # Bass Drum
	c_cl 2 # Clap
	c_sh 3 # Shaker
	c_ch 4 # Closed HiHat
	c_oh 6 # Open HiHat

# Notes
let
	bd 69 # c_bd: Bass Drum
	cl 69 # c_cl: Clap
	sh 58 # c_sh: Shaker
	ch 69 # c_ch: Closed HiHat
	oh 69 # c_oh: Open HiHat

# French House
!... !... !... !... map bd @ qn ~> c_bd $
.... !... .... !... map cl @ qn ~> c_cl $
!!!. !.!! !!!. !.!! map sh @ qn ~> c_sh $
!!!! !!!! !!!! !!!! map ch @ qn ~> c_ch $
.!.! .!.! .!.! .!.! map oh @ qn ~> c_oh

What Can Cane Do?

  • Control hardware and software synths through JACK MIDI
  • Play chords and melodies
  • Generate complex beats with relatively little effort
  • Embeddable in larger projects
  • Create polyrhythms and polymeters
  • Live-coding (TODO)

Introduction & Reference

See the introduction here and see the reference here.

The EBNF grammar is here.

Requirements

Build & Run

Make sure to use a c++-17 compliant compiler.

git clone --recursive https://github.com/Jackojc/cane && cd cane
make dbg=no
./build/cane < foo.cn

Rationale

Cane is a project born out of frustration with existing tools. DAWs and other sequencing software generally don't favour a rapid iterative/experimental workflow. I want to be able to edit all parts of my song in the same place while listening to it play in realtime. This is generally just not possible with other tools or is awkward to use. I also want to favour use of the keyboard since I can type faster than I can hunt down context menus with the pointer which, again, allows for a very quick iterative approach to writing music.

Most music software also tends to favour a very western influenced style of writing and hinders more exotic compositions. Cane tries to stay fairly agnostic to any particular style and allows for interesting rhythms and arrangements that would otherwise not be possible in a traditional DAW. Tempo in Cane can be varied throughout the song for example or sequences can easily play at many different tempos concurrently. The important point to note here is that this is all easy in Cane.

Design

  • Cane is intentionally designed to be turing incomplete: all sequences should terminate. This makes the language deterministic and keeps the implementation simple
  • Cane is designed to enable an experimental and iterative workflow, one where you more often spend time removing things than adding them
  • JACK was chosen as the backend for MIDI transport for its low latency properties which make it desirable for realtime use

Acknowledgements

Resources

See the list of resources here

License

This project uses the GPL-3.0 license. (check LICENSE)

Progress & Discussion

You can join the discord server in order to follow progress and/or contribute to discussion of the project: https://discord.gg/UVYAtpYYD2