Path: utzoo!utgpu!news-server.csri.toronto.edu!qucdn!spraggej Organization: Queen's University at Kingston Date: Tuesday, 30 Apr 1991 18:37:53 EDT From: John G. Spragge Message-ID: <91120.183753SPRAGGEJ@QUCDN.QueensU.CA> Newsgroups: comp.lang.pascal Subject: Re: sounds for games.. References: <12728@uhccux.uhcc.Hawaii.Edu> There are two ways to do it. Cheap & dangerous: REPEAT getinput (cmd); IF (CLOCK - startnote > notelen) AND NOT endsong THEN BEGIN getnextnote (tone, notelen); SOUND (tone) END ELSE NOSOUND; docmd (cmd, done); UNTIL done; In other words, put the sound generator in your main program loop, and check, change, or end the sound on each pass through. BIG danger: if your program slows down, your ditty gets distorted, and drives the user bats. Hard and safe: use the timer to drive your song. I think someone posted it here last year; information should be available at some FTP site. disclaimer: Queen's University supplies me with computer services, not my opinions. John G. Spragge