TheAudiophileDutchman ·
For playing a sample from start to finish (at fixed standard frequency) I use the following functional code:
polyin samplelength; polyin freq; polyout ind; ind=ind+1-((ind>35320)&1); // 'samplelength' instead of 35320 doesn't work
....the SM SSE assembler yields:
polyin samplelength; polyin freq; polyout ind; float F1P0000000000=1.0000000000; float F35320P0000000000=35320.0000000000; movaps xmm0,ind; addps xmm0,F1P0000000000; movaps xmm1,ind; cmpps xmm1,F35320P0000000000,6; movaps xmm2,xmm1; andps xmm2,F1P0000000000; subps xmm0,xmm2; //Assignment> sLeft=xmm0 movaps ind,xmm0;
Being relatively new to SM, I wonder whether it would be possible to use the variable 'samplelength' (instead of a constant value), automatically generating assembly instructions like these:
movaps xmm3,samplelength; cmpps xmm1,xmm3,6; // valid opcode combination in SM?
This would add some flexibility imho, or am I overlooking something here? For instance, is there a better option than 'polyin' for transferring 'samplelength' to the code module (I already tried 'monoin'). [/url]