John Galt #1 Try for k=0 to 31 - going up to 32 will introduce a small discontinuity in your sine wave. Don't add note on as a constant - you need it as a frequency multiplier inside the bracket. Use decimals in all your numbers, eg 360.0/32.0.