Skip to content

Instantly share code, notes, and snippets.

@bomatson
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save bomatson/9556805 to your computer and use it in GitHub Desktop.

Select an option

Save bomatson/9556805 to your computer and use it in GitHub Desktop.
class Surface
#...
SNARE_OPTIONS = { left: -51, right: 0, note: 38 }
KICK_OPTIONS = { left: 0, right: 100, note: 36 }
HAT_OPTIONS = { left: -100, right: -50, note: 57 }
def initialize(drum_type=nil, *opts)
case drum_type
when :snare
opts = SNARE_OPTIONS
when :kick
opts = KICK_OPTIONS
when :hat
opts = HAT_OPTIONS
end
if opts.present?
@left_boundary = opts[:left]
@right_boundary = opts[:right]
@drum_note = opts[:note]
end
end
#...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment