Many real-time computer-music systems employ two different notions of time: “physical time” that is associated with hardware clocks and low-level scheduling, and “virtual time” which can be scaled or otherwise controlled by the user OSW provides a unified user-configurable view of physical and virtual time that encompasses both system functions (such as scheduling and sample clocks) and user control.
All transforms that depend on time, such as the Sinewave transform, a sample playback transform or a MIDI sequencer are automatically synchronized to a single clock (by default, the clock of an audio device being used). Users can gain more explicit control over time by optionally connecting such time-dependent components to time machines, special transforms that map physical time from clicks to virtual time, or scale virtual time output from other time machines. Time machines include parameters for scaling virtual time or resetting to a specified value (i.e., "go to this time"), thus allowing users to control the flow of time in the connected signal-processing components. The control functions can be arbitrarily complex, and include user input from MIDI or high-resolution gestural input devices. Consider the following example that uses two time machines:
Both Sinewave transforms are explicitly synchronized to the same time source via time machine tm0. However, while slow is directly connected to tm0, fast is connected to tm0 through a second time machine, tm1, which scales time by a factor of 1.5 (i.e., time at tm1 “runs 1.5 times faster”). Even though both fast and slow are set to the same frequency (261Hz or Middle C), the explicit speedup of time into fast will cause it to sound 1.5 times (or a perfect fifth) higher. A similar example is used in the “rate controls pitch” tutorial.
Time machines can be used to mimic the speed control on profession record players or tape decks (see the sample loop tutorial example), or as an expressive tempo controller when playing scores.
When you connect a signal generator, such as a Sinewave or a noise generator, to an audio output, it will continuously generate samples as long as the audio output is turned on. However, if a Sinewave transform is connected to a time machine, it will only generate output when it receives time input. Thus, time machines can be used to switch signals on and off even while the audio output is on:
Turning the ToggleButton on sets the Switch to 1, routing time output from the time machine tm1 to the BrownNoise transform, which then outputs samples. If the Switch is set to 0 (by turning the toggle off), then output from the time machine will no longer be routed to the noise generator, which is effectively shut off.
You can also use time machines to switch among several potential signals in a patch:
Setting the Switch from 0, 1 or 2 switches on the sinewave, phasor or noise generator.
Open the switcheroo tutorial to try out the examples in this section.