picotune 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/picotune.rb +13 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e57f6a22a29ff8a1c1351c5d605eb5a1b39bf25b69989dfff852819bcf4dc181
4
- data.tar.gz: 634ad7d42ddcdd5943e714a42bc7d93a51c1bf2f2522ccdc0e415b3239e0afbb
3
+ metadata.gz: de0cea1678fa0056bb4da4e3a016166160b1e1190a13f067f38d6cf620d07a54
4
+ data.tar.gz: f18fb53c744d050f6cf6632855fbd239fb4cd3ce45fa636f18dc27d65f42355c
5
5
  SHA512:
6
- metadata.gz: 6d59d66810aca618e911c54ec1fae977f2e52b4a6962dd3e22baf3abaeb70586ac27d40160d03e9119a7bae031b2c5e8460d030be5411ba29eae44373afaed5d
7
- data.tar.gz: c8d003ca2a3c684bfeebce155639273197f1726069c5e7ce159e95425885fc7a803a23602e80bfdd81726836464efdd17c515cbff55f7c2359308c6315c3622e
6
+ metadata.gz: e745f4dd1af6767c828f711019a8c3a2c9f16027b5a7dba7647c519e2dfe06fa24ec8a00c51219b599092854f1a1e7b5918801846684d2b4ded7b1403fd50771
7
+ data.tar.gz: d532fac56aac02ad6353c3328ed2baca6a968566bbe721dbec25e7969ccb5e7f73b7b60b4869ddfa49a5e27eb17e7cc6dc5acd2fc90d186c1b7f94308a9ad189
data/lib/picotune.rb CHANGED
@@ -290,7 +290,7 @@ class PicoTune::Phrase
290
290
  temp[i + melody.instrument.reverb_offset] = verb_sample
291
291
  end
292
292
 
293
- samples[i] = samples[i].add temp[i]
293
+ samples[i] = (samples[i] || PicoTune::Sample.new).add temp[i]
294
294
 
295
295
  i += 1
296
296
  end
@@ -308,7 +308,7 @@ class PicoTune::Instrument
308
308
  attr_reader :name, :tone, :length, :volume, :pan, :reverb
309
309
  attr_accessor :phrase
310
310
 
311
- def initialize name, tone = 0, length = 'full', volume = 'full', pan = 'center', reverb = 'none'
311
+ def initialize name, tone, length, volume, pan, reverb
312
312
  @name = name
313
313
  @tone = tone
314
314
  @length = length
@@ -329,6 +329,8 @@ class PicoTune::Instrument
329
329
  0.75
330
330
  when 'full'
331
331
  1.0
332
+ else
333
+ 1.0
332
334
  end
333
335
  end
334
336
 
@@ -344,6 +346,8 @@ class PicoTune::Instrument
344
346
  0.75
345
347
  when 'full'
346
348
  1.0
349
+ else
350
+ 1.0
347
351
  end
348
352
  end
349
353
 
@@ -359,6 +363,8 @@ class PicoTune::Instrument
359
363
  3
360
364
  when 'right'
361
365
  4
366
+ else
367
+ 2
362
368
  end
363
369
  end
364
370
 
@@ -463,11 +469,11 @@ class PicoTune::Assembler
463
469
  instruments = list.select { |item| item['type'] == 'instrument' }.map do |item|
464
470
  PicoTune::Instrument.new(
465
471
  item['name'],
466
- item['tone'],
467
- item['length'],
468
- item['volume'],
469
- item['pan'],
470
- item['reverb']
472
+ item['tone'] || 'sine',
473
+ item['length'] || 'full',
474
+ item['volume'] || 'full',
475
+ item['pan'] || 'center',
476
+ item['reverb'] || 'none'
471
477
  )
472
478
  end
473
479
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picotune
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Schroeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-14 00:00:00.000000000 Z
11
+ date: 2021-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wavefile