// title: beats to bar printing // author: vtz // description: // Prints beats to bars for a mutiple of bar. // How many beats left until next 1, 2, 4, 8, 16, 32, etc bar. // code: ( f = (); f.beatAndBar = { var t = currentEnvironment.clock; // t= TempoClock.new; var text = "xB: "; var nBeatsPerBar = { arg n, beats, clock; var nBpb = clock.beatsPerBar * n; "" ++ n ++ text ++ (nBpb - (beats%(nBpb))).asInteger }; t.play({arg beats, time, clock; ( //["beat: " ++ (t.beatInBar + 1).asInteger] ++ //uncomment for beat in bar [1,2,4,8,16,32].collect( {|n,i| nBeatsPerBar.value(n, beats, clock)}) ).postln; 1}); "beatAntBar"; } ) f[\beatAndBar].value; ( f[\beatAndBar].value; CmdPeriod.add(f[\beatAndBar]); )