basic-sequencer 0.0.5 → 0.0.6

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: 4893d5a6b3ec06799900f1b5b4e53303d35bc6c8
4
- data.tar.gz: 943da273874a7d6f9ad2b38b9a34fa6ae4300eb3
3
+ metadata.gz: 2d87a0ff2c8aa662944cd0ff70351524c568b4e4
4
+ data.tar.gz: 78491128cd65453b91ad4c6e09d51b93bef9ea6f
5
5
  SHA512:
6
- metadata.gz: 3bf48f0045b0f43c72f76ab778d0cafd1055cbafec7049eafa152ba036befeba9ffda0ba377b435ef4c9d50e22a6c485166d4447735602acd4da0aa17ca1fa13
7
- data.tar.gz: 19668ba5050d6410ffada46a86282d6537beb6fc46b95bbcd9d422b1fad40107a62fae3459585cd28eb17694ef83155a83c2c0bbe4c4ce5d697373c3bd7a464c
6
+ metadata.gz: cbdb820150e1475cb549f4aa8aea629ddb12ca668e57d7d6a221d476ce8230e63af8535bc5c885071cdad0ad798fa6e409ac41b61bcdb56976505a39e0a19272
7
+ data.tar.gz: e9a48adea25ac0307011805575e6aa78c94db6c853651fa7309b1ebe17cba40a43c75a7a953394e6f9c8627defd0a8bd4bcf44be6a3760d8bc38a4f9dc33399b
data/lib/sequencer.rb CHANGED
@@ -19,6 +19,6 @@ require "sequencer/loop"
19
19
 
20
20
  module Sequencer
21
21
 
22
- VERSION = "0.0.5"
22
+ VERSION = "0.0.6"
23
23
 
24
24
  end
@@ -10,20 +10,24 @@ module Sequencer
10
10
 
11
11
  # @param [Fixnum, UniMIDI::Input] tempo_or_input
12
12
  # @param [Hash] options
13
- # @option options [Array<UniMIDI::Output>, UniMIDI::Output] :outputs MIDI output device(s)
13
+ # @option options [Array<UniMIDI::Output>, UniMIDI::Output] :output (also: :outputs) MIDI output device(s)
14
14
  def initialize(tempo_or_input, options = {})
15
15
  @event = Event.new
16
- initialize_clock(tempo_or_input, options.fetch(:resolution, 128), :outputs => options[:outputs])
16
+ outputs = options[:output] || options[:outputs]
17
+ resolution = options.fetch(:resolution, 128)
18
+ initialize_clock(tempo_or_input, resolution, :outputs => outputs)
17
19
  end
18
20
 
19
21
  # Start the clock
20
22
  # @param [Hash] options
23
+ # @option options [Boolean] :background Whether to run in the background
21
24
  # @option options [Boolean] :blocking Whether to run in the foreground (also :focus, :foreground)
22
25
  # @option options [Boolean] :suppress_clock Whether this clock is a sync-slave
23
26
  # @return [Boolean]
24
27
  def start(options = {})
25
28
  clock_options = {}
26
- clock_options[:background] = ![:blocking, :focus, :foreground].any? { |key| !!options[key] }
29
+ clock_options[:background] = !!options[:background]
30
+ clock_options[:background] ||= ![:blocking, :focus, :foreground].any? { |key| !!options[key] }
27
31
  @clock.start(clock_options) unless !!options[:suppress_clock]
28
32
  Thread.abort_on_exception = true
29
33
  end
@@ -39,9 +43,9 @@ module Sequencer
39
43
  # @param [Fixnum, UniMIDI::Input] tempo_or_input
40
44
  # @param [Fixnum] resolution
41
45
  # @param [Hash] options
42
- # @option options [Array<UniMIDI::Output>, UniMIDI::Output] :outputs MIDI output device(s)
46
+ # @option options [Array<UniMIDI::Output>, UniMIDI::Output] :output MIDI output device(s)
43
47
  def initialize_clock(tempo_or_input, resolution, options = {})
44
- @clock = Topaz::Tempo.new(tempo_or_input, :midi => options[:outputs])
48
+ @clock = Topaz::Tempo.new(tempo_or_input, :midi => options[:output])
45
49
  @clock.interval = @clock.interval * (resolution / @clock.interval)
46
50
  @clock.on_tick { on_tick }
47
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basic-sequencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: midi-topaz