midi-instrument 0.4.6 → 0.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 800e7cc912ef68909e75ae2c93f517d8a093f698
4
- data.tar.gz: 5ceae951000d3e93adefe7366aeff3833aeffd83
3
+ metadata.gz: 4f3c9154aa1efd30952181b2f74376d8f17ab331
4
+ data.tar.gz: 66da9d0dba8be4774226657bf67a465685d46708
5
5
  SHA512:
6
- metadata.gz: 965234dd9e113bf004d15de2b49023a562de1d346a61973b576c84aee30288fe62e2a32afecab509d05880267fbb7297dd0424f32865095826676a292a7fe4dc
7
- data.tar.gz: b70fb14b680c95232a5608ec3f5ff811ba4912418b5b11ebcc5b077194767c6c860666951996dc5ac220f93d7b7908357e463aeec06e2570ff3e59e21f169b7d
6
+ metadata.gz: e576411ece44d81ddd9ea64fd75b1e9dabdb9b1434cc46f7c2ef9590ef5c2c620f4f7d85a5e7dbf177056c2b3cdfb7ce936b8b19c00d5888f5ac13141bc2069f
7
+ data.tar.gz: d26a17a4680d6ec34b6d61a6a4768ab1709f98022d9c993ad1410e78b4f3cc6b68746fc4e9573b1984d761ab4ae88c9ad5a1c29d5e9369ef60c2d2bb90c28d73
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2011-2014 Ari Russo
1
+ Copyright 2011-2015 Ari Russo
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -7,17 +7,17 @@ Used by [Diamond](http://github.com/arirusso/diamond)
7
7
  ## Installation
8
8
 
9
9
  `gem install midi-instrument`
10
-
10
+
11
11
  or with Bundler, add this to your Gemfile
12
-
13
- `gem "midi-instrument"`
12
+
13
+ `gem "midi-instrument"`
14
14
 
15
15
  ## Documentation
16
16
 
17
- * [rdoc](http://rubydoc.info/github/arirusso/midi-instrument)
17
+ * [rdoc](http://rubydoc.info/github/arirusso/midi-instrument)
18
18
 
19
19
  ## License
20
20
 
21
21
  Licensed under Apache 2.0, See the file LICENSE
22
22
 
23
- Copyright © 2011-2014 Ari Russo
23
+ Copyright © 2011-2015 [Ari Russo](http://arirusso.com)
@@ -2,7 +2,7 @@
2
2
  # MIDI Instrument
3
3
  # Core MIDI Instrument Functionality
4
4
  #
5
- # (c)2011-2014 Ari Russo
5
+ # (c)2011-2015 Ari Russo
6
6
  # Licensed under Apache 2.0
7
7
  #
8
8
 
@@ -27,6 +27,6 @@ require "midi-instrument/output"
27
27
 
28
28
  module MIDIInstrument
29
29
 
30
- VERSION = "0.4.6"
30
+ VERSION = "0.4.7"
31
31
 
32
32
  end
@@ -123,4 +123,3 @@ module MIDIInstrument
123
123
  end
124
124
 
125
125
  end
126
-
@@ -30,13 +30,13 @@ module MIDIInstrument
30
30
  # @param [*Fixnum, *MIDIMessage::NoteOn, *MIDIMessage::NoteOff, *String] args
31
31
  # @return [Array<Fixnum>]
32
32
  def puts(*args)
33
- messages = Message::to_messages(*args)
33
+ messages = Message.to_messages(*args)
34
34
  messages = filter_output(messages)
35
- bytes = Message::to_bytes(messages)
35
+ bytes = messages.map(&:to_bytes)
36
36
  if !@mute
37
37
  @devices.each { |output| output.puts(*bytes) }
38
38
  end
39
- bytes
39
+ bytes
40
40
  end
41
41
  alias_method :<<, :puts
42
42
 
@@ -77,7 +77,7 @@ module MIDIInstrument
77
77
 
78
78
  # Filter messages for output
79
79
  # @param [Array<MIDIMessage::ChannelMessage>] messages
80
- # @return [Array<MIDIMessage::ChannelMessage>]
80
+ # @return [Array<MIDIMessage::ChannelMessage>]
81
81
  def filter_output(messages)
82
82
  if @channel_filter.nil?
83
83
  messages
data/test/output_test.rb CHANGED
@@ -79,6 +79,12 @@ class MIDIInstrument::OutputTest < Minitest::Test
79
79
  assert_nil @output.channel
80
80
  end
81
81
 
82
+ should "filter MIDI message channels when outputting" do
83
+ @output.channel = 3
84
+ result = @output.send(:filter_output, [MIDIMessage::NoteOn["C3"].new(0, 100), MIDIMessage::NoteOn["D3"].new(0, 110)])
85
+ assert result.all? { |message| message.channel == 3 }
86
+ end
87
+
82
88
  end
83
89
 
84
90
  context "#devices=" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midi-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-31 00:00:00.000000000 Z
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  version: 1.3.6
216
216
  requirements: []
217
217
  rubyforge_project: midi-instrument
218
- rubygems_version: 2.2.2
218
+ rubygems_version: 2.4.6
219
219
  signing_key:
220
220
  specification_version: 4
221
221
  summary: Core MIDI instrument functionality