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 +4 -4
- data/lib/sequencer.rb +1 -1
- data/lib/sequencer/clock.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d87a0ff2c8aa662944cd0ff70351524c568b4e4
|
4
|
+
data.tar.gz: 78491128cd65453b91ad4c6e09d51b93bef9ea6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbdb820150e1475cb549f4aa8aea629ddb12ca668e57d7d6a221d476ce8230e63af8535bc5c885071cdad0ad798fa6e409ac41b61bcdb56976505a39e0a19272
|
7
|
+
data.tar.gz: e9a48adea25ac0307011805575e6aa78c94db6c853651fa7309b1ebe17cba40a43c75a7a953394e6f9c8627defd0a8bd4bcf44be6a3760d8bc38a4f9dc33399b
|
data/lib/sequencer.rb
CHANGED
data/lib/sequencer/clock.rb
CHANGED
@@ -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
|
-
|
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] =
|
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] :
|
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[:
|
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.
|
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-
|
11
|
+
date: 2014-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: midi-topaz
|