No release in over 3 years
Low commit activity in last 3 years
A MIDI arpeggiator in Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 5.5.0, ~> 5.5
>= 1.1.0, ~> 1.1
>= 10.4.2, ~> 10.4
>= 1.2.1, ~> 1.2

Runtime

>= 0.3, ~> 0
>= 0.0.6, ~> 0.0
>= 1.0.3, ~> 1.0
>= 0.4.4, ~> 0.4
>= 0.4.1, ~> 0.4
>= 0.1.1, ~> 0.1
>= 1.1.1, ~> 1.1
>= 0.4.3, ~> 0.4
 Project Readme

Diamond

MIDI arpeggiator in Ruby

diamond

Features

  • Classic arpeggiator functionality and patterns
  • OSC and MIDI remote control
  • MIDI clock IO
  • Multiplex clocks and arpeggiators
  • Suited to live coding
  • Generative arpeggio patterns

Installation

gem install diamond

or with Bundler, add this to your Gemfile

gem "diamond"

Usage

require "diamond"

First, select a MIDI output using unimidi. (more about that here)

@output = UniMIDI::Output.gets

The Diamond arpeggiator has a number of optional parameters. For this example, here's a straightforward setup

options = {
  :gate => 90,
  :interval => 7,
  :midi => @output,
  :pattern => "UpDown",
  :range => 4,
  :rate => 8
}

arpeggiator = Diamond::Arpeggiator.new(options)

Create a clock object, passing in a tempo value. In this case the tempo will be 138 BPM

clock = Diamond::Clock.new(138)

Point the clock to the arpeggiator

clock << arpeggiator

The arpeggiator will play based on inputted notes or chords; a MIDI input can be used for that. (see example). It's also possible to enter notes in Ruby:

chord = ["C3", "G3", "Bb3", "A4"]

Use Arpeggiator#add and Arpeggiator#remove to change the notes that the arpeggiator sees. (Arpeggiator#<< is the same as add)

arpeggiator.add(chord)
arpeggiator << "C5"

Starting the clock will also start the arpeggiator:

clock.start

Note that by default, the clock will run in a background thread. If you're working in a PRY/IRB/etc this will allow you to continue to code while the arpeggiator runs. To start in the foreground, pass :focus => true to Clock#start.

All of the arpeggiator options can be controlled while the arpeggiator is running.

arpeggiator.rate = 16
arpeggiator.gate = 20  
arpeggiator.remove("C5", "A4")

This screencast video shows Diamond being live coded in this way. (Note that the API has changed a bit since 2011 when the video was made).

This blog post explains what is happening in the video.

Posts

Examples

More...

Other Documentation

Author

License

Apache 2.0, See the file LICENSE

Copyright (c) 2011-2015 Ari Russo