Sunday, January 8, 2012

An Ableton Live Set is gzipped XML + a Ruby gem

Recently I started using git and github.com for version control of my Ableton Live Sets.  I pushed  these files to github to have backups and to be able to rollback to a previous version in case I got carried away on some ill-fated musical tangent.

But I was missing out on a one of the nicest features of git and github, diffs: I could not see the differences between two files or versions of my Live Sets.  Why?

Ableton's Live Set file is binary, not line based text.  I decided to reverse engineer the file:
  $ file Amy.als
  Amy.als: gzip compressed data, from Unix
Hmm.... Then, of course, I tried this:
  $ cp Amy.als Amy.gz
  $ gunzip Amy.gz 
  $ file Amy
  Amy: XML  document text
What!?
Reverse engineering done. Wait. Will Ableton Live read the file if I just gzip it and rename it?
  $ mv Amy.gz AmyTest.als
  $ open AmyTest.als
Poof! There it is. This was very nice of the Ableton developers. Thanks guys.  Now I can add and commit XML files to git and not binary.  It sucks to have to do this by hand for each Live Set each time I want to make a commit so I created the Ruby gem guard-live-set.

From the guard documentation: Guard is a command line tool to easily handle events on file system modifications.  My guard specialization just watches for any changes to a .als file and immediately creates a .als.xml version of it.  There you go, enjoy.

My hope is for more people to start committing their creations so that others can collaborate and then we can all benefit and improve from each other's creations.  I don't need to explain how successful open source software has been, why not open source music?  I'll throw in my Live-Set-github hat in with this: https://github.com/mgarriss/ugly.live.sets.

There is still a lot more work that needs to be done before true barrier free Live Set collaboration can be a reality.  First is the sharing of samples and plugins.  These are large files and not suitable for github.com.  Next we probably need some kind of .als lint program that could do more than indent; maybe it could keep things in a well defined order which would make the diffs cleaner.  An online friend is putting some thought into a Ruby gem for editing these .als files and I've agreed to contribute to that so stay tuned...

Tuesday, December 27, 2011

ugly.8panel

Finally ugly.dial starts to get useful.  ugly.8panel combines 8 ugly.dials into one panel.

Group dials by selecting the dial. All selected dials will rotate together.  See the help patcher for more info.

ugly.automata 0.1

ugly.automata 0.1 is a ruby gem for generating  cellular automata.  It currently only includes the Wolfram elementary cellular automata.  How is this related to music?  The plan is to produce MIDI files using cellular automata.

To install:
$ gem install ugly.automata

Saturday, December 24, 2011

ugly.dial 0.3

ugly.dial 0.3 is available.  You might also want to check out the prototype of ugly.8panel to see the selected feature of ugly.dial in action.

There should be an ugly.8panel version 0.1.0 available sometime tomorrow.  This mean defined inlets and outlets, a README and a help patcher.

Friday, December 23, 2011

ugly.dial 0.2.0


ugly.dial version 0.2.0 is now available.  It is a MIDI control that rotates from 0 to 127.  You can adjust the lower and upper bounds with the two smaller dials located above the main dial.  Slam the value to the lower or upper bound by hitting the buttons next to these dials.

There is a text-editable label on top.  The dial's color can be changed by double clicking in-between the two smaller dials.  There are also three buttons on the lower left whose state can be read from outlets.

A maxhelp patcher has also been added.

Inlets

  1. number: 0-127
  2. number: lower bound 0-127
  3. number: upper bound 0-127
  4. set message to set the text label
  5. on/off to select, causes 4px border to appear
  6. number: 0-127, accepts input only when dial is "select" with inlet 5
  7. top trigger
  8. middle trigger
  9. lower trigger


Outlets

  1. number: dial value
  2. number: lower bound
  3. number: upper bound
  4. selected state
  5. color as list of 4 floats
  6. top trigger
  7. middle trigger
  8. lower trigger


apparatus

Instead of visions of sugar plums last night, I had a vision of an apparatus.  From Apple's dictionary app:

apparatus noun ( pl. -uses)

1 the equipment needed for a particular activity or purpose : laboratory apparatus. See note at tool .
the organs used to perform a particular bodily function : the specialized male and female sexual apparatus.
2 a complex structure within an organization or system : the apparatus of government.
3 (also critical apparatus or apparatus criticus) a collection of notes, variant readings, and other matter accompanying a printed text.

I'll go with number 1. Also it's amusing that 3 includes the phrase "a collection of notes" but it's in another sense, still cool.

My laptop will host the apparatus.  What does it look like?  A new kind of musical instrument.  The "particular activity or purpose"?  To make you dance.

To make you dance.

The diagram to the left is my initial blueprint of how this will work.  

That's me on top, working the apparatus.  That's the apparatus in the middle.  And that's you on the bottom:  swinging your hips around, drawing shapes in the air with your hands, maybe jumping up and down too; you get the idea.

Thursday, December 22, 2011

ugly.bg.flash for Max/MSP

  This patcher and it's help patch can be found here.

Cycles an all white panel between 0.5 and 0.0 opacity for a 2 seconds.  Creating a visual flashing effect.  Place a panel over an Max object and attach this patcher to it.  You'll probably want to disable clicks for the panel.

Trigger the flash by sending a bang to the first inlet.  Adjust the amount of time to flash by sending a number to the second inlet.  Adjust the speed of the flash by setting an update time to the third outlet (lower is faster here).

I use this to flash a UI element that just recieved input from the outside world, Ableton or my MIDI controller.

ugly.border.toggle for Max/MSP

Download patcher and help and here.

I'm working on a patcher of eight dials that allows a user to select certain dials to have them link together.  A re-factor of that patcher led me to this patcher.

Adds/removes a border from a panel.  That's it.

Put it in a bpatcher to expose a single selectable LED.

Tuesday, December 20, 2011

ugly.dial for Max/MSP


update: newer version here.

My first Max patcher to be officially released is ugly.dial.  It is a MIDI control that rotates from 0 to 127.  You can adjust the lower and upper bounds with the two smaller dials located above the main dial.  Slam the value to the lower or upper bound by hitting the buttons next to these dials.

There is a text-editable label on top.  The dial's color can be changed by double clicking in-between the two smaller dials.  There are also three buttons on the lower left whose state can be read from outlets.  Finally there is a toggle on the lower right whose state can also read from an outlet.

The next version will connect the three lower left buttons to tempo sync'd ramp up and down.  This is a little tricky so I left that out for this release.  Release early and release often as they say.

peas 0.3 released

Peas defines constants from music theory and allows one to perform math with them. Currently supports pitches (as MIDI values), pitch classes, and intervals using semitones, wholetones, chromatic, latin or diatonic abbreviations.

Coming soon: circles (as in ‘circle of fifths’), scales, chords and chord progressions.

Code available on github.

Features

  • Defines common music theory constants:
    • PitchClass: C, Ds, Eb, etc
    • Pitch (as a MIDI value): C4, Ds5, Gb8, etc
    • Intervals:
      • Semitone: S0, S1, S2 … S127
      • Wholetone: W0, W1, W2 … W63
      • Chromatic: d2, A1, d3, A2 … A7
      • Latin: S, T and TT (semi, whole and tritones)
      • Diatonic: P1, m2, M2, m3, M3, P4, A4, d5, P5, m6, M6, m7, M7 and P8
  • Constants output as their name (done using named_value_class)
  • Adds helpers to Fixnum: 2.octaves, 3.semitones, 4.major_seconds, etc.

Installation

gem install peas

Requirements

Currently only tested with Ruby 1.9.2-p290.  named_value_class 0.7 gem required.

Usage

require 'peas'

include Peas::Pitches
include Peas::Intervals

def play_midi_note(pitch)
  # maybe use arirusso/micromidi here  
end

[Ab3,G3,Ab3,C2].each do |root_pitch|
  [P1,m3,P5,P5,d5].each do |interval|
    play_midi_note(root_pitch + interval)
    play_midi_note(root_pitch + interval + 2.octaves)
    play_midi_note(root_pitch - 2.tritones)
  end
end