midi-topaz 0.2.4 → 0.2.5

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: 6b9cba48a0b78793392c1fae95b1e3076efe30ac
4
- data.tar.gz: 6af1e277ed9207f1f4f371a664e04006d8b12e0e
3
+ metadata.gz: 6b328af933373fcd7e339796494153ba0a6a3bc0
4
+ data.tar.gz: 4be13f7763a72d50c8724432fddbf40a7472f737
5
5
  SHA512:
6
- metadata.gz: 730961e16d0f611f3050a055ea75707745ab506104a7acb8785eede167097cc0ad5de9db9a2be2b8d7670d6b452c77091c28d7ab5628ef247322d40f06d76e01
7
- data.tar.gz: 7130706af9d7f3c4eeb1f758cb94e54a0f884f807889169506e5c6c95b3d053d48e46419d34018171555a8b74e376fd940a6edd8fd7d04ac47efe67c0bbb2a95
6
+ metadata.gz: 0823fe40d0237d0a7e76b0f8cfa55b2df99de7bd1f0c59ee044cf6d162e1c7f5ad80e03fee1b0d0a815608a41184a26571bc6a665d81ad7454b64314e6f2301c
7
+ data.tar.gz: 9241cbccdfd2b965d99f0c4f210526fd372066e2c563b19601552b35d463a4f3708451591cdda10119e56395b0337eff008698f24ea42153f25e33337088075a
@@ -26,6 +26,6 @@ require "topaz/timer"
26
26
 
27
27
  module Topaz
28
28
 
29
- VERSION = "0.2.4"
29
+ VERSION = "0.2.5"
30
30
 
31
31
  end
@@ -9,6 +9,7 @@ module Topaz
9
9
 
10
10
  # @param [Fixnum, UniMIDI::Input] tempo_or_input
11
11
  # @param [Hash] options
12
+ # @option options [Boolean] :midi_transport Whether to respect start/stop MIDI commands from a MIDI input
12
13
  # @param [Proc] tick_event
13
14
  def initialize(tempo_or_input, options = {}, &tick_event)
14
15
  # The MIDI clock output is initialized regardless of whether there are devices
@@ -12,8 +12,10 @@ module Topaz
12
12
  # @param [UniMIDI::Input] input
13
13
  # @param [Hash] options
14
14
  # @option options [Clock::Event] :event
15
+ # @option options [Boolean] :midi_transport Whether to respect start/stop MIDI commands from a MIDI input
15
16
  def initialize(input, options = {})
16
17
  @event = options[:event]
18
+ @use_transport = !!options[:midi_transport]
17
19
  @tick_counter = 0
18
20
  @pause = false
19
21
  @listening = false
@@ -137,10 +139,12 @@ module Topaz
137
139
  # @param [Hash] message
138
140
  # @return [Fixnum] The current counter
139
141
  def handle_clock_message(message)
140
- @running ||= true
141
- thru
142
- log(message)
143
- tick? ? tick : advance
142
+ if @running || !@use_transport
143
+ @running ||= true
144
+ thru
145
+ log(message)
146
+ tick? ? tick : advance
147
+ end
144
148
  end
145
149
 
146
150
  # Advance the tick counter
@@ -9,6 +9,7 @@ module Topaz
9
9
  # @param [Fixnum, UniMIDI::Input] tempo_or_input
10
10
  # @param [Hash] options
11
11
  # @option options [Clock::Event] :event
12
+ # @option options [Boolean] :midi_transport Whether to respect start/stop commands when the input is MIDI
12
13
  # @return [MIDIClockInput, Timer]
13
14
  def new(tempo_or_input, options = {})
14
15
  klass = case tempo_or_input
@@ -17,9 +18,7 @@ module Topaz
17
18
  else
18
19
  raise "Not a valid tempo source"
19
20
  end
20
- source = klass.new(tempo_or_input, :event => options[:event])
21
- source.interval = options[:interval] unless options[:interval].nil?
22
- source
21
+ klass.new(tempo_or_input, options)
23
22
  end
24
23
 
25
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midi-topaz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo