From: ts@UWasa.Fi (Timo Salmi) Subject: Re: SOUND (frequencies) Date: 19 Dec 1998 00:00:00 GMT Message-ID: <75gt85$ovl@loisto.uwasa.fi> Expires: Sat, 02 Jan 1999 01:00:01 GMT References: <19981219093344.23856.00001409@ng61.aol.com> Organization: University of Vaasa X-Password: Spam foiling, elm filter will first return a required email password. X-Warning: Junk / bulk email will be auto-filtered, traced and reported. Newsgroups: comp.lang.pascal.misc In article <19981219093344.23856.00001409@ng61.aol.com>, MongoClike wrote: :the several sounds (C D E F G A H C). I only knew that A = 440 Hz that's all. :Please help me, it would be wonderful to get a table with all sounds. *** DRAFT *** -Subject: Play it again Sam 151. ***** Q: Is there a frequency table for the different notes (C C# D...)? A: A table is not needed. The following procedure produced the different notes. Uses Crt, FDelay; (* See item #124 Crt.delay problem on a fast PC *) (* Play one note *) procedure PLAYNOTE (note : string; octave : integer; duration : integer); function Power (number, exponent : real) : real; begin Power := Exp(exponent*Ln(number)); end; var i, j : integer; arg : word; begin i := Pos (note, 'c c#d d#e f f#g g#a a#b '); if (i=0) or not odd(i) then begin writeln ('Playnote: Parameter out ouf range'); halt; end; j := (octave-2)*12 + Round(i/2); arg := Trunc (61.74 * Power (Power (2, 1/12), j)); Sound (arg); Delay (duration); Nosound; Delay (20); end; (* playnote *) Here is a simple example procedure FINALE; const notevect = 'c f a c f a c f a c f a'; d = 70; var i : integer; begin for i := 1 to 12 do begin PLAYNOTE (Copy (notevect, 2*(i-1)+1, 2), 4, d); Delay (d); end; end; (* finale *) -------------------------------------------------------------------- All the best, Timo .................................................................... Prof. Timo Salmi Co-moderator of news:comp.archives.msdos.announce Moderating at ftp:// & http://garbo.uwasa.fi/ archives 193.166.120.5 Department of Accounting and Business Finance ; University of Vaasa mailto:ts@uwasa.fi ; FIN-65101, Finland Spam foiling in effect. My email filter autoresponder will return a required email password to users not yet in the privileges database. Advice on spam foiling at http://www.uwasa.fi/~ts/info/spamfoil.html