C语言写歌曲(国外英语资料).doc

  1. 1、本文档共20页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C语言写歌曲(国外英语资料)

C语言写歌曲 C: sound technology Question: One, two, three, four, five, six, seven, plus the high bass can make a beautiful tune, please write Sequence enables the computer to play songs. [analysis] Playing the song means making the computer sound, the sound from the speaker inside the PC, so the question will be Hardware speaker circuit. [to answer] To solve this programming problem, lets start with a simple understanding of how computers sound. On the PCs system board, there are timed and counter 8253 chips, and 8255 programmable parallel interface chips, made up of hardware circuits To produce the sound of the internal speakers of the PC, the PC microcomputer, which is 286, 386, 486, 586, etc., is adopted by the super large Scale integrated circuits, so they are not seen, and they are integrated on the peripheral circuit chip. When we operate computers, the sound that is often heard is generated by software that controls these circuits. The voice of the Both the length and the pitch of the tone can be controlled by the program. In the speaker circuit, the frequency of the timer determines the speaker The frequency of the sound, so you can make a different sound by setting the frequency of the timer circuit. To the timer circuit When the line frequency is set, write the command word to the command register (0x43) first, as in 0xb6, which is available Xb6 x43 outporb (0, 0); For implementation, the second channel of the timer is selected, and the count rate is dropped by 8 bits first In the system, it is 8 bits high. Then use the address 0x42 to send the frequency count, send the low 8 bits first, then send the high 8 bit, out of the box Outportb (0x42, low 8 bit frequency count) and outportb (0x42, high 8 bit frequency count). Through these two The step allows the timer circuit to produce a series of square wave signals, which can be used to sound the speaker, and to be generated by 8255 The door control signals and the number of signals are 1, and they can be programme

文档评论(0)

jgx3536 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6111134150000003

1亿VIP精品文档

相关文档