This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'music_player' | |
include AudioToolbox | |
p = MusicPlayer.new | |
s = MusicSequence.new | |
t = MusicTrack.new(s) | |
s.midi_endpoint = CoreMIDI.get_destination(ARGV.shift.to_i) | |
t.add_midi_note_message 0.0, MIDINoteMessage.new(:pitch => 60, :velocity => 64) | |
t.add_midi_note_message 1.0, MIDINoteMessage.new(:pitch => 64, :velocity => 96) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; mmj: http://www.humatic.de/htools/mmj.htm | |
; rlwrap java -cp /usr/local/lib/clojure/clojure.jar:/usr/local/lib/mmj/mmj.jar -Djava.library.path=/usr/local/lib/mmj:/usr/lib/java clojure.lang.Repl | |
(ns org.jvoorhis.midi | |
(:import (de.humatic.mmj MidiSystem))) | |
(def out (MidiSystem/openMidiOutput 0)) | |
(defn make-note-on [c p v] | |
(let [msg (make-array (Byte/TYPE) 3)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PagingModelEnumerator # sketchy version :D | |
include Enumerable | |
def initialize(model, opts) | |
@model = model | |
@find_opts, @count_opts = parse_opts(opts) | |
end | |
def each(&block) | |
page_size = 50 |
NewerOlder