     while descriptor = @dequeueNextDescriptor()
       descriptor.callback.apply(undefined)
 
+  invalidateBeatLength: ->
+    for descriptor in @callbackDescriptors
+      if descriptor.interval.hasBeatValue()
+        descriptor.interval = descriptor.interval.beats()
+
 
 # All timer DSL functions (every, until, after) are called with an instance of
 # TopLevelScope or ShadowScope as `this.` Initially, we create a TopLevelScope

#
# TinyRave Object
TinyRave = {
  setBPM: (@BPM) ->
  getBPM: -> @BPM
  timer: new TinyRaveTimer()
}


#
# Core Extensions

# We can treat 5.beats() as a value in seconds and recover the correct duration
# if BPM changes. Do do so, call number.beats() if number.hasValueInBeats()
Number.prototype.beats = Number.prototype.beat = ->
  valueInBeats = this.valueInBeats || this
  seconds = new Number(valueInBeats / (TinyRave.BPM / 60))
  seconds.valueInBeats = valueInBeats
  seconds

Number.prototype.hasValueInBeats = ->
  this.valueInBeats?
