1
2
3
4 """
5 BaseComp.
6
7 A base composition module, custom composition modules should inherit from this class.
8
9 @author: Øyvind Brandtsegg
10 @contact: obrandts@gmail.com
11 @license: GPL
12 """
13
14 from constants import *
15
17 """
18 A simple test composition module. Generates melodies with limited random selection of pitch, delta, duration.
19 """
20
22 """
23 Class contructor.
24
25 @param self: The object pointer.
26 """
27
28 self.isPlaying = False
29 """A flag indicating if the composition process should continue playing or not."""
30 self.eventCaller = eventCaller
31 """Pointer to the event caller."""
32
55
57 """
58 Get event data from composition method, play event to Csound, insert "next" event in theTime queue.
59
60 @param self: The object pointer.
61 """
62 instrument, amp, pitch, delta, duration, pan, reverb = self.getData()
63 duration = duration * (60.0/self.eventCaller.theTime.bpm)
64 self.eventCaller.csMessages.csoundInputMessage('i %i 0 %f %f %i %f %f'%(instrument, duration, amp, pitch, pan, reverb))
65 return delta
66
68 """
69 Get parameter values for the next event in the composition. You should override this method with something useful.
70
71 @param self: The object pointer.
72 """
73 return 1,2,3,4,5,6,7
74