Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MUSIC FILES Posted by mr.programmer on 28 Sept 2003 at 12:59 AM
Can somebody out there compose for me any kind of music into pascal music tones(numbers) so that I can develope a program that plays that particular song when its compiled and run.
ie
sound()
delay()
nosound
sound()
delay()
etc
Help please im in a fix

Report
Re: MUSIC FILES Posted by Perran on 28 Sept 2003 at 3:56 AM
: Can somebody out there compose for me any kind of music into pascal music tones(numbers) so that I can develope a program that plays that particular song when its compiled and run.
: ie
: sound()
: delay()
: nosound
: sound()
: delay()
: etc
: Help please im in a fix
:
:
The parameter that sound() takes is a frequency in hertz. I'm sure the note played back is only approximate. The parameter that delay() takes is in milliseconds. So, make yourself a table of constants and define notes and timing like:
const
  Q = 300; {quarter note}
  H = 600; {half note} 
  {etc...........}

  A = 440; {A440...duh}
  G = 392; {G} 
  {etc...........}

Then write yourself a procedure that will play each note for the specified time. You can pass it a frequency and duration. Piece of cake. I wouldn't be surprised if this is schoolwork, so you will need to hack away at it. If you run into problems, post your code back here and someone will help you.
Report
Re: MUSIC FILES : a little humor... Posted by delljohnb on 29 Sept 2003 at 9:10 AM
: : Can somebody out there compose for me any kind of music into pascal music tones(numbers) so that I can develope a program that plays that particular song when its compiled and run.
: : ie
: : sound()
: : delay()
: : nosound
: : sound()
: : delay()
: : etc
: : Help please im in a fix
: :
: :
: The parameter that sound() takes is a frequency in hertz. I'm sure the note played back is only approximate. The parameter that delay() takes is in milliseconds. So, make yourself a table of constants and define notes and timing like:
:
: const
:   Q = 300; {quarter note}
:   H = 600; {half note} 
:   {etc...........}
: 
:   A = 440; {A440...duh}
:   G = 392; {G} 
:   {etc...........}
: 

: Then write yourself a procedure that will play each note for the specified time. You can pass it a frequency and duration. Piece of cake. I wouldn't be surprised if this is schoolwork, so you will need to hack away at it. If you run into problems, post your code back here and someone will help you.
:



I wish I'd had the internet to look for solutions when I took Pascal back in 1984. LOL.....maybe I'd have more hair still!!!!

Delljohnb



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.