Xref: utzoo rec.music.makers:6294 comp.music:592 Path: utzoo!attcan!uunet!snorkelwacker!think!linus!philabs!fcg@synapse From: fcg@synapse (Frank C. Guida) Newsgroups: rec.music.makers,comp.music Subject: Re: Guitarist's Helper Keywords: bug fix Message-ID: <73688@philabs.Philips.Com> Date: 12 Jan 90 20:20:51 GMT References: <73020@philabs.Philips.Com> Sender: news@philabs.Philips.Com Reply-To: fcg@philabs.philips.com (Frank C. Guida) Followup-To: rec.music.makers Distribution: na Organization: Philips Laboratories, Briarcliff Manor, NY Lines: 37 In-reply-to: fcg@philabs.philips.com (Frank C. Guida) Sorry folks, I discovered a typo shortly after posting my fretbd program to the net. I'd also like to thank the other readers who pointed this bug out. The problem is the loop near line 170. Its purpose being to bring the note index into the correct range (0-11) when building a scale from an interval pattern. while( note_idx > 11 ) /* correct any overflow */ note_idx =- 12; The "=-" should be changed to "-=". Newer compilers will expand this to "note_idx = - 12", resulting in a negative array subscript which will cause various errors. Stephen R. Tate suggested a more elegant solution to the problem: replace the entire loop with the single line note_idx %= 12; /* correct any overflow */ A similar situation can be found in the function print_fretbd(), at around line 176 (except that here I used the correct form of "-="). Thanks again for your input. - Yours truly ______________________________________________________________________ Frank C. Guida Philips Laboratories fcg@philabs.philips.com Autonomous Systems Dept. (914)-945-6246 Briarcliff Manor, NY 10510 ______________________________________________________________________ Frank C. Guida Philips Laboratories fcg@philabs.philips.com Autonomous Systems Dept. (914)-945-6246 Briarcliff Manor, NY 10510