void CsoundObject_writeOpenCLPVSReadPath(CsoundObject *self,
                                         size_t triangleFilterBandsCount,
                                         size_t *bestTriangleBandMatches,
                                         Float32 *paletteSegmentFramesCounts,
                                         Float32 *paletteMagnitudeDifferences,
                                         Matrix32 *triangleBandGains)



{
    
    Float32 frameLengthInSeconds = 1./44100. * 256.;
    for (size_t i = 0; i < triangleFilterBandsCount; ++i) {
        
        Float32 paletteSegmentLengthInSeconds = frameLengthInSeconds * paletteSegmentFramesCounts[i];
        Float32 startFrameInSeconds = (Float32)bestTriangleBandMatches[i] * frameLengthInSeconds;
        Float32 endFrameInSeconds = startFrameInSeconds + paletteSegmentLengthInSeconds;

        Float32 *warpTablePointer, *bandGainTablePointer;
        
        csoundGetTable(self->csound, &warpTablePointer, (SInt32)(warpPathTableBaseNumber + i));
        csoundGetTable(self->csound, &bandGainTablePointer, (SInt32)(bandGainTableBaseNumber + i));

        vDSP_vgen(&startFrameInSeconds, &endFrameInSeconds, warpTablePointer, 1, self->analysisSegmentFramesCount);
        
        vDSP_vsmul(Matrix_getRow(triangleBandGains, i), 1, &paletteMagnitudeDifferences[i], bandGainTablePointer, 1, triangleBandGains->columnCount);
//        vDSP_vsadd(self->frameTimes, 1, &startFrameInSeconds, tablePointer, 1, self->analysisSegmentFramesCount);        
    }
}
Exemple #2
0
MYFLT *PyQcsObject::getTableArray(int ftable, int index)
{
	CsoundEngine *e = m_qcs->getEngine(index);
	if (e != NULL) {
		CSOUND *cs = e->getCsound();
		int ret = csoundGetTable(cs, m_tablePtr, ftable);
	}
	return *m_tablePtr;
}
void CsoundObject_writeDataToTable(CsoundObject *self, UInt32 tableNumber, Float32 *data, UInt32 dataCount)
{
    self->csoundScore[0] = tableNumber;
    self->csoundScore[1] = 0;
    self->csoundScore[2] = -((Float32)dataCount);
    self->csoundScore[3] = 2;
    self->csoundScore[4] = 0;
    
    csoundScoreEvent(self->csound, 'f', self->csoundScore, 5);
    csoundPerformKsmps(self->csound);
    
    Float32 *tablePointer;
    
    csoundGetTable(self->csound, &tablePointer, tableNumber);
    
    cblas_scopy((UInt32)dataCount, data, 1, tablePointer, 1);
    
}
void CsoundObject_writePVSReadPath(CsoundObject *self,
                                   size_t *segmentStartFrames,
                                   size_t triangleFilterBandsCount,
                                   Matrix32 *warpPaths)


{
    
    Float32 frameLengthInSeconds = 1./44100. * 256.;
    
    for (size_t i = 0; i < triangleFilterBandsCount; ++i) {
        
        Float32 startFrameInSeconds = (Float32)segmentStartFrames[i] * frameLengthInSeconds;
        Float32 *tablePointer;
        
        csoundGetTable(self->csound, &tablePointer, (SInt32)(warpPathTableBaseNumber + i));
        vDSP_vsadd(Matrix_getRow(warpPaths, i), 1, &startFrameInSeconds, tablePointer, 1, self->analysisSegmentFramesCount);
        
    }
}
Exemple #5
0
float *CsoundObj_getTable(CsoundObj *self, int tableNumber)
{
    float *tablePointer;
    csoundGetTable(self->csound, &tablePointer, tableNumber);
    return tablePointer;
}
Exemple #6
0
int CsoundObj_getTableLength(CsoundObj *self, int tableNumber)
{
    return csoundGetTable(self->csound, NULL, tableNumber);
}