-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnodes.py
More file actions
27 lines (23 loc) · 771 Bytes
/
Copy pathnodes.py
File metadata and controls
27 lines (23 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class MusicNode(object):
global_keys = {}
def __init__(self, *args, **kwargs):
print "Creating MusicNode:", self.__class__.__name__
self.enabled = True
if hasattr(self, "init"):
self.init(*args)
self.holding = []
def get_subdiv(self):
if hasattr(self, 'subdiv'):
return self.subdiv
elif hasattr(self.__class__, 'subdiv'):
return self.__class__.subdiv
else:
return 1
def release_all(self, beat):
"""
Release all holding synths at beat.
This is called automatically at the end of a sequence.
"""
for holding in self.holding:
holding.set_at(beat.time, gate=0)
self.holding = []