fluent-plugin-midi 0.0.2 → 0.1.0
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 +4 -4
- data/README.md +17 -1
- data/fluent-plugin-midi.gemspec +3 -3
- data/lib/fluent/plugin/in_midi.rb +35 -0
- data/lib/fluent/plugin/out_midi.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc6bab0adc32fbe6b9e25ce4ecc40b1ea627610
|
4
|
+
data.tar.gz: 560ec003f217148a7b6961f36de69d634c614e78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 039954ea6e26706e1abe89a5309778d1f87ae3e01a028e55bb0bc988c805da76bb4a8eaeb287508adcb68be69ea3fef3c868f03b42c749d1800b56ac545506ba
|
7
|
+
data.tar.gz: 709cbf5011cb3978a28184595d5593c2b27406d773688dbb4cb3b3c0dec6ae787fc347ae77f8370059e2cb63250893b34be909f67cf956de31292ee05f8e690d
|
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
# MIDI
|
1
|
+
# MIDI Input/Output plugin for [Fluentd](http://fluentd.org/)
|
2
|
+
[](http://badge.fury.io/rb/fluent-plugin-midi)
|
3
|
+
[](https://codeclimate.com/github/meganemura/fluent-plugin-midi)
|
4
|
+
[](https://gemnasium.com/meganemura/fluent-plugin-midi)
|
5
|
+
|
2
6
|
|
3
7
|
Experimental project for log audiolization.
|
4
8
|
|
@@ -10,8 +14,10 @@ $ gem install fluent-plugin-midi
|
|
10
14
|
|
11
15
|
## Usage
|
12
16
|
|
17
|
+
* Output
|
13
18
|
```
|
14
19
|
echo '{"status":144, "note": 60, "velocity": 120}' | fluent-cat debug
|
20
|
+
sleep 3
|
15
21
|
echo '{"status":144, "note": 60, "velocity": 0}' | fluent-cat debug
|
16
22
|
```
|
17
23
|
|
@@ -23,6 +29,16 @@ echo '{"status":144, "note": 60, "velocity": 120, "duration": 3}' | fluent-cat d
|
|
23
29
|
|
24
30
|
## Configuration
|
25
31
|
|
32
|
+
* Input
|
33
|
+
```
|
34
|
+
<source>
|
35
|
+
type midi
|
36
|
+
tag TAG
|
37
|
+
port MIDI_PORT_INDEX
|
38
|
+
</source>
|
39
|
+
```
|
40
|
+
|
41
|
+
* Output
|
26
42
|
```
|
27
43
|
<match pattern>
|
28
44
|
type midi
|
data/fluent-plugin-midi.gemspec
CHANGED
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-midi"
|
7
|
-
spec.version = "0.0
|
7
|
+
spec.version = "0.1.0"
|
8
8
|
spec.authors = ["meganemura"]
|
9
9
|
spec.email = ["mura2megane@gmail.com"]
|
10
|
-
spec.summary = %q{MIDI Output plugin for Fluentd event collector}
|
10
|
+
spec.summary = %q{MIDI Input/Output plugin for Fluentd event collector}
|
11
11
|
spec.description = spec.summary
|
12
12
|
spec.homepage = "https://github.com/meganemura/fluent-plugin-midi"
|
13
13
|
spec.license = "MIT"
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_runtime_dependency "fluentd"
|
21
|
-
spec.add_runtime_dependency "rtmidi"
|
21
|
+
spec.add_runtime_dependency "rtmidi", ">= 0.3"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.5"
|
23
23
|
spec.add_development_dependency "rake"
|
24
24
|
spec.add_development_dependency "pry"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Fluent
|
2
|
+
class MIDIInput < Input
|
3
|
+
Fluent::Plugin.register_input('midi', self)
|
4
|
+
|
5
|
+
config_param :tag, :string
|
6
|
+
config_param :port, :integer, :default => 0
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
require 'rtmidi'
|
11
|
+
end
|
12
|
+
|
13
|
+
def configure(conf)
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def start
|
18
|
+
super
|
19
|
+
@input = RtMidi::In.new
|
20
|
+
@input.receive_channel_message do |byte1, byte2, byte3|
|
21
|
+
record = {
|
22
|
+
'status' => byte1,
|
23
|
+
'note' => byte2,
|
24
|
+
'velocity' => byte3,
|
25
|
+
}
|
26
|
+
Engine.emit(@tag, Engine.now, record)
|
27
|
+
end
|
28
|
+
@input.open_port(@port)
|
29
|
+
end
|
30
|
+
|
31
|
+
def shutdown
|
32
|
+
@input.close_port
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-midi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- meganemura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '0.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '0.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description: MIDI Output plugin for Fluentd event collector
|
83
|
+
description: MIDI Input/Output plugin for Fluentd event collector
|
84
84
|
email:
|
85
85
|
- mura2megane@gmail.com
|
86
86
|
executables: []
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- README.md
|
94
94
|
- Rakefile
|
95
95
|
- fluent-plugin-midi.gemspec
|
96
|
+
- lib/fluent/plugin/in_midi.rb
|
96
97
|
- lib/fluent/plugin/out_midi.rb
|
97
98
|
- test/helper.rb
|
98
99
|
- test/plugin/test_out_midi.rb
|
@@ -119,7 +120,7 @@ rubyforge_project:
|
|
119
120
|
rubygems_version: 2.0.3
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
|
-
summary: MIDI Output plugin for Fluentd event collector
|
123
|
+
summary: MIDI Input/Output plugin for Fluentd event collector
|
123
124
|
test_files:
|
124
125
|
- test/helper.rb
|
125
126
|
- test/plugin/test_out_midi.rb
|