midilib 2.0.5 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/ChangeLog +2 -1
- data/Credits +39 -2
- data/README.rdoc +5 -6
- data/Rakefile +36 -49
- data/TODO.rdoc +13 -2
- data/examples/from_scratch.rb +1 -1
- data/examples/measures_mbt.rb +11 -11
- data/examples/print_program_changes.rb +2 -2
- data/examples/reader2text.rb +47 -47
- data/examples/seq2text.rb +1 -1
- data/examples/split.rb +4 -3
- data/examples/strings.rb +4 -4
- data/examples/transpose.rb +19 -20
- data/install.rb +21 -13
- data/lib/midilib/consts.rb +237 -239
- data/lib/midilib/event.rb +128 -100
- data/lib/midilib/info.rb +3 -5
- data/lib/midilib/io/midifile.rb +155 -182
- data/lib/midilib/io/seqreader.rb +80 -85
- data/lib/midilib/io/seqwriter.rb +93 -88
- data/lib/midilib/measure.rb +78 -80
- data/lib/midilib/mergesort.rb +39 -0
- data/lib/midilib/sequence.rb +40 -32
- data/lib/midilib/track.rb +16 -57
- data/lib/midilib/utils.rb +4 -7
- data/lib/midilib.rb +5 -5
- data/test/event_equality.rb +28 -30
- data/test/test_event.rb +9 -11
- data/test/test_io.rb +83 -3
- data/test/test_mergesort.rb +37 -0
- data/test/test_midifile.rb +6 -19
- data/test/test_sequence.rb +5 -4
- data/test/test_track.rb +9 -38
- data/test/test_varlen.rb +1 -3
- metadata +8 -95
- data/html/IO.html +0 -155
- data/html/MIDI/ActiveSense.html +0 -206
- data/html/MIDI/ChannelEvent.html +0 -231
- data/html/MIDI/ChannelPressure.html +0 -265
- data/html/MIDI/Clock.html +0 -206
- data/html/MIDI/Continue.html +0 -206
- data/html/MIDI/Controller.html +0 -280
- data/html/MIDI/Event.html +0 -489
- data/html/MIDI/IO/MIDIFile.html +0 -2024
- data/html/MIDI/IO/SeqReader.html +0 -904
- data/html/MIDI/IO/SeqWriter.html +0 -572
- data/html/MIDI/IO.html +0 -95
- data/html/MIDI/KeySig.html +0 -353
- data/html/MIDI/MIDI/MIDI/Array.html +0 -255
- data/html/MIDI/MIDI/MIDI.html +0 -95
- data/html/MIDI/MIDI.html +0 -95
- data/html/MIDI/Marker.html +0 -158
- data/html/MIDI/Measure.html +0 -328
- data/html/MIDI/Measures.html +0 -285
- data/html/MIDI/MetaEvent.html +0 -461
- data/html/MIDI/NoteEvent.html +0 -331
- data/html/MIDI/NoteOff.html +0 -228
- data/html/MIDI/NoteOn.html +0 -228
- data/html/MIDI/PitchBend.html +0 -266
- data/html/MIDI/PolyPressure.html +0 -277
- data/html/MIDI/ProgramChange.html +0 -265
- data/html/MIDI/Realtime.html +0 -242
- data/html/MIDI/Sequence.html +0 -896
- data/html/MIDI/SongPointer.html +0 -266
- data/html/MIDI/SongSelect.html +0 -265
- data/html/MIDI/Start.html +0 -206
- data/html/MIDI/Stop.html +0 -206
- data/html/MIDI/SystemCommon.html +0 -158
- data/html/MIDI/SystemExclusive.html +0 -268
- data/html/MIDI/SystemReset.html +0 -206
- data/html/MIDI/Tempo.html +0 -396
- data/html/MIDI/TimeSig.html +0 -388
- data/html/MIDI/Track.html +0 -695
- data/html/MIDI/TuneRequest.html +0 -242
- data/html/MIDI/Utils.html +0 -220
- data/html/MIDI.html +0 -547
- data/html/README_rdoc.html +0 -731
- data/html/TODO_rdoc.html +0 -125
- data/html/created.rid +0 -14
- data/html/css/fonts.css +0 -167
- data/html/css/rdoc.css +0 -590
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +0 -768
- data/html/js/darkfish.js +0 -161
- data/html/js/jquery.js +0 -4
- data/html/js/navigation.js +0 -142
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +0 -109
- data/html/js/search_index.js +0 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +0 -228
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +0 -1265
data/html/js/search.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
Search = function(data, input, result) {
|
|
2
|
-
this.data = data;
|
|
3
|
-
this.$input = $(input);
|
|
4
|
-
this.$result = $(result);
|
|
5
|
-
|
|
6
|
-
this.$current = null;
|
|
7
|
-
this.$view = this.$result.parent();
|
|
8
|
-
this.searcher = new Searcher(data.index);
|
|
9
|
-
this.init();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
Search.prototype = $.extend({}, Navigation, new function() {
|
|
13
|
-
var suid = 1;
|
|
14
|
-
|
|
15
|
-
this.init = function() {
|
|
16
|
-
var _this = this;
|
|
17
|
-
var observer = function(e) {
|
|
18
|
-
switch(e.originalEvent.keyCode) {
|
|
19
|
-
case 38: // Event.KEY_UP
|
|
20
|
-
case 40: // Event.KEY_DOWN
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
_this.search(_this.$input[0].value);
|
|
24
|
-
};
|
|
25
|
-
this.$input.keyup(observer);
|
|
26
|
-
this.$input.click(observer); // mac's clear field
|
|
27
|
-
|
|
28
|
-
this.searcher.ready(function(results, isLast) {
|
|
29
|
-
_this.addResults(results, isLast);
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
this.initNavigation();
|
|
33
|
-
this.setNavigationActive(false);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
this.search = function(value, selectFirstMatch) {
|
|
37
|
-
value = jQuery.trim(value).toLowerCase();
|
|
38
|
-
if (value) {
|
|
39
|
-
this.setNavigationActive(true);
|
|
40
|
-
} else {
|
|
41
|
-
this.setNavigationActive(false);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (value == '') {
|
|
45
|
-
this.lastQuery = value;
|
|
46
|
-
this.$result.empty();
|
|
47
|
-
this.$result.attr('aria-expanded', 'false');
|
|
48
|
-
this.setNavigationActive(false);
|
|
49
|
-
} else if (value != this.lastQuery) {
|
|
50
|
-
this.lastQuery = value;
|
|
51
|
-
this.$result.attr('aria-busy', 'true');
|
|
52
|
-
this.$result.attr('aria-expanded', 'true');
|
|
53
|
-
this.firstRun = true;
|
|
54
|
-
this.searcher.find(value);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
this.addResults = function(results, isLast) {
|
|
59
|
-
var target = this.$result.get(0);
|
|
60
|
-
if (this.firstRun && (results.length > 0 || isLast)) {
|
|
61
|
-
this.$current = null;
|
|
62
|
-
this.$result.empty();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
for (var i=0, l = results.length; i < l; i++) {
|
|
66
|
-
var item = this.renderItem.call(this, results[i]);
|
|
67
|
-
item.setAttribute('id', 'search-result-' + target.childElementCount);
|
|
68
|
-
target.appendChild(item);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
if (this.firstRun && results.length > 0) {
|
|
72
|
-
this.firstRun = false;
|
|
73
|
-
this.$current = $(target.firstChild);
|
|
74
|
-
this.$current.addClass('search-selected');
|
|
75
|
-
}
|
|
76
|
-
if (jQuery.browser.msie) this.$element[0].className += '';
|
|
77
|
-
|
|
78
|
-
if (isLast) this.$result.attr('aria-busy', 'false');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
this.move = function(isDown) {
|
|
82
|
-
if (!this.$current) return;
|
|
83
|
-
var $next = this.$current[isDown ? 'next' : 'prev']();
|
|
84
|
-
if ($next.length) {
|
|
85
|
-
this.$current.removeClass('search-selected');
|
|
86
|
-
$next.addClass('search-selected');
|
|
87
|
-
this.$input.attr('aria-activedescendant', $next.attr('id'));
|
|
88
|
-
this.scrollIntoView($next[0], this.$view[0]);
|
|
89
|
-
this.$current = $next;
|
|
90
|
-
this.$input.val($next[0].firstChild.firstChild.text);
|
|
91
|
-
this.$input.select();
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
this.hlt = function(html) {
|
|
97
|
-
return this.escapeHTML(html).
|
|
98
|
-
replace(/\u0001/g, '<em>').
|
|
99
|
-
replace(/\u0002/g, '</em>');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
this.escapeHTML = function(html) {
|
|
103
|
-
return html.replace(/[&<>]/g, function(c) {
|
|
104
|
-
return '&#' + c.charCodeAt(0) + ';';
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
});
|
|
109
|
-
|
data/html/js/search_index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var search_data = {"index":{"searchIndex":["io","midi","activesense","channelevent","channelpressure","clock","continue","controller","event","io","midifile","seqreader","seqwriter","keysig","midi","midi","array","marker","measure","measures","metaevent","noteevent","noteoff","noteoffevent","noteon","noteonevent","pitchbend","polypressure","programchange","realtime","sequence","songpointer","songselect","start","stop","systemcommon","systemexclusive","systemreset","tempo","timesig","track","tunerequest","utils","<=>()","arbitrary()","as_var_len()","bad_byte()","beats_per_minute()","bpm()","bpm_to_mpq()","bytes_as_str()","chan_message()","chan_pressure()","chan_pressure()","channel_to_s()","contains_event?()","controller()","controller()","data=()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_bytes()","data_as_str()","denominator()","each()","each()","end_track()","end_track()","eot()","error()","get_bytes()","get_measures()","getc()","handle_arbitrary()","handle_sysex()","header()","header()","instrument()","instrument=()","key_signature()","key_signature()","length_to_delta()","major_key?()","make_note_off()","measure_duration()","measure_for_event()","merge()","merge()","merge_event_lists()","mergesort()","meta_event()","meta_misc()","meta_misc()","metronome_ticks()","minor_key?()","mpq_to_bpm()","msg()","msg_add()","msg_init()","msg_read()","name()","name()","name=()","name=()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","note_off()","note_off()","note_on()","note_on()","note_to_delta()","note_to_length()","note_to_s()","note_to_s()","number_to_s()","numerator()","pch_oct()","pitch_bend()","pitch_bend()","possibly_munge_due_to_running_status_byte()","pressure()","pressure()","pressure()","pressure=()","program()","program()","pulses_to_seconds()","quantize()","quantize_to()","read()","read16()","read32()","read_from()","read_header()","read_mt_header_string()","read_track()","read_var_len()","readbyte()","recalc_delta_from_times()","recalc_times()","sequence_number()","sequencer_specific()","sharpflat()","smpte()","sort()","split()","start_track()","start_track()","str_as_bytes()","sysex()","sysex()","tempo()","tempo()","tempo()","tempo()","tempo=()","text()","text()","time_signature()","time_signature()","time_signature()","to_mbt()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","track_uses_channel()","write()","write16()","write16()","write32()","write32()","write_bytes()","write_header()","write_instrument()","write_to()","write_track()","write_var_len()","write_var_len()","readme","todo"],"longSearchIndex":["io","midi","midi::activesense","midi::channelevent","midi::channelpressure","midi::clock","midi::continue","midi::controller","midi::event","midi::io","midi::io::midifile","midi::io::seqreader","midi::io::seqwriter","midi::keysig","midi::midi","midi::midi::midi","midi::midi::midi::array","midi::marker","midi::measure","midi::measures","midi::metaevent","midi::noteevent","midi::noteoff","midi::noteoffevent","midi::noteon","midi::noteonevent","midi::pitchbend","midi::polypressure","midi::programchange","midi::realtime","midi::sequence","midi::songpointer","midi::songselect","midi::start","midi::stop","midi::systemcommon","midi::systemexclusive","midi::systemreset","midi::tempo","midi::timesig","midi::track","midi::tunerequest","midi::utils","midi::event#<=>()","midi::io::midifile#arbitrary()","midi::utils::as_var_len()","midi::io::midifile#bad_byte()","midi::sequence#beats_per_minute()","midi::sequence#bpm()","midi::tempo::bpm_to_mpq()","midi::metaevent::bytes_as_str()","midi::io::midifile#chan_message()","midi::io::midifile#chan_pressure()","midi::io::seqreader#chan_pressure()","midi::event#channel_to_s()","midi::measure#contains_event?()","midi::io::midifile#controller()","midi::io::seqreader#controller()","midi::metaevent#data=()","midi::channelpressure#data_as_bytes()","midi::controller#data_as_bytes()","midi::event#data_as_bytes()","midi::keysig#data_as_bytes()","midi::metaevent#data_as_bytes()","midi::noteevent#data_as_bytes()","midi::pitchbend#data_as_bytes()","midi::programchange#data_as_bytes()","midi::realtime#data_as_bytes()","midi::songpointer#data_as_bytes()","midi::songselect#data_as_bytes()","midi::systemexclusive#data_as_bytes()","midi::tempo#data_as_bytes()","midi::timesig#data_as_bytes()","midi::tunerequest#data_as_bytes()","midi::metaevent#data_as_str()","midi::timesig#denominator()","midi::sequence#each()","midi::track#each()","midi::io::midifile#end_track()","midi::io::seqreader#end_track()","midi::io::midifile#eot()","midi::io::midifile#error()","midi::io::midifile#get_bytes()","midi::sequence#get_measures()","midi::io::midifile#getc()","midi::io::midifile#handle_arbitrary()","midi::io::midifile#handle_sysex()","midi::io::midifile#header()","midi::io::seqreader#header()","midi::track#instrument()","midi::track#instrument=()","midi::io::midifile#key_signature()","midi::io::seqreader#key_signature()","midi::sequence#length_to_delta()","midi::keysig#major_key?()","midi::io::seqreader#make_note_off()","midi::timesig#measure_duration()","midi::measures#measure_for_event()","midi::midi::midi::array#merge()","midi::track#merge()","midi::track#merge_event_lists()","midi::midi::midi::array#mergesort()","midi::io::midifile#meta_event()","midi::io::midifile#meta_misc()","midi::io::seqreader#meta_misc()","midi::timesig#metronome_ticks()","midi::keysig#minor_key?()","midi::tempo::mpq_to_bpm()","midi::io::midifile#msg()","midi::io::midifile#msg_add()","midi::io::midifile#msg_init()","midi::io::midifile#msg_read()","midi::sequence#name()","midi::track#name()","midi::sequence#name=()","midi::track#name=()","midi::activesense::new()","midi::channelevent::new()","midi::channelpressure::new()","midi::clock::new()","midi::continue::new()","midi::controller::new()","midi::event::new()","midi::io::midifile::new()","midi::io::seqreader::new()","midi::io::seqwriter::new()","midi::keysig::new()","midi::marker::new()","midi::measure::new()","midi::measures::new()","midi::metaevent::new()","midi::noteevent::new()","midi::noteoff::new()","midi::noteoff::new()","midi::noteon::new()","midi::noteon::new()","midi::pitchbend::new()","midi::polypressure::new()","midi::programchange::new()","midi::realtime::new()","midi::sequence::new()","midi::songpointer::new()","midi::songselect::new()","midi::start::new()","midi::stop::new()","midi::systemcommon::new()","midi::systemexclusive::new()","midi::systemreset::new()","midi::tempo::new()","midi::timesig::new()","midi::track::new()","midi::tunerequest::new()","midi::io::midifile#note_off()","midi::io::seqreader#note_off()","midi::io::midifile#note_on()","midi::io::seqreader#note_on()","midi::sequence#note_to_delta()","midi::sequence#note_to_length()","midi::noteevent#note_to_s()","midi::utils::note_to_s()","midi::event#number_to_s()","midi::timesig#numerator()","midi::noteevent#pch_oct()","midi::io::midifile#pitch_bend()","midi::io::seqreader#pitch_bend()","midi::io::seqwriter#possibly_munge_due_to_running_status_byte()","midi::io::midifile#pressure()","midi::io::seqreader#pressure()","midi::polypressure#pressure()","midi::polypressure#pressure=()","midi::io::midifile#program()","midi::io::seqreader#program()","midi::sequence#pulses_to_seconds()","midi::track#quantize()","midi::event#quantize_to()","midi::sequence#read()","midi::io::midifile#read16()","midi::io::midifile#read32()","midi::io::midifile#read_from()","midi::io::midifile#read_header()","midi::io::midifile#read_mt_header_string()","midi::io::midifile#read_track()","midi::io::midifile#read_var_len()","io#readbyte()","midi::track#recalc_delta_from_times()","midi::track#recalc_times()","midi::io::midifile#sequence_number()","midi::io::midifile#sequencer_specific()","midi::keysig#sharpflat()","midi::io::midifile#smpte()","midi::track#sort()","midi::midi::midi::array#split()","midi::io::midifile#start_track()","midi::io::seqreader#start_track()","midi::metaevent::str_as_bytes()","midi::io::midifile#sysex()","midi::io::seqreader#sysex()","midi::io::midifile#tempo()","midi::io::seqreader#tempo()","midi::sequence#tempo()","midi::tempo#tempo()","midi::tempo#tempo=()","midi::io::midifile#text()","midi::io::seqreader#text()","midi::io::midifile#time_signature()","midi::io::seqreader#time_signature()","midi::sequence#time_signature()","midi::measures#to_mbt()","midi::activesense#to_s()","midi::channelevent#to_s()","midi::channelpressure#to_s()","midi::clock#to_s()","midi::continue#to_s()","midi::controller#to_s()","midi::event#to_s()","midi::keysig#to_s()","midi::measure#to_s()","midi::metaevent#to_s()","midi::noteoff#to_s()","midi::noteoff#to_s()","midi::noteon#to_s()","midi::noteon#to_s()","midi::pitchbend#to_s()","midi::polypressure#to_s()","midi::programchange#to_s()","midi::realtime#to_s()","midi::songpointer#to_s()","midi::songselect#to_s()","midi::start#to_s()","midi::stop#to_s()","midi::systemexclusive#to_s()","midi::systemreset#to_s()","midi::tempo#to_s()","midi::timesig#to_s()","midi::tunerequest#to_s()","midi::io::seqreader#track_uses_channel()","midi::sequence#write()","midi::io::midifile#write16()","midi::io::seqwriter#write16()","midi::io::midifile#write32()","midi::io::seqwriter#write32()","midi::io::seqwriter#write_bytes()","midi::io::seqwriter#write_header()","midi::io::seqwriter#write_instrument()","midi::io::seqwriter#write_to()","midi::io::seqwriter#write_track()","midi::io::midifile#write_var_len()","midi::io::seqwriter#write_var_len()","",""],"info":[["IO","","IO.html","",""],["MIDI","","MIDI.html","","<p>MIDI constants.\n"],["MIDI::ActiveSense","","MIDI/ActiveSense.html","",""],["MIDI::ChannelEvent","","MIDI/ChannelEvent.html","","<p>The abstract superclass of all channel events (events that have a MIDI\nchannel, like notes and program …\n"],["MIDI::ChannelPressure","","MIDI/ChannelPressure.html","",""],["MIDI::Clock","","MIDI/Clock.html","",""],["MIDI::Continue","","MIDI/Continue.html","",""],["MIDI::Controller","","MIDI/Controller.html","",""],["MIDI::Event","","MIDI/Event.html","","<p>The abstract superclass of all MIDI events.\n"],["MIDI::IO","","MIDI/IO.html","",""],["MIDI::IO::MIDIFile","","MIDI/IO/MIDIFile.html","","<p>A MIDIFile parses a MIDI file and calls methods when it sees MIDI events.\nMost of the methods are stubs. …\n"],["MIDI::IO::SeqReader","","MIDI/IO/SeqReader.html","","<p>Reads MIDI files. As a subclass of MIDIFile, this class implements the\ncallback methods for each MIDI …\n"],["MIDI::IO::SeqWriter","","MIDI/IO/SeqWriter.html","",""],["MIDI::KeySig","","MIDI/KeySig.html","","<p>Container for key signature events\n"],["MIDI::MIDI","","MIDI/MIDI.html","",""],["MIDI::MIDI::MIDI","","MIDI/MIDI/MIDI.html","",""],["MIDI::MIDI::MIDI::Array","","MIDI/MIDI/MIDI/Array.html","","<p>This is taken from\ngithub.com/adamjmurray/cosy/blob/master/lib/cosy/helper/midi_file_renderer_helper.rb\n…\n"],["MIDI::Marker","","MIDI/Marker.html","",""],["MIDI::Measure","","MIDI/Measure.html","","<p>The Measure class contains information about a measure from the sequence.\nThe measure data is based on …\n"],["MIDI::Measures","","MIDI/Measures.html","","<p>A specialized container for MIDI::Measure objects, which can be use to map\nevent times to measure numbers. …\n"],["MIDI::MetaEvent","","MIDI/MetaEvent.html","",""],["MIDI::NoteEvent","","MIDI/NoteEvent.html","","<p>The abstract superclass of all note on, and note off, and polyphonic\npressure events.\n"],["MIDI::NoteOff","","MIDI/NoteOff.html","",""],["MIDI::NoteOffEvent","","MIDI/NoteOff.html","",""],["MIDI::NoteOn","","MIDI/NoteOn.html","",""],["MIDI::NoteOnEvent","","MIDI/NoteOn.html","",""],["MIDI::PitchBend","","MIDI/PitchBend.html","",""],["MIDI::PolyPressure","","MIDI/PolyPressure.html","",""],["MIDI::ProgramChange","","MIDI/ProgramChange.html","",""],["MIDI::Realtime","","MIDI/Realtime.html","",""],["MIDI::Sequence","","MIDI/Sequence.html","","<p>A MIDI::Sequence contains MIDI::Track objects.\n"],["MIDI::SongPointer","","MIDI/SongPointer.html","",""],["MIDI::SongSelect","","MIDI/SongSelect.html","",""],["MIDI::Start","","MIDI/Start.html","",""],["MIDI::Stop","","MIDI/Stop.html","",""],["MIDI::SystemCommon","","MIDI/SystemCommon.html","",""],["MIDI::SystemExclusive","","MIDI/SystemExclusive.html","",""],["MIDI::SystemReset","","MIDI/SystemReset.html","",""],["MIDI::Tempo","","MIDI/Tempo.html","",""],["MIDI::TimeSig","","MIDI/TimeSig.html","","<p>Container for time signature events\n"],["MIDI::Track","","MIDI/Track.html","","<p>A Track is a list of events.\n<p>When you modify the <code>events</code> array, make sure to call\nrecalc_times so each …\n"],["MIDI::TuneRequest","","MIDI/TuneRequest.html","",""],["MIDI::Utils","","MIDI/Utils.html","","<p>Utility methods.\n"],["<=>","MIDI::Event","MIDI/Event.html#method-i-3C-3D-3E","(an_event)","<p>For sorting. Uses @time_from_start, which is maintained by this event's\ntrack. I'm not sure this …\n"],["arbitrary","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-arbitrary","(msg)",""],["as_var_len","MIDI::Utils","MIDI/Utils.html#method-c-as_var_len","(val)","<p>Given an integer, returns it as a variable length array of bytes (the\nformat used by MIDI files).\n<p>The …\n"],["bad_byte","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-bad_byte","(c)","<p>Handle an unexpected byte.\n"],["beats_per_minute","MIDI::Sequence","MIDI/Sequence.html#method-i-beats_per_minute","()","<p>Returns the song tempo in beats per minute.\n"],["bpm","MIDI::Sequence","MIDI/Sequence.html#method-i-bpm","()",""],["bpm_to_mpq","MIDI::Tempo","MIDI/Tempo.html#method-c-bpm_to_mpq","(bpm)","<p>Translates beats per minute to microseconds per quarter note (beat).\n"],["bytes_as_str","MIDI::MetaEvent","MIDI/MetaEvent.html#method-c-bytes_as_str","(bytes)",""],["chan_message","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-chan_message","(running, status, c1, c2)","<p>Handle a channel message (note on, note off, etc.)\n"],["chan_pressure","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-chan_pressure","(chan, press)",""],["chan_pressure","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-chan_pressure","(chan, press)",""],["channel_to_s","MIDI::Event","MIDI/Event.html#method-i-channel_to_s","(val)","<p>Returns <code>val</code> as a decimal or hex string, depending upon the\nvalue of @print_decimal_numbers.\n"],["contains_event?","MIDI::Measure","MIDI/Measure.html#method-i-contains_event-3F","(e)","<p>Returns <code>true</code> if the event is in the measure\n"],["controller","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-controller","(chan, control, value)",""],["controller","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-controller","(chan, control, value)",""],["data=","MIDI::MetaEvent","MIDI/MetaEvent.html#method-i-data-3D","(data)","<p>Stores bytes. If data is a string, splits it into an array of bytes.\n"],["data_as_bytes","MIDI::ChannelPressure","MIDI/ChannelPressure.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::Controller","MIDI/Controller.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::Event","MIDI/Event.html#method-i-data_as_bytes","()","<p>Returns the raw bytes that are written to a MIDI file or output to a MIDI\nstream. In MIDI::EVENT this …\n"],["data_as_bytes","MIDI::KeySig","MIDI/KeySig.html#method-i-data_as_bytes","()","<p>Returns the complete event as stored in the sequence\n"],["data_as_bytes","MIDI::MetaEvent","MIDI/MetaEvent.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::NoteEvent","MIDI/NoteEvent.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::PitchBend","MIDI/PitchBend.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::ProgramChange","MIDI/ProgramChange.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::Realtime","MIDI/Realtime.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::SongPointer","MIDI/SongPointer.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::SongSelect","MIDI/SongSelect.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::SystemExclusive","MIDI/SystemExclusive.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::Tempo","MIDI/Tempo.html#method-i-data_as_bytes","()",""],["data_as_bytes","MIDI::TimeSig","MIDI/TimeSig.html#method-i-data_as_bytes","()","<p>Returns the complete event as stored in the sequence\n"],["data_as_bytes","MIDI::TuneRequest","MIDI/TuneRequest.html#method-i-data_as_bytes","()",""],["data_as_str","MIDI::MetaEvent","MIDI/MetaEvent.html#method-i-data_as_str","()",""],["denominator","MIDI::TimeSig","MIDI/TimeSig.html#method-i-denominator","()","<p>Returns the denominator of the time signature. Use it as a power of 2 to\nget the displayed (lower-part) …\n"],["each","MIDI::Sequence","MIDI/Sequence.html#method-i-each","()","<p>Iterates over the tracks.\n"],["each","MIDI::Track","MIDI/Track.html#method-i-each","()","<p>Iterate over events.\n"],["end_track","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-end_track","()",""],["end_track","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-end_track","()",""],["eot","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-eot","()",""],["error","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-error","(str)","<p>The default error handler.\n"],["get_bytes","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-get_bytes","(n)","<p>Return the next <code>n</code> bytes from @io as an array.\n"],["get_measures","MIDI::Sequence","MIDI/Sequence.html#method-i-get_measures","()","<p>Returns a Measures object, which is an array container for all measures in\nthe sequence\n"],["getc","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-getc","()","<p>This default getc implementation tries to read a single byte from io and\nreturns it as an integer.\n"],["handle_arbitrary","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-handle_arbitrary","(msg)","<p>Copy message into raw data array, then call arbitrary().\n"],["handle_sysex","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-handle_sysex","(msg)","<p>Copy message into raw data array, then call sysex().\n"],["header","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-header","(format, ntrks, division)","<p>MIDI header.\n"],["header","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-header","(format, ntrks, division)",""],["instrument","MIDI::Track","MIDI/Track.html#method-i-instrument","()",""],["instrument=","MIDI::Track","MIDI/Track.html#method-i-instrument-3D","(str_or_bytes)",""],["key_signature","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-key_signature","(sharpflat, is_minor)",""],["key_signature","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-key_signature","(sharpflat, is_minor)",""],["length_to_delta","MIDI::Sequence","MIDI/Sequence.html#method-i-length_to_delta","(length)","<p>Translates <code>length</code> (a multiple of a quarter note) into a delta\ntime. For example, 1 is a quarter note, …\n"],["major_key?","MIDI::KeySig","MIDI/KeySig.html#method-i-major_key-3F","()","<p>Returns true if it's a major key, false if minor key\n"],["make_note_off","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-make_note_off","(on, vel)",""],["measure_duration","MIDI::TimeSig","MIDI/TimeSig.html#method-i-measure_duration","(ppqn)","<p>Calculates the duration (in ticks) for a full measure\n"],["measure_for_event","MIDI::Measures","MIDI/Measures.html#method-i-measure_for_event","(e)","<p>Returns the MIDI::Measure object where the event is located. Returns\n<code>nil</code> if the event isn't found …\n"],["merge","MIDI::MIDI::MIDI::Array","MIDI/MIDI/MIDI/Array.html#method-i-merge","(first, second, &predicate)",""],["merge","MIDI::Track","MIDI/Track.html#method-i-merge","(event_list)","<p>Merges an array of events into our event list. After merging, the\nevents' time_from_start values …\n"],["merge_event_lists","MIDI::Track","MIDI/Track.html#method-i-merge_event_lists","(list1, list2)","<p>Merges two event arrays together. Does not modify this track.\n"],["mergesort","MIDI::MIDI::MIDI::Array","MIDI/MIDI/MIDI/Array.html#method-i-mergesort","(&cmp)","<p>A stable sorting algorithm that maintains the relative order of equal\nelements\n"],["meta_event","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-meta_event","(type)","<p>Handle a meta event.\n"],["meta_misc","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-meta_misc","(type, msg)",""],["meta_misc","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-meta_misc","(type, msg)",""],["metronome_ticks","MIDI::TimeSig","MIDI/TimeSig.html#method-i-metronome_ticks","()","<p>Returns the metronome tick duration for the time signature. On each quarter\nnote, there's 24 ticks. …\n"],["minor_key?","MIDI::KeySig","MIDI/KeySig.html#method-i-minor_key-3F","()","<p>Returns true if it's a minor key, false if major key\n"],["mpq_to_bpm","MIDI::Tempo","MIDI/Tempo.html#method-c-mpq_to_bpm","(mpq)","<p>Translates microseconds per quarter note (beat) to beats per minute.\n"],["msg","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-msg","()","<p>Return a copy of the internal message buffer.\n"],["msg_add","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-msg_add","(c)","<p>Add a byte to the current message buffer.\n"],["msg_init","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-msg_init","()","<p>Initialize the internal message buffer.\n"],["msg_read","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-msg_read","(n_bytes)","<p>Read and add a number of bytes to the message buffer. Return the last byte\n(so we can see if it's …\n"],["name","MIDI::Sequence","MIDI/Sequence.html#method-i-name","()","<p>Returns the name of the first track (track zero). If there are no tracks,\nreturns UNNAMED.\n"],["name","MIDI::Track","MIDI/Track.html#method-i-name","()","<p>Return track name. If there is no name, return UNNAMED.\n"],["name=","MIDI::Sequence","MIDI/Sequence.html#method-i-name-3D","(name)","<p>Hands the name to the first track. Does nothing if there are no tracks.\n"],["name=","MIDI::Track","MIDI/Track.html#method-i-name-3D","(name)","<p>Set track name. Replaces or creates a name meta-event.\n"],["new","MIDI::ActiveSense","MIDI/ActiveSense.html#method-c-new","(delta_time = 0)",""],["new","MIDI::ChannelEvent","MIDI/ChannelEvent.html#method-c-new","(status, channel, delta_time)",""],["new","MIDI::ChannelPressure","MIDI/ChannelPressure.html#method-c-new","(channel = 0, pressure = 0, delta_time = 0)",""],["new","MIDI::Clock","MIDI/Clock.html#method-c-new","(delta_time = 0)",""],["new","MIDI::Continue","MIDI/Continue.html#method-c-new","(delta_time = 0)",""],["new","MIDI::Controller","MIDI/Controller.html#method-c-new","(channel = 0, controller = 0, value = 0, delta_time = 0)",""],["new","MIDI::Event","MIDI/Event.html#method-c-new","(status = 0, delta_time = 0)",""],["new","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-c-new","()",""],["new","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-c-new","(seq, proc = nil)","<p>The optional proc block is called once at the start of the file and again\nat the end of each track. …\n"],["new","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-c-new","(seq, proc = nil)",""],["new","MIDI::KeySig","MIDI/KeySig.html#method-c-new","(sharpflat, is_minor, delta_time = 0)","<p>Constructor\n"],["new","MIDI::Marker","MIDI/Marker.html#method-c-new","(msg, delta_time = 0)",""],["new","MIDI::Measure","MIDI/Measure.html#method-c-new","(meas_no, start_time, duration, numer, denom, met_ticks)","<p>Constructor\n"],["new","MIDI::Measures","MIDI/Measures.html#method-c-new","(max_time, ppqd)","<p>Constructor\n"],["new","MIDI::MetaEvent","MIDI/MetaEvent.html#method-c-new","(meta_type, data = nil, delta_time = 0)",""],["new","MIDI::NoteEvent","MIDI/NoteEvent.html#method-c-new","(status, channel, note, velocity, delta_time)",""],["new","MIDI::NoteOff","MIDI/NoteOff.html#method-c-new","(channel = 0, note = 64, velocity = 64, delta_time = 0)",""],["new","MIDI::NoteOff","MIDI/NoteOff.html#method-c-new","(channel = 0, note = 64, velocity = 64, delta_time = 0)",""],["new","MIDI::NoteOn","MIDI/NoteOn.html#method-c-new","(channel = 0, note = 64, velocity = 64, delta_time = 0)",""],["new","MIDI::NoteOn","MIDI/NoteOn.html#method-c-new","(channel = 0, note = 64, velocity = 64, delta_time = 0)",""],["new","MIDI::PitchBend","MIDI/PitchBend.html#method-c-new","(channel = 0, value = 0, delta_time = 0)",""],["new","MIDI::PolyPressure","MIDI/PolyPressure.html#method-c-new","(channel = 0, note = 64, value = 0, delta_time = 0)",""],["new","MIDI::ProgramChange","MIDI/ProgramChange.html#method-c-new","(channel = 0, program = 0, delta_time = 0)",""],["new","MIDI::Realtime","MIDI/Realtime.html#method-c-new","(status, delta_time)",""],["new","MIDI::Sequence","MIDI/Sequence.html#method-c-new","()",""],["new","MIDI::SongPointer","MIDI/SongPointer.html#method-c-new","(pointer = 0, delta_time = 0)",""],["new","MIDI::SongSelect","MIDI/SongSelect.html#method-c-new","(song = 0, delta_time = 0)",""],["new","MIDI::Start","MIDI/Start.html#method-c-new","(delta_time = 0)",""],["new","MIDI::Stop","MIDI/Stop.html#method-c-new","(delta_time = 0)",""],["new","MIDI::SystemCommon","MIDI/SystemCommon.html#method-c-new","(status, delta_time)",""],["new","MIDI::SystemExclusive","MIDI/SystemExclusive.html#method-c-new","(data, delta_time = 0)",""],["new","MIDI::SystemReset","MIDI/SystemReset.html#method-c-new","(delta_time = 0)",""],["new","MIDI::Tempo","MIDI/Tempo.html#method-c-new","(msecs_per_qnote, delta_time = 0)",""],["new","MIDI::TimeSig","MIDI/TimeSig.html#method-c-new","(numer, denom, clocks, qnotes, delta_time = 0)","<p>Constructor\n"],["new","MIDI::Track","MIDI/Track.html#method-c-new","(sequence)",""],["new","MIDI::TuneRequest","MIDI/TuneRequest.html#method-c-new","(delta_time = 0)",""],["note_off","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-note_off","(chan, note, vel)",""],["note_off","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-note_off","(chan, note, vel)",""],["note_on","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-note_on","(chan, note, vel)",""],["note_on","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-note_on","(chan, note, vel)",""],["note_to_delta","MIDI::Sequence","MIDI/Sequence.html#method-i-note_to_delta","(name)","<p>Given a note length name like “whole”, “dotted quarter”, or “8th triplet”,\n…\n"],["note_to_length","MIDI::Sequence","MIDI/Sequence.html#method-i-note_to_length","(name)","<p>Given a note length name like “whole”, “dotted quarter”, or “8th triplet”,\n…\n"],["note_to_s","MIDI::NoteEvent","MIDI/NoteEvent.html#method-i-note_to_s","()","<p>If @print_note_names is true, returns pch_oct(val) else returns value as a\nnumber using number_to_s. …\n"],["note_to_s","MIDI::Utils","MIDI/Utils.html#method-c-note_to_s","(num)","<p>Given a MIDI note number, return the name and octave as a string.\n"],["number_to_s","MIDI::Event","MIDI/Event.html#method-i-number_to_s","(val)","<p>Returns <code>val</code> as a decimal or hex string, depending upon the\nvalue of @print_decimal_numbers.\n"],["numerator","MIDI::TimeSig","MIDI/TimeSig.html#method-i-numerator","()","<p>Returns the numerator (the top digit) for the time signature\n"],["pch_oct","MIDI::NoteEvent","MIDI/NoteEvent.html#method-i-pch_oct","(val=@note)","<p>Returns note name as a pitch/octave string like “C4” or “F#6”.\n"],["pitch_bend","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-pitch_bend","(chan, msb, lsb)",""],["pitch_bend","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-pitch_bend","(chan, lsb, msb)",""],["possibly_munge_due_to_running_status_byte","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-possibly_munge_due_to_running_status_byte","(data, prev_status)","<p>If we can use a running status byte, delete the status byte from the given\ndata. Return the status to …\n"],["pressure","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-pressure","(chan, note, press)",""],["pressure","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-pressure","(chan, note, press)",""],["pressure","MIDI::PolyPressure","MIDI/PolyPressure.html#method-i-pressure","()",""],["pressure=","MIDI::PolyPressure","MIDI/PolyPressure.html#method-i-pressure-3D","(val)",""],["program","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-program","(chan, program)",""],["program","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-program","(chan, program)",""],["pulses_to_seconds","MIDI::Sequence","MIDI/Sequence.html#method-i-pulses_to_seconds","(pulses)","<p>Pulses (also called ticks) are the units of delta times and event\ntime_from_start values. This method …\n"],["quantize","MIDI::Track","MIDI/Track.html#method-i-quantize","(length_or_note)","<p>Quantize every event. length_or_note is either a length (1 = quarter, 0.25\n= sixteenth, 4 = whole note) …\n"],["quantize_to","MIDI::Event","MIDI/Event.html#method-i-quantize_to","(boundary)","<p>Quantize this event's time_from_start by moving it to the nearest\nmultiple of <code>boundary</code>. See MIDI::Track#quantize …\n"],["read","MIDI::Sequence","MIDI/Sequence.html#method-i-read","(io, proc = nil)","<p>Reads a MIDI stream.\n"],["read16","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read16","()","<p>Read and return a sixteen bit value.\n"],["read32","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read32","()","<p>Read and return a 32-bit value.\n"],["read_from","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read_from","(io)","<p>The only public method. Each MIDI event in the file causes a method to be\ncalled.\n"],["read_header","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read_header","()","<p>Read a header chunk.\n"],["read_mt_header_string","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read_mt_header_string","(bytes, skip)","<p>Read through 'MThd' or 'MTrk' header string. If skip is\ntrue, attempt to skip initial …\n"],["read_track","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read_track","()","<p>Read a track chunk.\n"],["read_var_len","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-read_var_len","()","<p>Read a varlen value.\n"],["readbyte","IO","IO.html#method-i-readbyte","()",""],["recalc_delta_from_times","MIDI::Track","MIDI/Track.html#method-i-recalc_delta_from_times","(starting_at=0, list=@events)","<p>The opposite of recalc_times: recalculates delta_time for each event from\neach event's time_from_start. …\n"],["recalc_times","MIDI::Track","MIDI/Track.html#method-i-recalc_times","(starting_at=0, list=@events)","<p>Recalculate start times for all events in <code>list</code> from\nstarting_at to end.\n"],["sequence_number","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-sequence_number","(num)",""],["sequencer_specific","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-sequencer_specific","(type, msg)",""],["sharpflat","MIDI::KeySig","MIDI/KeySig.html#method-i-sharpflat","()","<p>Returns the number of sharps/flats in the key sig. Negative for flats.\n"],["smpte","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-smpte","(hour, min, sec, frame, fract)",""],["sort","MIDI::Track","MIDI/Track.html#method-i-sort","(starting_at=0, list=@events)","<p>Sort events by their time_from_start. After sorting,\nrecalc_delta_from_times is called to make sure that …\n"],["split","MIDI::MIDI::MIDI::Array","MIDI/MIDI/MIDI/Array.html#method-i-split","()",""],["start_track","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-start_track","(bytes_to_be_read)",""],["start_track","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-start_track","()",""],["str_as_bytes","MIDI::MetaEvent","MIDI/MetaEvent.html#method-c-str_as_bytes","(str)",""],["sysex","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-sysex","(msg)",""],["sysex","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-sysex","(msg)",""],["tempo","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-tempo","(microsecs)",""],["tempo","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-tempo","(microsecs)","<p>–\n\n<pre class=\"ruby\"><span class=\"ruby-keyword\">def</span> <span class=\"ruby-identifier\">smpte</span>(<span class=\"ruby-identifier\">hour</span>, <span class=\"ruby-identifier\">min</span>, <span class=\"ruby-identifier\">sec</span>, <span class=\"ruby-identifier\">frame</span>, <span class=\"ruby-identifier\">fract</span>)\n<span class=\"ruby-keyword\">end</span>\n</pre>\n<p>++\n"],["tempo","MIDI::Sequence","MIDI/Sequence.html#method-i-tempo","()",""],["tempo","MIDI::Tempo","MIDI/Tempo.html#method-i-tempo","()",""],["tempo=","MIDI::Tempo","MIDI/Tempo.html#method-i-tempo-3D","(val)",""],["text","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-text","(type, msg)",""],["text","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-text","(type, msg)","\n<pre class=\"ruby\"><span class=\"ruby-keyword\">def</span> <span class=\"ruby-identifier\">sequence_number</span>(<span class=\"ruby-identifier\">num</span>)\n<span class=\"ruby-keyword\">end</span>\n</pre>\n<p>++\n"],["time_signature","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-time_signature","(numer, denom, clocks, qnotes)",""],["time_signature","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-time_signature","(numer, denom, clocks, qnotes)","<p>– Don't bother adding the META_TRACK_END event to the track. This way,\nwe don't have to worry …\n"],["time_signature","MIDI::Sequence","MIDI/Sequence.html#method-i-time_signature","(numer, denom, clocks, qnotes)","<p>Sets the time signature.\n"],["to_mbt","MIDI::Measures","MIDI/Measures.html#method-i-to_mbt","(e)","<p>Returns the event's time as a formatted MBT string (Measure:Beat:Ticks)\nas found in MIDI sequencers. …\n"],["to_s","MIDI::ActiveSense","MIDI/ActiveSense.html#method-i-to_s","()",""],["to_s","MIDI::ChannelEvent","MIDI/ChannelEvent.html#method-i-to_s","()",""],["to_s","MIDI::ChannelPressure","MIDI/ChannelPressure.html#method-i-to_s","()",""],["to_s","MIDI::Clock","MIDI/Clock.html#method-i-to_s","()",""],["to_s","MIDI::Continue","MIDI/Continue.html#method-i-to_s","()",""],["to_s","MIDI::Controller","MIDI/Controller.html#method-i-to_s","()",""],["to_s","MIDI::Event","MIDI/Event.html#method-i-to_s","()",""],["to_s","MIDI::KeySig","MIDI/KeySig.html#method-i-to_s","()","<p>Returns the key signature as a text string. Example: “key sig A flat major”\n"],["to_s","MIDI::Measure","MIDI/Measure.html#method-i-to_s","()","<p>Returns a detailed string with information about the measure\n"],["to_s","MIDI::MetaEvent","MIDI/MetaEvent.html#method-i-to_s","()",""],["to_s","MIDI::NoteOff","MIDI/NoteOff.html#method-i-to_s","()",""],["to_s","MIDI::NoteOff","MIDI/NoteOff.html#method-i-to_s","()",""],["to_s","MIDI::NoteOn","MIDI/NoteOn.html#method-i-to_s","()",""],["to_s","MIDI::NoteOn","MIDI/NoteOn.html#method-i-to_s","()",""],["to_s","MIDI::PitchBend","MIDI/PitchBend.html#method-i-to_s","()",""],["to_s","MIDI::PolyPressure","MIDI/PolyPressure.html#method-i-to_s","()",""],["to_s","MIDI::ProgramChange","MIDI/ProgramChange.html#method-i-to_s","()",""],["to_s","MIDI::Realtime","MIDI/Realtime.html#method-i-to_s","()",""],["to_s","MIDI::SongPointer","MIDI/SongPointer.html#method-i-to_s","()",""],["to_s","MIDI::SongSelect","MIDI/SongSelect.html#method-i-to_s","()",""],["to_s","MIDI::Start","MIDI/Start.html#method-i-to_s","()",""],["to_s","MIDI::Stop","MIDI/Stop.html#method-i-to_s","()",""],["to_s","MIDI::SystemExclusive","MIDI/SystemExclusive.html#method-i-to_s","()",""],["to_s","MIDI::SystemReset","MIDI/SystemReset.html#method-i-to_s","()",""],["to_s","MIDI::Tempo","MIDI/Tempo.html#method-i-to_s","()",""],["to_s","MIDI::TimeSig","MIDI/TimeSig.html#method-i-to_s","()","<p>Returns the time signature for the event as a string. Example: “time sig\n3/4”\n"],["to_s","MIDI::TuneRequest","MIDI/TuneRequest.html#method-i-to_s","()",""],["track_uses_channel","MIDI::IO::SeqReader","MIDI/IO/SeqReader.html#method-i-track_uses_channel","(chan)","<p>Return true if the current track uses the specified channel.\n"],["write","MIDI::Sequence","MIDI/Sequence.html#method-i-write","(io, proc = nil)","<p>Writes to a MIDI stream.\n"],["write16","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-write16","(val)","<p>Write a sixteen-bit value.\n"],["write16","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write16","(val)",""],["write32","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-write32","(val)","<p>Write a 32-bit value.\n"],["write32","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write32","(val)",""],["write_bytes","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write_bytes","(bytes)",""],["write_header","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write_header","()",""],["write_instrument","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write_instrument","(instrument)",""],["write_to","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write_to","(io)","<p>Writes a MIDI format 1 file.\n"],["write_track","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write_track","(track)",""],["write_var_len","MIDI::IO::MIDIFile","MIDI/IO/MIDIFile.html#method-i-write_var_len","(val)","<p>Write a variable length value.\n"],["write_var_len","MIDI::IO::SeqWriter","MIDI/IO/SeqWriter.html#method-i-write_var_len","(val)",""],["README","","README_rdoc.html","","<p>midilib\n<p>midilib is a pure Ruby MIDI library useful for reading and writing standard\nMIDI files and manipulating …\n"],["TODO","","TODO_rdoc.html","","<p>Bugs\n<p>No known bugs. (If that's not a challenge, I don't know what is.)\n<p>Features\n"]]}}
|
data/html/js/search_index.js.gz
DELETED
|
Binary file
|
data/html/js/searcher.js
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
Searcher = function(data) {
|
|
2
|
-
this.data = data;
|
|
3
|
-
this.handlers = [];
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
Searcher.prototype = new function() {
|
|
7
|
-
// search is performed in chunks of 1000 for non-blocking user input
|
|
8
|
-
var CHUNK_SIZE = 1000;
|
|
9
|
-
// do not try to find more than 100 results
|
|
10
|
-
var MAX_RESULTS = 100;
|
|
11
|
-
var huid = 1;
|
|
12
|
-
var suid = 1;
|
|
13
|
-
var runs = 0;
|
|
14
|
-
|
|
15
|
-
this.find = function(query) {
|
|
16
|
-
var queries = splitQuery(query);
|
|
17
|
-
var regexps = buildRegexps(queries);
|
|
18
|
-
var highlighters = buildHilighters(queries);
|
|
19
|
-
var state = { from: 0, pass: 0, limit: MAX_RESULTS, n: suid++};
|
|
20
|
-
var _this = this;
|
|
21
|
-
|
|
22
|
-
this.currentSuid = state.n;
|
|
23
|
-
|
|
24
|
-
if (!query) return;
|
|
25
|
-
|
|
26
|
-
var run = function() {
|
|
27
|
-
// stop current search thread if new search started
|
|
28
|
-
if (state.n != _this.currentSuid) return;
|
|
29
|
-
|
|
30
|
-
var results =
|
|
31
|
-
performSearch(_this.data, regexps, queries, highlighters, state);
|
|
32
|
-
var hasMore = (state.limit > 0 && state.pass < 4);
|
|
33
|
-
|
|
34
|
-
triggerResults.call(_this, results, !hasMore);
|
|
35
|
-
if (hasMore) {
|
|
36
|
-
setTimeout(run, 2);
|
|
37
|
-
}
|
|
38
|
-
runs++;
|
|
39
|
-
};
|
|
40
|
-
runs = 0;
|
|
41
|
-
|
|
42
|
-
// start search thread
|
|
43
|
-
run();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* ----- Events ------ */
|
|
47
|
-
this.ready = function(fn) {
|
|
48
|
-
fn.huid = huid;
|
|
49
|
-
this.handlers.push(fn);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* ----- Utilities ------ */
|
|
53
|
-
function splitQuery(query) {
|
|
54
|
-
return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
|
|
55
|
-
return string.match(/\S/)
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function buildRegexps(queries) {
|
|
60
|
-
return jQuery.map(queries, function(query) {
|
|
61
|
-
return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function buildHilighters(queries) {
|
|
66
|
-
return jQuery.map(queries, function(query) {
|
|
67
|
-
return jQuery.map(query.split(''), function(l, i) {
|
|
68
|
-
return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
|
|
69
|
-
}).join('');
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// function longMatchRegexp(index, longIndex, regexps) {
|
|
74
|
-
// for (var i = regexps.length - 1; i >= 0; i--){
|
|
75
|
-
// if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
|
|
76
|
-
// };
|
|
77
|
-
// return true;
|
|
78
|
-
// }
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/* ----- Mathchers ------ */
|
|
82
|
-
|
|
83
|
-
/*
|
|
84
|
-
* This record matches if the index starts with queries[0] and the record
|
|
85
|
-
* matches all of the regexps
|
|
86
|
-
*/
|
|
87
|
-
function matchPassBeginning(index, longIndex, queries, regexps) {
|
|
88
|
-
if (index.indexOf(queries[0]) != 0) return false;
|
|
89
|
-
for (var i=1, l = regexps.length; i < l; i++) {
|
|
90
|
-
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
|
91
|
-
return false;
|
|
92
|
-
};
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/*
|
|
97
|
-
* This record matches if the longIndex starts with queries[0] and the
|
|
98
|
-
* longIndex matches all of the regexps
|
|
99
|
-
*/
|
|
100
|
-
function matchPassLongIndex(index, longIndex, queries, regexps) {
|
|
101
|
-
if (longIndex.indexOf(queries[0]) != 0) return false;
|
|
102
|
-
for (var i=1, l = regexps.length; i < l; i++) {
|
|
103
|
-
if (!longIndex.match(regexps[i]))
|
|
104
|
-
return false;
|
|
105
|
-
};
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/*
|
|
110
|
-
* This record matches if the index contains queries[0] and the record
|
|
111
|
-
* matches all of the regexps
|
|
112
|
-
*/
|
|
113
|
-
function matchPassContains(index, longIndex, queries, regexps) {
|
|
114
|
-
if (index.indexOf(queries[0]) == -1) return false;
|
|
115
|
-
for (var i=1, l = regexps.length; i < l; i++) {
|
|
116
|
-
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
|
117
|
-
return false;
|
|
118
|
-
};
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/*
|
|
123
|
-
* This record matches if regexps[0] matches the index and the record
|
|
124
|
-
* matches all of the regexps
|
|
125
|
-
*/
|
|
126
|
-
function matchPassRegexp(index, longIndex, queries, regexps) {
|
|
127
|
-
if (!index.match(regexps[0])) return false;
|
|
128
|
-
for (var i=1, l = regexps.length; i < l; i++) {
|
|
129
|
-
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
|
130
|
-
return false;
|
|
131
|
-
};
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/* ----- Highlighters ------ */
|
|
137
|
-
function highlightRegexp(info, queries, regexps, highlighters) {
|
|
138
|
-
var result = createResult(info);
|
|
139
|
-
for (var i=0, l = regexps.length; i < l; i++) {
|
|
140
|
-
result.title = result.title.replace(regexps[i], highlighters[i]);
|
|
141
|
-
result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
|
|
142
|
-
};
|
|
143
|
-
return result;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function hltSubstring(string, pos, length) {
|
|
147
|
-
return string.substring(0, pos) + '\u0001' + string.substring(pos, pos + length) + '\u0002' + string.substring(pos + length);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function highlightQuery(info, queries, regexps, highlighters) {
|
|
151
|
-
var result = createResult(info);
|
|
152
|
-
var pos = 0;
|
|
153
|
-
var lcTitle = result.title.toLowerCase();
|
|
154
|
-
|
|
155
|
-
pos = lcTitle.indexOf(queries[0]);
|
|
156
|
-
if (pos != -1) {
|
|
157
|
-
result.title = hltSubstring(result.title, pos, queries[0].length);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
result.namespace = result.namespace.replace(regexps[0], highlighters[0]);
|
|
161
|
-
for (var i=1, l = regexps.length; i < l; i++) {
|
|
162
|
-
result.title = result.title.replace(regexps[i], highlighters[i]);
|
|
163
|
-
result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
|
|
164
|
-
};
|
|
165
|
-
return result;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function createResult(info) {
|
|
169
|
-
var result = {};
|
|
170
|
-
result.title = info[0];
|
|
171
|
-
result.namespace = info[1];
|
|
172
|
-
result.path = info[2];
|
|
173
|
-
result.params = info[3];
|
|
174
|
-
result.snippet = info[4];
|
|
175
|
-
return result;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* ----- Searching ------ */
|
|
179
|
-
function performSearch(data, regexps, queries, highlighters, state) {
|
|
180
|
-
var searchIndex = data.searchIndex;
|
|
181
|
-
var longSearchIndex = data.longSearchIndex;
|
|
182
|
-
var info = data.info;
|
|
183
|
-
var result = [];
|
|
184
|
-
var i = state.from;
|
|
185
|
-
var l = searchIndex.length;
|
|
186
|
-
var togo = CHUNK_SIZE;
|
|
187
|
-
var matchFunc, hltFunc;
|
|
188
|
-
|
|
189
|
-
while (state.pass < 4 && state.limit > 0 && togo > 0) {
|
|
190
|
-
if (state.pass == 0) {
|
|
191
|
-
matchFunc = matchPassBeginning;
|
|
192
|
-
hltFunc = highlightQuery;
|
|
193
|
-
} else if (state.pass == 1) {
|
|
194
|
-
matchFunc = matchPassLongIndex;
|
|
195
|
-
hltFunc = highlightQuery;
|
|
196
|
-
} else if (state.pass == 2) {
|
|
197
|
-
matchFunc = matchPassContains;
|
|
198
|
-
hltFunc = highlightQuery;
|
|
199
|
-
} else if (state.pass == 3) {
|
|
200
|
-
matchFunc = matchPassRegexp;
|
|
201
|
-
hltFunc = highlightRegexp;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
for (; togo > 0 && i < l && state.limit > 0; i++, togo--) {
|
|
205
|
-
if (info[i].n == state.n) continue;
|
|
206
|
-
if (matchFunc(searchIndex[i], longSearchIndex[i], queries, regexps)) {
|
|
207
|
-
info[i].n = state.n;
|
|
208
|
-
result.push(hltFunc(info[i], queries, regexps, highlighters));
|
|
209
|
-
state.limit--;
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
if (searchIndex.length <= i) {
|
|
213
|
-
state.pass++;
|
|
214
|
-
i = state.from = 0;
|
|
215
|
-
} else {
|
|
216
|
-
state.from = i;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return result;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function triggerResults(results, isLast) {
|
|
223
|
-
jQuery.each(this.handlers, function(i, fn) {
|
|
224
|
-
fn.call(this, results, isLast)
|
|
225
|
-
})
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
data/html/js/searcher.js.gz
DELETED
|
Binary file
|