{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 \cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;} {\colortbl;\red255\green255\blue255;\red9\green18\blue155;\red99\green41\blue23;\red0\green0\blue177; \red13\green99\blue1;} \deftab560 \pard\pardeftab560 \f0\b\fs36 \cf0 Tempo \fs28 tempo calculations \b0 \ \fs24 \ see also: TempoBus, TempoPlayer\ \ This class represents the concept of tempo. It can be used for translations between seconds, beats and bars. It holds an instance of TempoClock which it keeps set to its own tempo.\ \ It can be used to convert beats <-> seconds, but this value is only accurate at the time you make the computation. If the tempo is changed the value is no longer valid. TempoBus adds itself as a dependant to the Tempo object, so when the tempo changes, it is informed, and it updates the value on the bus.\ \ \f1\fs20 \cf2 Tempo\cf0 .bpm = 170; \ \cf2 Tempo\cf0 .tempo = 2.3; \cf3 // in beats per second\ \cf0 \ \cf2 Tempo\cf0 .gui; \cf3 // there is a gui class\ \cf0 \ \cf2 Tempo\cf0 .bpm = 170; \ \cf2 Tempo\cf0 .beats2secs(4.0).postln;\ \ \cf2 Tempo\cf0 .bpm = 10; \ \cf2 Tempo\cf0 .beats2secs(4.0).postln;\ \ \ \f0\fs24 All class methods refer to the default global tempo.\ You can create an instance of Tempo if you need individual, separate tempii.\ \f1\fs20 \ t = \cf2 Tempo\cf0 .new;\ u = \cf2 Tempo\cf0 .new;\ \ t.bpm = 170; \ u.tempo = 1.3; \cf3 // in beats per second\ \cf0 t.gui;\ \ \f0\fs24 All of the following methods exist as class methods (the default tempo)\ and as instance methods.\ \f1\fs20 \ \f0\b\fs24 bpm \b0 \ \b bpm_(beatsPerMinute) \b0 \ Tempo.bpm = 96;\ or\ Tempo.bpm_(96);\ \b tempo \b0 \ in beats per second\ \b tempo_(beatsPerSecond) \b0 \ Tempo.tempo = 2.0;\ or\ Tempo.tempo_(2.0);\ \ \b beats2secs(beats) \b0 \ \b secs2beats(seconds) \b0 \ \b bars2secs(bars) \b0 \ you can change the beats per bar:\ Tempo.beatsPerBar = 7.0;\ \b secs2bars(seconds) \b0 \ \ \b sched(delta,function) \b0 \ Schedule a function to be evaluated delta beats from now.\ OSCSched and BeatSched are more comprehensive\ \ \b schedAbs(beat,function) \b0 \ Schedule a function to be evaluated at an absolute beat, as measured\ from the time SuperCollider first booted up.\ OSCSched and BeatSched are more comprehensive\ \ \ \b *kr \b0 \ \b kr \b0 \ creates a tempo control inside an instr synth def.\ changing the tempo on the client will send tempo changes to the synth playing on the server.\ This is a shortcut to creating a TempoPlayer\ \ (\ \f1\fs18 \cf4 Instr\cf0 (\cf5 \\helpTempoPlayer\cf0 ,\{\cf5 \ \cf0 \cf4 Impulse\cf0 .ar( \cf4 Tempo\cf0 .kr )\ \});\ \ \cf4 Patch\cf0 (\cf5 \\helpTempoPlayer\cf0 ).play\cf5 \ \f0\fs24 \cf0 )\ \ \ A TempoBus can be started on the server, and it will keep the Tempo object's tempo as a float control value on a Bus on the server. UGens can then use this for scaling their frequencies for beat based rhythms etc.\ \ \ \ \ }