unimidi 0.1.0-java → 0.1.3-java
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.
- data/README.rdoc +2 -6
- data/lib/unimidi.rb +1 -1
- data/lib/unimidi/congruous_api_adapter.rb +23 -17
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -6,9 +6,9 @@ Platform independent realtime MIDI input and output for Ruby.
|
|
6
6
|
|
7
7
|
== Features
|
8
8
|
|
9
|
-
* Currently Linux, JRuby, Windows and Cygwin are supported.
|
9
|
+
* Currently Linux, JRuby, Windows and Cygwin are supported. OSX is {in progress}[http://github.com/arirusso/ffi-coremidi]
|
10
10
|
* Both input and output to and from multiple devices concurrently
|
11
|
-
* Agnostically handle different MIDI Message types
|
11
|
+
* Agnostically handle different MIDI and SysEx Message types
|
12
12
|
|
13
13
|
== Requirements
|
14
14
|
|
@@ -39,10 +39,6 @@ A couple of notes about JRuby only:
|
|
39
39
|
== Documentation
|
40
40
|
|
41
41
|
* {rdoc}[http://rdoc.info/gems/unimidi]
|
42
|
-
|
43
|
-
== To-do
|
44
|
-
|
45
|
-
* OSX {coremidi}[http://github.com/arirusso/coremidi] implementation once that lib is done
|
46
42
|
|
47
43
|
== Author
|
48
44
|
|
data/lib/unimidi.rb
CHANGED
@@ -17,11 +17,15 @@ module UniMIDI
|
|
17
17
|
|
18
18
|
# enable the device for use, can be passed a block to which the device will be passed back
|
19
19
|
def open(*a, &block)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
@device.open(*a)
|
21
|
+
unless block.nil?
|
22
|
+
begin
|
23
|
+
block.call(self)
|
24
|
+
ensure
|
25
|
+
close
|
26
|
+
end
|
27
|
+
else
|
28
|
+
self
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
@@ -94,11 +98,11 @@ module UniMIDI
|
|
94
98
|
|
95
99
|
#
|
96
100
|
# returns an array of MIDI event hashes as such:
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
101
|
+
# [
|
102
|
+
# { :data => [144, 60, 100], :timestamp => 1024 },
|
103
|
+
# { :data => [128, 60, 100], :timestamp => 1100 },
|
104
|
+
# { :data => [144, 40, 120], :timestamp => 1200 }
|
105
|
+
# ]
|
102
106
|
#
|
103
107
|
# the data is an array of Numeric bytes
|
104
108
|
# the timestamp is the number of millis since this input was enabled
|
@@ -109,18 +113,19 @@ module UniMIDI
|
|
109
113
|
|
110
114
|
#
|
111
115
|
# same as gets but returns message data as string of hex digits as such:
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
116
|
+
# [
|
117
|
+
# { :data => "904060", :timestamp => 904 },
|
118
|
+
# { :data => "804060", :timestamp => 1150 },
|
119
|
+
# { :data => "90447F", :timestamp => 1300 }
|
120
|
+
# ]
|
117
121
|
#
|
118
122
|
def gets_bytestr(*a)
|
119
123
|
@device.gets_bytestr(*a)
|
120
124
|
end
|
121
125
|
|
122
126
|
#
|
123
|
-
# returns an array of data bytes such as
|
127
|
+
# returns an array of data bytes such as
|
128
|
+
# [144, 60, 100, 128, 60, 100, 144, 40, 120]
|
124
129
|
#
|
125
130
|
def gets_data(*a)
|
126
131
|
arr = gets
|
@@ -128,7 +133,8 @@ module UniMIDI
|
|
128
133
|
end
|
129
134
|
|
130
135
|
#
|
131
|
-
# returns a string of data such as
|
136
|
+
# returns a string of data such as
|
137
|
+
# "90406080406090447F"
|
132
138
|
#
|
133
139
|
def gets_data_bytestr(*a)
|
134
140
|
arr = gets_bytestr
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: java
|
11
11
|
authors:
|
12
12
|
- Ari Russo
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-04
|
17
|
+
date: 2011-05-04 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|