Skip to content
Browse files

MandelClock added, is essentially a TempoClock with a redirect to Man…

…delHub to tempo changes
  • Loading branch information...
1 parent 6ed91cb commit 7ba60f8315705e6b5db6c55dd161e5f22d794653 @cappelnord committed Jul 14, 2012
Showing with 31 additions and 3 deletions.
  1. +28 −0 MandelClock.sc
  2. +2 −2 MandelHub.sc
  3. +1 −1 MandelValue.sc
View
28 MandelClock.sc
@@ -0,0 +1,28 @@
+/*
+ MandelClock
+ (c) 2010-11 by Patrick Borgeat <patrick@borgeat.de>
+ http://www.cappel-nord.de
+
+ Part of BenoitLib
+ http://github.com/cappelnord/BenoitLib
+ http://www.the-mandelbrots.de
+
+ Adds a redirect to MandelHub for tempo changes
+
+*/
+
+
+MandelClock : TempoClock {
+ var <>hub;
+
+ // this calls into the hub, doing the tempo change
+ tempo_ {|newTempo|
+ hub.changeTempo(newTempo);
+ }
+
+ // this is called by MandelHub and is the actual tempo method
+ commitTempo {|newTempo|
+ this.setTempoAtBeat(newTempo, this.beats);
+ this.changed(\tempo); // this line is added
+ }
+}
View
4 MandelHub.sc
@@ -152,7 +152,7 @@ MandelHub {
server = a_server;
// start the clock
- clock = TempoClock.new(startTempo, startBeat, queueSize:4096);
+ clock = MandelClock.new(startTempo, startBeat).hub_(this);
clock.permanent_(true);
TempoClock.default = clock;
@@ -352,7 +352,7 @@ MandelHub {
};
tempo = newTempo;
- clock.tempo_(newTempo);
+ clock.commitTempo(newTempo);
this.changed(\tempo, newTempo);
leading.if {externalTempo = newTempo;};
}
View
2 MandelValue.sc
@@ -50,7 +50,7 @@ MandelValue : AbstractFunction {
}
asBusPlug {
- ^BusPlug.for(this.asBus) ;
+ ^BusPlug.for(this.asBus);
}
prCreateBus {

0 comments on commit 7ba60f8

Please sign in to comment.
Something went wrong with that request. Please try again.