musa-dsl 0.23.8 → 0.23.9
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/series/main-serie-constructors.rb +10 -2
- data/lib/musa-dsl/series/series-composer.rb +11 -2
- data/musa-dsl.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79f0b29dc4afd60274d8c1e5727ae70d3233b91a004a0173b57e398f152dcf56
|
4
|
+
data.tar.gz: 7538b77296f7185211e56b344bd3d332afb6de8b2cfa95b166737830a524c68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91d9441bc8fb61321764876d90c7ac8079a475e4dd9ce4c12184e3262a7682bdce2cd5d66e272daa2e1e1233734d46bb9bda6232522781ab40e07f27ae5a51e7
|
7
|
+
data.tar.gz: c20a18071678dd0c68567de8a2f1b1b8b1a2fe1cf5d541b99bef712bce79385172e2102219d484acb5e131b25e52a94081e866c56b28736da244a48ead7d78b0
|
@@ -48,10 +48,14 @@ module Musa
|
|
48
48
|
ForLoop.new from, to, step
|
49
49
|
end
|
50
50
|
|
51
|
-
def RND(*values, from: nil, to: nil, step: nil, random: nil)
|
51
|
+
def RND(*_values, values: nil, from: nil, to: nil, step: nil, random: nil)
|
52
|
+
raise ArgumentError, "Can't use both direct values #{_values} and values named parameter #{values} at the same time." if values && !_values.empty?
|
53
|
+
|
52
54
|
random = Random.new random if random.is_a?(Integer)
|
53
55
|
random ||= Random.new
|
54
56
|
|
57
|
+
values ||= _values
|
58
|
+
|
55
59
|
if !values.empty? && from.nil? && to.nil? && step.nil?
|
56
60
|
RandomValuesFromArray.new values.explode_ranges, random
|
57
61
|
elsif values.empty? && !to.nil?
|
@@ -67,10 +71,14 @@ module Musa
|
|
67
71
|
Sequence.new(series)
|
68
72
|
end
|
69
73
|
|
70
|
-
def RND1(*values, from: nil, to: nil, step: nil, random: nil)
|
74
|
+
def RND1(*_values, values: nil, from: nil, to: nil, step: nil, random: nil)
|
75
|
+
raise ArgumentError, "Can't use both direct values #{_values} and values named parameter #{values} at the same time." if values && !_values.empty?
|
76
|
+
|
71
77
|
random = Random.new random if random.is_a?(Integer)
|
72
78
|
random ||= Random.new
|
73
79
|
|
80
|
+
values ||= _values
|
81
|
+
|
74
82
|
if !values.empty? && from.nil? && to.nil? && step.nil?
|
75
83
|
RandomValueFromArray.new values.explode_ranges, random
|
76
84
|
elsif values.empty? && !to.nil?
|
@@ -282,9 +282,18 @@ module Musa
|
|
282
282
|
when Proc
|
283
283
|
call_constructor_according_to_last_and_parameter(last.call, constructor, parameter)
|
284
284
|
|
285
|
+
when UndefinedSerie
|
286
|
+
case parameter
|
287
|
+
when Hash
|
288
|
+
Musa::Series::Constructors.method(constructor).call(**parameter)
|
289
|
+
when Array
|
290
|
+
Musa::Series::Constructors.method(constructor).call(*parameter)
|
291
|
+
else
|
292
|
+
raise "Unexpected parameter #{parameter} for constructor #{constructor}"
|
293
|
+
end
|
294
|
+
|
285
295
|
when Serie
|
286
|
-
|
287
|
-
Musa::Series::Constructors.method(constructor).call(*parameter)
|
296
|
+
raise "Unexpected source serie #{last} for constructor #{constructor}"
|
288
297
|
|
289
298
|
when nil
|
290
299
|
Musa::Series::Constructors.method(constructor).call(*parameter)
|
data/musa-dsl.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'musa-dsl'
|
3
|
-
s.version = '0.23.
|
3
|
+
s.version = '0.23.9'
|
4
4
|
s.date = '2021-08-03'
|
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'
|