musa-dsl 0.23.5 → 0.23.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19683437b5ef89739c0d1283c86b18c547a24dd058ca5013abdea4f9c6335f5c
4
- data.tar.gz: 99fea2b0076baf8976050bd9467f4ecafb87a44bad1b37933e741116f1f5ec96
3
+ metadata.gz: d4151142ca6664ad550224f1ab9af55f31ce8982ff24cd4bfdd5bcd02bd45756
4
+ data.tar.gz: 9c2f01bb75266047984017e7edbd7f18ed353c34321b197af0faf7a3e385449a
5
5
  SHA512:
6
- metadata.gz: 26765814873920f392a76fdef1f8f7fc6ce3baca086d47ba443fb74246768943dbe074ebc35b71d946aab7136fd6a433fe03ad897bcff8a16e7045a1fd0c5e7f
7
- data.tar.gz: 57a1761af4bb50cb40c75680e89716e8f21b8f5a4ea345b42bdb3e2065f58a315fac8b579227741b601c25f2e2e8a617d7fef2cd799366f7df4b749c9a532ec9
6
+ metadata.gz: 5b02d2620956fd954a7435bb7b6888d7107d02b7e57722a0f5e2f84c57f38576eab3a3bc5972b058387bcf4ad92833acce44d60c2808f36690e865b2ac776d38
7
+ data.tar.gz: 6a13c17fb864649fe6881e5ee3d34f2c1c48ada65b1640835310fb1658897d43a631cb63c30a186c7fa71bf3cee809ddd46627a36869a25a0a94099ea079bcb0
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby '2.7.3'
4
+
3
5
  gem 'logger', '~> 1.4', '>= 1.4.3'
4
6
 
5
7
  group :neuma do
@@ -6,7 +6,7 @@ module Musa
6
6
  module Series
7
7
  module Operations
8
8
  def composer(&block)
9
- Composer::Composer.new(&block).tap { |_| _.input.proxy_source = self}.output
9
+ Composer::Composer.new(input: self, &block).output
10
10
  end
11
11
  end
12
12
 
@@ -14,9 +14,22 @@ module Musa
14
14
  class Composer
15
15
  using Musa::Extension::Arrayfy
16
16
 
17
- def initialize(inputs: [:input], outputs: [:output], auto_commit: nil, &block)
17
+ def initialize(input: nil, inputs: [:input], outputs: [:output], auto_commit: nil, &block)
18
18
  auto_commit = true if auto_commit.nil?
19
19
 
20
+ inputs = case inputs
21
+ when Array
22
+ inputs.collect { |_| [_, nil] }.to_h
23
+ when nil
24
+ {}
25
+ when Hash
26
+ inputs
27
+ else
28
+ raise ArgumentError, "inputs: expected a Hash with input names and source series { name: serie, ... } or an Array with names [name, ...] but received #{inputs}"
29
+ end
30
+
31
+ inputs[:input] = input if input
32
+
20
33
  @pipelines = {}
21
34
 
22
35
  def @pipelines.[]=(name, pipeline)
@@ -28,8 +41,10 @@ module Musa
28
41
  @inputs = {}
29
42
  @outputs = {}
30
43
 
31
- inputs&.each do |input|
44
+ inputs.keys&.each do |input|
32
45
  p = PROXY()
46
+ p.proxy_source = inputs[input] if inputs[input]
47
+
33
48
  @inputs[input] = @pipelines[input] = Pipeline.new(input, input: p, output: p.buffered, pipelines: @pipelines)
34
49
 
35
50
  @dsl.define_singleton_method(input) { input }
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.23.5'
4
- s.date = '2021-07-28'
3
+ s.version = '0.23.6'
4
+ s.date = '2021-07-29'
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.23.5
4
+ version: 0.23.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Sánchez Yeste
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citrus