rubygems-sing 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,9 @@
1
+ === 1.1.0 / 2010-01-26
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added blues scale and duration based on distance of ends. (topFunkay)
6
+
1
7
  === 1.0.0 / 2010-01-20
2
8
 
3
9
  * 1 major enhancement
@@ -3,12 +3,13 @@ require 'rubygems/version_option'
3
3
  require 'rubygems/text'
4
4
 
5
5
  require 'midiator'
6
+ require 'English'
6
7
 
7
8
  ##
8
9
  # gem command to "sing" the implementation of a gem.
9
10
 
10
11
  class Gem::Commands::SingCommand < Gem::Command
11
- VERSION = '1.0.0'
12
+ VERSION = '1.1.0'
12
13
 
13
14
  include MIDIator::Notes
14
15
  include MIDIator::Drums
@@ -56,8 +57,10 @@ class Gem::Commands::SingCommand < Gem::Command
56
57
  midi = MIDIator::Interface.new
57
58
  midi.use :dls_synth
58
59
 
59
- scale = [ C4, Cs4, D4, Eb4, E4, F4, Fs4, G4, Gs4, A4, Bb4, B4,
60
- C5, Cs5, D5, Eb5, E5, F5, Fs5, G5, Gs5, A5, Bb5, B5 ]
60
+ # blues scale
61
+ scale = [ C4, Eb4, F4, Fs4, G4, Bb4,
62
+ C5, Eb5, F5, Fs5, G5, Bb5,
63
+ C6, Eb6, F6, Fs6, G6, Bb6 ]
61
64
 
62
65
  midi.control_change 32, 10, 1 # TR-808 is Program 26 in LSB bank 1
63
66
  midi.program_change 10, 26
@@ -67,10 +70,27 @@ class Gem::Commands::SingCommand < Gem::Command
67
70
  spec.lib_files.each do |path|
68
71
  full_path = File.join base, path
69
72
  warn path
73
+
74
+ line_number_of_last_end = 0
70
75
  File.foreach(full_path) do |line|
71
76
  if line =~ /^(\s+)end$/ then
77
+ number_of_lines_in_block = $INPUT_LINE_NUMBER - line_number_of_last_end
78
+ duration = case number_of_lines_in_block
79
+ when 0 .. 3
80
+ 0.1
81
+ when 4 .. 10
82
+ 0.25
83
+ when 11 .. 30
84
+ 0.5
85
+ else
86
+ 1.0
87
+ end
88
+
89
+ duration *= 0.8 # tweaking for now...
90
+
91
+ line_number_of_last_end = $INPUT_LINE_NUMBER
72
92
  num_spaces = $1.size
73
- midi.play scale[ num_spaces / 2 ]
93
+ midi.play scale[ num_spaces / 2 ], duration
74
94
  print line
75
95
  end
76
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-sing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -30,7 +30,7 @@ cert_chain:
30
30
  FBHgymkyj/AOSqKRIpXPhjC6
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2010-01-20 00:00:00 -08:00
33
+ date: 2010-01-26 00:00:00 -08:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file