Package control :: Module theTime2 :: Class TheTime2
[hide private]
[frames] | no frames]

Class TheTime2

source code

        object --+            
                 |            
threading._Verbose --+        
                     |        
      threading.Thread --+    
                         |    
           theTime.TheTime --+
                             |
                            TheTime2

The class containing accurate timer and timed queue methods.

Thread safe queue handling is inherited from theTime.py. Automation is executed via a queue of events to be executed in time, format for the queue is a list of events, with each event represented as a list with the following format: [type, time, data]. The type field is a string, to be parsed in eventCaller.parseEvents(). Time is in beats and may be fractional. The data field may contain several parameters (not as sublist).

Instance Methods [hide private]
  __init__(self, eventCaller, bpm=60)
The class constructor.
  doKsmpsTick(self)
The main clock increment method, called from csound every ksmps period, also polling the event queue.
  setBpm(self, bpm)
Set the clock tempo in beats per minute.
  setTimePerKperiod(self, kr)
Set the time per control rate tick from csound.

Inherited from theTime.TheTime: checkQueue, getCurrentBeat, getQueue, insertListFromNow, insertQueue, insertQueue2, insertQueueWithOffset, insertQueueWithOffset2, removeEvent, removeEvent2, run, startStopClock, stop

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Instance Variables [hide private]
  queueMutex
The mutex for thread safe handling of the queue list.
  queue
The list of events in the timed queue.
  beatCounter
Counter for quarter notes at a given bpm.
  fractionalBeat
Counter for fractions of a beat.
  bpm
The tempo in beats per minute for the beat counter.
  runClock
Flag to run or pause the clock.
  csoundKr
Csound control rate, value will be set by csound at (csound) init.

Inherited from theTime.TheTime: isRunning, timeResolution


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, eventCaller, bpm=60)
(Constructor)

source code 
The class constructor.
Parameters:
  • self - The object pointer.
  • eventCaller - A pointer to the eventCaller object.
  • bpm - The beats per minute for the beat counter. Default = 60.
Overrides: theTime.TheTime.__init__

doKsmpsTick(self)

source code 
The main clock increment method, called from csound every ksmps period, also polling the event queue.
Parameters:
  • self - The object pointer.

setBpm(self, bpm)

source code 
Set the clock tempo in beats per minute.
Parameters:
  • self - The object pointer.
Overrides: theTime.TheTime.setBpm

setTimePerKperiod(self, kr)

source code 
Set the time per control rate tick from csound.
Parameters:
  • self - The object pointer.
  • kr - The csound control rate

Instance Variable Details [hide private]

queueMutex

The mutex for thread safe handling of the queue list.

queue

The list of events in the timed queue.

beatCounter

Counter for quarter notes at a given bpm.

fractionalBeat

Counter for fractions of a beat.

bpm

The tempo in beats per minute for the beat counter.

runClock

Flag to run or pause the clock.

csoundKr

Csound control rate, value will be set by csound at (csound) init.