patchmaster 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -105,8 +105,12 @@ class Main
105
105
  end
106
106
  end
107
107
 
108
- def bind_message(name, key_sym)
109
- @message_bindings[FUNCTION_KEY_SYMBOLS[key_sym]] = name
108
+ def bind_message(name, key_or_sym)
109
+ if FUNCTION_KEY_SYMBOLS.keys.include?(key_or_sym)
110
+ @message_bindings[FUNCTION_KEY_SYMBOLS[key_or_sym]] = name
111
+ else
112
+ @message_bindings[key_or_sym] = name
113
+ end
110
114
  end
111
115
 
112
116
  def config_curses
@@ -6,6 +6,7 @@ module PM
6
6
  {:C => 0, :D => 2, :E => 4, :F => 5, :G => 7, :A => 9, :B => 11}.each { |note,val|
7
7
  base = (oct+1) * 12 + val
8
8
  eval <<EOS
9
+ #{note}#{oct} = #{base}
9
10
  #{note}f#{oct} = #{base - 1}
10
11
  #{note}b#{oct} = #{base - 1}
11
12
  #{note}s#{oct} = #{base + 1}
@@ -47,12 +47,12 @@ class DSL
47
47
  alias_method :out, :output
48
48
 
49
49
  def message(name, bytes)
50
- @pm.messages[name] = bytes
50
+ @pm.messages[name.downcase] = bytes
51
51
  end
52
52
 
53
- def message_key(name, key_sym)
53
+ def message_key(name, key_or_sym)
54
54
  if !@pm.no_gui # TODO get rid of double negative
55
- PM::Main.instance.bind_message(name, key_sym)
55
+ PM::Main.instance.bind_message(name, key_or_sym)
56
56
  end
57
57
  end
58
58
 
@@ -118,9 +118,10 @@ class PatchMaster < SimpleDelegator
118
118
  @running
119
119
  end
120
120
 
121
- # Send the message with the given name to all outputs.
121
+ # Send the message with the given +name+ to all outputs. Names are matched
122
+ # case-insensitively.
122
123
  def send_message(name)
123
- msg = @messages[name]
124
+ msg = @messages[name.downcase]
124
125
  if !msg
125
126
  message("Message \"#{name}\" not found")
126
127
  return
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patchmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-27 00:00:00.000000000 Z
12
+ date: 2012-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: midi-eye
16
- requirement: &2156046340 !ruby/object:Gem::Requirement
16
+ requirement: &2156045140 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156046340
24
+ version_requirements: *2156045140
25
25
  description: ! 'PatchMaster is realtime MIDI performance software that alloweds a
26
26
  musician
27
27