musa-dsl 0.26.9 → 0.26.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/musa-dsl/sequencer/base-sequencer-tick-based.rb +1 -1
- data/lib/musa-dsl/sequencer/base-sequencer.rb +4 -0
- data/lib/musa-dsl/sequencer/sequencer-dsl.rb +3 -0
- data/lib/musa-dsl/transport/transport.rb +5 -1
- data/lib/musa-dsl.rb +1 -1
- data/musa-dsl.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae2aa7f3e4406ef09886be36604113bb854d1f92c985a6e6bfda534520939652
|
4
|
+
data.tar.gz: 3e7ca1f99dc0dee8b2a2969a19807b9b6902caed27d94278503536d4787a664d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9d8fc55338beb1dbcb3b78e44738ecf5a51e478d75a8f2fb18f51e52c63e3038b6ffc05304aec34297097795e6e14adbe2055ac0267d2aa7a94ada8cb71d57
|
7
|
+
data.tar.gz: '098e5f968aad5bbd2eff7a7ed3c268c9411db65952be5824d02af06147ab00a185bb3d4eeff0a23e8ce8648919c400b9891393d2e19426c215fd102467fb7364'
|
@@ -37,7 +37,7 @@ module Musa
|
|
37
37
|
end
|
38
38
|
|
39
39
|
private def _reset_timing
|
40
|
-
@position = @position_mutex.synchronize { 1r - @tick_duration }
|
40
|
+
@position = @position_mutex.synchronize { 1r + @offset - @tick_duration }
|
41
41
|
end
|
42
42
|
|
43
43
|
private def _quantize_position(position, warn: true)
|
@@ -13,11 +13,13 @@ module Musa
|
|
13
13
|
module Sequencer
|
14
14
|
class BaseSequencer
|
15
15
|
attr_reader :beats_per_bar, :ticks_per_beat
|
16
|
+
attr_reader :offset
|
16
17
|
attr_reader :running_position
|
17
18
|
attr_reader :everying, :playing, :moving
|
18
19
|
attr_reader :logger
|
19
20
|
|
20
21
|
def initialize(beats_per_bar = nil, ticks_per_beat = nil,
|
22
|
+
offset: nil,
|
21
23
|
logger: nil,
|
22
24
|
do_log: nil, do_error_log: nil, log_position_format: nil)
|
23
25
|
|
@@ -35,6 +37,8 @@ module Musa
|
|
35
37
|
@logger.debug! if do_log
|
36
38
|
end
|
37
39
|
|
40
|
+
@offset = offset || 0r
|
41
|
+
|
38
42
|
if beats_per_bar && ticks_per_beat
|
39
43
|
@beats_per_bar = Rational(beats_per_bar)
|
40
44
|
@ticks_per_beat = Rational(ticks_per_beat)
|
@@ -9,6 +9,7 @@ module Musa
|
|
9
9
|
|
10
10
|
def_delegators :@sequencer,
|
11
11
|
:beats_per_bar, :ticks_per_beat, :ticks_per_bar, :tick_duration,
|
12
|
+
:offset,
|
12
13
|
:size, :empty?,
|
13
14
|
:on_debug_at, :on_error, :on_fast_forward, :before_tick,
|
14
15
|
:raw_at,
|
@@ -25,6 +26,7 @@ module Musa
|
|
25
26
|
|
26
27
|
def initialize(beats_per_bar = nil,
|
27
28
|
ticks_per_beat = nil,
|
29
|
+
offset: nil,
|
28
30
|
sequencer: nil,
|
29
31
|
logger: nil,
|
30
32
|
do_log: nil, do_error_log: nil, log_position_format: nil,
|
@@ -34,6 +36,7 @@ module Musa
|
|
34
36
|
|
35
37
|
@sequencer = sequencer
|
36
38
|
@sequencer ||= BaseSequencer.new beats_per_bar, ticks_per_beat,
|
39
|
+
offset: offset,
|
37
40
|
logger: logger,
|
38
41
|
do_log: do_log,
|
39
42
|
do_error_log: do_error_log,
|
@@ -12,6 +12,7 @@ module Musa
|
|
12
12
|
def initialize(clock,
|
13
13
|
beats_per_bar = nil,
|
14
14
|
ticks_per_beat = nil,
|
15
|
+
offset: nil,
|
15
16
|
sequencer: nil,
|
16
17
|
before_begin: nil,
|
17
18
|
on_start: nil,
|
@@ -22,6 +23,8 @@ module Musa
|
|
22
23
|
|
23
24
|
beats_per_bar ||= 4
|
24
25
|
ticks_per_beat ||= 24
|
26
|
+
offset ||= 0r
|
27
|
+
|
25
28
|
do_log ||= false
|
26
29
|
|
27
30
|
@clock = clock
|
@@ -41,7 +44,7 @@ module Musa
|
|
41
44
|
@do_log = do_log
|
42
45
|
|
43
46
|
@sequencer = sequencer
|
44
|
-
@sequencer ||= Musa::Sequencer::Sequencer.new beats_per_bar, ticks_per_beat, logger: logger, do_log: @do_log
|
47
|
+
@sequencer ||= Musa::Sequencer::Sequencer.new beats_per_bar, ticks_per_beat, offset: offset, logger: logger, do_log: @do_log
|
45
48
|
|
46
49
|
@clock.on_start do
|
47
50
|
do_on_start
|
@@ -91,6 +94,7 @@ module Musa
|
|
91
94
|
position += Rational(midi_beats, 4 * @sequencer.beats_per_bar) if midi_beats
|
92
95
|
position += Rational(beats, @sequencer.beats_per_bar) if beats
|
93
96
|
|
97
|
+
position += @sequencer.offset
|
94
98
|
position -= @sequencer.tick_duration
|
95
99
|
|
96
100
|
raise ArgumentError, "undefined new position" unless position
|
data/lib/musa-dsl.rb
CHANGED
data/musa-dsl.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'musa-dsl'
|
3
|
-
s.version = '0.26.
|
4
|
-
s.date = '2023-
|
3
|
+
s.version = '0.26.10'
|
4
|
+
s.date = '2023-10-30'
|
5
5
|
s.summary = 'A simple Ruby DSL for making complex music'
|
6
6
|
s.description = 'Musa-DSL: A Ruby framework and DSL for algorithmic sound and musical thinking and composition'
|
7
7
|
s.authors = ['Javier Sánchez Yeste']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: musa-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.26.
|
4
|
+
version: 0.26.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Sánchez Yeste
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logger
|
@@ -254,7 +254,7 @@ homepage: https://github.com/javier-sy/musa-dsl
|
|
254
254
|
licenses:
|
255
255
|
- LGPL-3.0
|
256
256
|
metadata: {}
|
257
|
-
post_install_message:
|
257
|
+
post_install_message:
|
258
258
|
rdoc_options: []
|
259
259
|
require_paths:
|
260
260
|
- lib
|
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
270
|
version: '0'
|
271
271
|
requirements: []
|
272
272
|
rubygems_version: 3.1.6
|
273
|
-
signing_key:
|
273
|
+
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: A simple Ruby DSL for making complex music
|
276
276
|
test_files: []
|