unimidi 0.0.1-i686-linux

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2010-2011 Ari Russo
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.rdoc ADDED
@@ -0,0 +1,40 @@
1
+ = UniMIDI
2
+
3
+ Author:: Ari Russo
4
+ Copyright:: Copyright (c) 2011 Ari Russo
5
+
6
+ == Summary
7
+
8
+ Realtime MIDI input and output for Ruby
9
+
10
+ == Features
11
+
12
+ * Multiple platforms supported (currently Linux, Windows/Cygwin, more to follow)
13
+ * Handle both input and output
14
+ * Supports messaging to and from multiple devices concurrently
15
+
16
+ == Requirements
17
+
18
+ * Linux: {alsa-rawmidi}[http://github.com/arirusso/alsa-rawmidi]
19
+ * Windows/Cygwin: {midi-winmm}[https://github.com/arirusso/midi-winmm]
20
+
21
+ == Install
22
+
23
+ * gem install unimidi
24
+
25
+ == Examples
26
+
27
+ * {input}[http://github.com/arirusso/unimidi/blob/master/examples/input.rb]
28
+ * {output}[http://github.com/arirusso/unimidi/blob/master/examples/output.rb]
29
+
30
+ == Tests
31
+
32
+ * please see {test/config.rb}[http://github.com/arirusso/unimidi/blob/master/test/config.rb] before running tests
33
+
34
+ == Documentation
35
+
36
+ * {rdoc}[http://rdoc.info/gems/unimidi]
37
+
38
+ == License
39
+
40
+ Apache 2.0, See the file LICENSE
data/lib/unimidi.rb ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # A realtime MIDI interface for Ruby
4
+ #
5
+ module UniMIDI
6
+
7
+ VERSION = "0.0.1"
8
+
9
+ end
10
+
11
+ require 'unimidi/congruous_api_adapter'
12
+ require 'unimidi/platform'
13
+
14
+ module UniMIDI
15
+ extend(Platform.instance.interface)
16
+ include(Platform.instance.interface)
17
+ end
@@ -0,0 +1,19 @@
1
+ module UniMIDI
2
+
3
+ module AlsaRawMIDIAdapter
4
+
5
+ class Input
6
+ include CongruousApiAdapter::Device
7
+ extend CongruousApiAdapter::Device::ClassMethods
8
+ DeviceClass = ::AlsaRawMIDI::Input
9
+ end
10
+
11
+ class Output
12
+ include CongruousApiAdapter::Device
13
+ extend CongruousApiAdapter::Device::ClassMethods
14
+ DeviceClass = ::AlsaRawMIDI::Output
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,19 @@
1
+ module UniMIDI
2
+
3
+ module MIDIWinMMAdapter
4
+
5
+ class Input
6
+ include CongruousApiAdapter::Device
7
+ extend CongruousApiAdapter::Device::ClassMethods
8
+ DeviceClass = ::MIDIWinMM::Input
9
+ end
10
+
11
+ class Output
12
+ include CongruousApiAdapter::Device
13
+ extend CongruousApiAdapter::Device::ClassMethods
14
+ DeviceClass = ::MIDIWinMM::Output
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,34 @@
1
+ module UniMIDI
2
+
3
+ module CongruousApiAdapter
4
+
5
+ module Device
6
+
7
+ def initialize(device_obj)
8
+ @device = device_obj
9
+ end
10
+
11
+ def method_missing(method, *args, &block)
12
+ @device.send(method, *args, &block)
13
+ end
14
+
15
+ def self.included(base)
16
+ base.send(:attr_reader, :device)
17
+ end
18
+
19
+ module ClassMethods
20
+ def device_class
21
+ const_get("DeviceClass")
22
+ end
23
+
24
+ def method_missing(method, *args, &block)
25
+ device_class.send(method, *args, &block)
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
@@ -0,0 +1,27 @@
1
+ require 'singleton'
2
+
3
+ module UniMIDI
4
+
5
+ class Platform
6
+
7
+ include Singleton
8
+
9
+ attr_reader :interface
10
+
11
+ def initialize
12
+ lib = case RUBY_PLATFORM
13
+ when /linux/ then 'alsa-rawmidi'
14
+ when /win32/ then 'midi-winmm'
15
+ end
16
+ require(lib)
17
+ require("unimidi/adapter/#{lib}")
18
+ @interface = case RUBY_PLATFORM
19
+ when /linux/ then AlsaRawMIDIAdapter
20
+ when /win32/ then MIDIWinMMAdapter
21
+ end
22
+ end
23
+
24
+ end
25
+
26
+ end
27
+
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unimidi
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: i686-linux
7
+ authors:
8
+ - Ari Russo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-04-19 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: Realtime MIDI input and output for Ruby.
18
+ email:
19
+ - ari.russo@gmail.com
20
+ executables: []
21
+
22
+ extensions: []
23
+
24
+ extra_rdoc_files: []
25
+
26
+ files:
27
+ - lib/unimidi.rb
28
+ - lib/unimidi/adapter/midi-winmm.rb
29
+ - lib/unimidi/adapter/alsa-rawmidi.rb
30
+ - lib/unimidi/congruous_api_adapter.rb
31
+ - lib/unimidi/platform.rb
32
+ - LICENSE
33
+ - README.rdoc
34
+ has_rdoc: true
35
+ homepage: http://github.com/arirusso/unimidi
36
+ licenses: []
37
+
38
+ post_install_message:
39
+ rdoc_options: []
40
+
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: "0"
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.3.6
55
+ requirements: []
56
+
57
+ rubyforge_project: unimidi
58
+ rubygems_version: 1.6.2
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: Realtime MIDI input and output for Ruby.
62
+ test_files: []
63
+