how to specify the position of next note to be added i tried with following code but it is generating randomly even over the previous note .but the next note should not be on t