Exemplo n.º 1
0
 def scoreEvent(self, eventType, pvals, absp2mode = 0):
     """Send a score event to csound"""
     n = len(pvals)
     if csnd.csoundGetSizeOfMYFLT() == 8:
         pfields = csnd.doubleArray(n)
     else:
         pfields = csnd.floatArray(n)
     for i in xrange(n):
         pfields[i] = pvals[i]
     self.pt.ScoreEvent(absp2mode, eventType, n, pfields)
Exemplo n.º 2
0
 def note(self, pvals, absp2mode = 0):
     """Send a score note to a csound instrument"""
     n = len(pvals)
     if csnd.csoundGetSizeOfMYFLT() == 8:
         pfields = csnd.doubleArray(n)
     else:
         pfields = csnd.floatArray(n)
     for i in xrange(n):
         pfields[i] = pvals[i]
     return self.pt.ScoreEvent(absp2mode, 'i', n, pfields)
Exemplo n.º 3
0
 def scoreEvent(self, eventType, pvals, absp2mode=0):
     """Send a score event to csound"""
     n = len(pvals)
     if csnd.csoundGetSizeOfMYFLT() == 8:
         pfields = csnd.doubleArray(n)
     else:
         pfields = csnd.floatArray(n)
     for i in xrange(n):
         pfields[i] = pvals[i]
     self.pt.ScoreEvent(absp2mode, eventType, n, pfields)
Exemplo n.º 4
0
 def note(self, pvals, absp2mode=0):
     """Send a score note to a csound instrument"""
     n = len(pvals)
     if csnd.csoundGetSizeOfMYFLT() == 8:
         pfields = csnd.doubleArray(n)
     else:
         pfields = csnd.floatArray(n)
     for i in xrange(n):
         pfields[i] = pvals[i]
     return self.pt.ScoreEvent(absp2mode, 'i', n, pfields)
Exemplo n.º 5
0
 def getTableBuffer(self, num):
     """Return a buffer pointing to the stored data of an ftable or raise an exception"""
     if self.TableLength(num) > 0:
         tbl = csnd.CsoundMYFLTArray()
         tblSize = self.GetTable(tbl.GetPtr(), num) + 1  # don't forget the guard point!
         if csnd.csoundGetSizeOfMYFLT() == 8:
             myflt = ctypes.c_double
         else:
             myflt = ctypes.c_float
         return ctypes.ARRAY(myflt, tblSize).from_address(tbl.GetPtr(0).__long__())
     else:
         raise(ValueError("ftable number %d does not exist!" % (num)))
Exemplo n.º 6
0
 def getTableBuffer(self, num):
     """Return a buffer pointing to the stored data of an ftable or raise an exception"""
     if self.TableLength(num) > 0:
         tbl = csnd.CsoundMYFLTArray()
         tblSize = self.GetTable(tbl.GetPtr(), num) + 1  # don't forget the guard point!
         if csnd.csoundGetSizeOfMYFLT() == 8:
             myflt = ctypes.c_double
         else:
             myflt = ctypes.c_float
         return ctypes.ARRAY(myflt, tblSize).from_address(tbl.GetPtr(0).__long__())
     else:
         raise(ValueError("ftable number %d does not exist!" % (num)))