midicat 0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7fbbd91b5b77f6c3fe67173548e4640356d5b51e
4
+ data.tar.gz: 3cb888789003cb24254597c44c3ca09e7a28f7da
5
+ SHA512:
6
+ metadata.gz: 2b7c9a83c91531db0e508e6ae16b7b0c5f00dbafdbd7089ade7ad9a71397d00380b06c8fb6ccfa2128187c7899c7feea290c4209374bb7976a9867c87083c03d
7
+ data.tar.gz: 215cb632200839f75693e4853df6d92b362a63fd212bc5c2273ec46fc72c3656ae0b462259e3c605d08464d17f8af484d826a6ccf6ab73af42177bf51f987739
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+ /vendor/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalisation:
25
+ /.bundle/
26
+ /lib/bundler/man/
27
+
28
+ # for a library or gem, you might want to ignore these files since the code is
29
+ # intended to run in multiple environments; otherwise, check them in:
30
+ # Gemfile.lock
31
+ # .ruby-version
32
+ # .ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in midicat.gemspec
4
+ gemspec
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ midicat (0.0.1)
5
+ midi-nibbler
6
+ unimidi
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ alsa-rawmidi (0.3.1)
12
+ ffi (~> 1.0)
13
+ ffi (1.9.6)
14
+ ffi-coremidi (0.3.7)
15
+ ffi (~> 1.9, >= 1.9.6)
16
+ midi-jruby (0.1.4)
17
+ midi-message (0.4.5)
18
+ midi-nibbler (0.2.1)
19
+ midi-message (~> 0)
20
+ midi-winmm (0.1.10)
21
+ ffi (>= 1.0)
22
+ rake (10.4.2)
23
+ unimidi (0.4.6)
24
+ alsa-rawmidi (~> 0.3, >= 0.3.1)
25
+ ffi-coremidi (~> 0.3, >= 0.3.5)
26
+ midi-jruby (~> 0.1, >= 0.1.4)
27
+ midi-winmm (~> 0.1, >= 0.1.10)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 1.7)
34
+ midicat!
35
+ rake (~> 10.0)
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 polamjag
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # Midicat
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'midicat'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install midicat
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/midicat/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'unimidi'
4
+ require 'nibbler'
5
+
6
+ devices = []
7
+ threads = []
8
+ data = []
9
+ timestamps = []
10
+ ni = Nibbler.new
11
+
12
+ def format_mes(message)
13
+ if message.is_a? MIDIMessage::ControlChange
14
+ "Ch.#{message.channel}.#{message.index} -> #{message.value}"
15
+ elsif message.is_a? MIDIMessage::NoteOn
16
+ "Ch.#{message.channel}.#{message.name} ON @ #{message.velocity}"
17
+ elsif message.is_a? MIDIMessage::NoteOff
18
+ "Ch.#{message.channel}.#{message.name} OFF @ #{message.velocity}"
19
+ else
20
+ message
21
+ p message
22
+ end
23
+ end
24
+
25
+ UniMIDI::Input.all.each_with_index do |d, i|
26
+ p d
27
+ devices[i] = d.open
28
+ ii = 0
29
+ threads << Thread.new do
30
+ loop do
31
+ data[i] = d.gets
32
+ data[i].each do |dd|
33
+ timestamps[i] = sprintf "%8.4f", dd[:timestamp]
34
+ ms = ni.parse *dd[:data]
35
+ if ms.is_a? Array
36
+ ms.each do |mss|
37
+ print "#{timestamps[i]} #{d.name} #{format_mes mss}\n"
38
+ end
39
+ else
40
+ print "#{timestamps[i]} #{d.name} #{format_mes ms}\n"
41
+ end
42
+ end
43
+ end
44
+ end
45
+ threads.each do |t|
46
+ t.join
47
+ end
48
+ end
49
+
@@ -0,0 +1,4 @@
1
+ require "midicat/version"
2
+
3
+ module Midicat
4
+ end
@@ -0,0 +1,3 @@
1
+ module Midicat
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'midicat/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "midicat"
8
+ spec.version = Midicat::VERSION
9
+ spec.authors = ["polamjag"]
10
+ spec.email = ["s@polamjag.info"]
11
+ spec.summary = %q{pretty cat/tailf-like command for midi inputs}
12
+ spec.homepage = "https://github.com/polamjag/midicat"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+
23
+ spec.add_dependency 'unimidi'
24
+ spec.add_dependency 'midi-nibbler'
25
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: midicat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - polamjag
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: unimidi
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: midi-nibbler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - s@polamjag.info
72
+ executables:
73
+ - midicat
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - LICENSE
81
+ - README.md
82
+ - Rakefile
83
+ - bin/midicat
84
+ - lib/midicat.rb
85
+ - lib/midicat/version.rb
86
+ - midicat.gemspec
87
+ homepage: https://github.com/polamjag/midicat
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.4.5
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: pretty cat/tailf-like command for midi inputs
111
+ test_files: []
112
+ has_rdoc: