diff _chroma/sparsePrint.m @ 8:b5b38998ef3b

added all that other stuff
author matthiasm
date Fri, 11 Apr 2014 15:54:25 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_chroma/sparsePrint.m	Fri Apr 11 15:54:25 2014 +0100
@@ -0,0 +1,48 @@
+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);
\ No newline at end of file