From a6ed3110e409bb5d1b71a01cafa9f51baa854cf1 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 27 Aug 2015 13:10:38 -0400 Subject: [PATCH] cmVectOpsTemplateCode.h : Fixed bug in SynthImpulse. --- vop/cmVectOpsTemplateCode.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vop/cmVectOpsTemplateCode.h b/vop/cmVectOpsTemplateCode.h index 23b9838..6fa204c 100644 --- a/vop/cmVectOpsTemplateCode.h +++ b/vop/cmVectOpsTemplateCode.h @@ -1894,10 +1894,13 @@ unsigned VECT_OP_FUNC(SynthImpulse)( VECT_OP_TYPE* dbp, unsigned dn, unsi VECT_OP_FUNC(Zero)(dbp,dn); unsigned i=0; + unsigned j=dn; while(1) { double samplesPerCycle = srate / hz; - unsigned j = round( (srate * i + phase) / hz); + + j = round( (srate * i + phase) / hz); + if( j >= dn ) break;