sizeMat = size(cosw);

fid  = fopen('/Users/matthiasmauch/Documents/_workspace/2010/2010-VampDevel-code/plugin-tutorial/coskernel-20-105-3-11025-4096-80.cpp','w');

fprintf(fid, 'const int lengthOfNoteIndex = %0.0f;\n\n', sum(cosw(:)>0));

fprintf(fid, 'const int nNote = %0.0f;\n\n', sizeMat(2));

fprintf(fid,'const int noteIndex[] = {')

for iCol = 1:sizeMat(2)
    for iRow = 1:sizeMat(1)
        if cosw(iRow,iCol) > 0
            fprintf(fid, '%0.0f,',iCol-1);
        end
    end
    fprintf(fid,'\n');
end
fprintf(fid,'};\n\n');transform

% ---------------------------
fprintf(fid,'const int fftBin[] = {')

for iCol = 1:sizeMat(2)
    for iRow = 1:sizeMat(1)
        if cosw(iRow,iCol) > 0
            fprintf(fid, '%0.0f,',iRow-1);
        end
    end
    fprintf(fid,'\n');
end
fprintf(fid,'};\n\n');

% ---------------------------
fprintf(fid,'const double transfValue[] = {')

for iCol = 1:sizeMat(2)
    for iRow = 1:sizeMat(1)
        if cosw(iRow,iCol) > 0
            fprintf(fid, '%0.5f,',cosw(iRow,iCol));
        end
    end
    fprintf(fid,'\n');
end
fprintf(fid,'};\n\n');


fclose(fid);