• Stars
    star
    46
  • Rank 592,776 (Top 13 %)
  • Language
    Ruby
  • License
    Other
  • Created almost 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MIDI arpeggiator in Ruby

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

More Repositories

1

unimidi

Realtime MIDI IO for Ruby
Ruby
253
star
2

micromidi

A Ruby DSL for MIDI
Ruby
135
star
3

d3-audio-spectrum

Spectrum analysis demo using D3 and HTML5 audio
JavaScript
106
star
4

viddl

Ruby/Command line tool to download, cut, crop and resize video clips
Ruby
32
star
5

twigs

Alternate firmware for Mutable Instruments Branches synthesizer module
C++
26
star
6

midi-eye

Ruby MIDI input event listener
Ruby
24
star
7

web-repl

Javascript/Web REPL in Ruby
Ruby
22
star
8

nibbler

Ruby MIDI message parser
Ruby
21
star
9

audio-playback

Ruby/Command Line Audio File Player
Ruby
21
star
10

midi-message

Ruby MIDI message objects
Ruby
19
star
11

three-audio-spectrum

Spectrum Analysis using Three.js and the HTML5 Web Audio API
JavaScript
17
star
12

midi-winmm

Realtime MIDI IO with Ruby for Windows/Cygwin
Ruby
15
star
13

topaz

MIDI syncable tempo in Ruby
Ruby
15
star
14

alsa-rawmidi

Realtime MIDI IO with Ruby for Linux
Ruby
12
star
15

crontest

For testing cron jobs
Ruby
12
star
16

osc-access

Build OSC into Ruby objects
Ruby
8
star
17

micro-osc

A Ruby DSL for OSC
Ruby
8
star
18

mmplayer

Control MPlayer with MIDI
Ruby
6
star
19

midi-jruby

Realtime MIDI IO in JRuby
Ruby
5
star
20

pulse-analysis

Measure pulse timing accuracy in an audio file
Ruby
4
star
21

diamond-touchosc

Use TouchOSC to control the Diamond arpeggiator
Ruby
3
star
22

grandpa

ruby-gosu + mvc
Ruby
3
star
23

patch

Universal controller message hub
JavaScript
3
star
24

sequencer

Perform a sequence of events at tempo
Ruby
2
star
25

midi-instrument

Core MIDI instrument functionality
Ruby
2
star
26

midi-fx

Realtime MIDI effects
Ruby
1
star
27

analog

A Ruby helper for scaling numbers
Ruby
1
star
28

studio_config

my music studio config files
Ruby
1
star
29

liveset

Performance code/notes
Ruby
1
star
30

arirusso.com

HTML
1
star