您的位置 首页 设计

51单片机蜂鸣器音乐简谱转化东西

相信您在作蜂鸣器发声实验时肯定为复杂的频率与音调之间的转换而伤脑筋,这里向大家介绍一款工具可以大大简化转换操作,只需要输入简谱就能…

信任您在作蜂鸣器发声试验时肯定为杂乱的频率与腔调之间的转化而伤脑筋,这儿向我们介绍一款东西可以大大简化转化操作,只需求输入简谱就能主动生成音乐播映程序代码。

以下此程序的主界面:

程序典范可以点主界面上的“关于”按钮后就能找到,可是代码也不全,需求参加对音乐程序的调用代码,其它典范里也写的很清楚了,只需求调用Play函数就行了,其调用格局如下:

Play(乐曲名,调号,升降八度,演奏速度);

经过实践,此函数的的后三个参数别离设为0,2和350时演奏出的音乐比较契合“原味”,下面给出本站的入门型51试验板结合此东西作的音乐程序:

//51单片机播映音乐库文件
/**************************************************************************
SOUND PLAY FOR 51MCU
COPYRIGHT (c) 2005 BY JJJ.
— ALL RIGHTS RESERVED —
File Name: SoundPlay.h
Author: Jiang Jian Jun
Created: 2005/5/16
Modified: NO
Revision: 1.0
*******************************************************************************/
/*阐明**************************************************************************
曲谱存贮格局 unsigned char code MusicName{音高,音长,音高,音长…., 0,0}; 完毕:0,0 表明完毕(Important)
音高由三位数字组成:
个位是表明 1~7 这七个音符
十位是表明音符地点的音区:1-低声,2-中音,3-高音;
百位表明这个音符是否要升半音: 0-不升,1-升半音。
音长最多由三位数字组成:
个位表明音符的时值,其对应联系是:
|数值(n): |0 |1 |2 |3 | 4 | 5 | 6
|几分音符: |1 |2 |4 |8 |16 |32 |64 音符=2^n
十位表明音符的演奏作用(0-2): 0-一般,1-连音,2-顿音
百位是符点位: 0-无符点,1-有符点
调用演奏子程序的格局
Play(乐曲名,调号,升降八度,演奏速度);
|乐曲名 : 要播映的乐曲指针,完毕以(0,0)完毕;
|调号(0-11) : 是指乐曲升多少个半音演奏;
|升降八度(1-3) : 1:降八度, 2:不升不降, 3:升八度;
|演奏速度(1-12000): 值越大速度越快;
***************************************************************************/
#ifndef __SOUNDPLAY_H_REVISION_FIRST__
#define __SOUNDPLAY_H_REVISION_FIRST__
#include
//**************************************************************************
#define SYSTEM_OSC 11059200//12000000 //界说晶振频率12000000HZ
#define SOUND_SPACE 4/5 //界说一般音符演奏的长度分率,//每4分音符距离
sbit BeepIO = P3^5; //界说输出管脚
unsigned int code FreTab[12] = { 262,277,294,311,330,349,369,392,415,440,466,494 }; //原始频率表
unsigned char code SignTab[7] = { 0,2,4,5,7,9,11 }; //1~7在频率表中的方位
unsigned char code LengthTab[7]= { 1,2,4,8,16,32,64 };
unsigned char Sound_Temp_TH0,Sound_Temp_TL0; //音符守时器初值暂存
unsigned char Sound_Temp_TH1,Sound_Temp_TL1; //音长守时器初值暂存
//**************************************************************************
void InitialSound(void)
{
BeepIO = 1;
Sound_Temp_TH1 = (65535-(1/1200)*SYSTEM_OSC)/256; // 核算TL1应装入的初值 (10ms的初装值)
Sound_Temp_TL1 = (65535-(1/1200)*SYSTEM_OSC)%256; // 核算TH1应装入的初值
TH1 = Sound_Temp_TH1;
TL1 = Sound_Temp_TL1;
TMOD |= 0x11;
ET0 = 1;
ET1 = 0;
TR0 = 0;
TR1 = 0;
EA = 1;
}
void BeepTimer0(void) interrupt 1 //音符发生中止
{
BeepIO = !BeepIO;
TH0 = Sound_Temp_TH0;
TL0 = Sound_Temp_TL0;
}
//**************************************************************************
void Play(unsigned char *Sound,unsigned char Signature,unsigned Octachord,unsigned int Speed)
{
unsigned int NewFreTab[12]; //新的频率表
unsigned char i,j;
unsigned int Point,LDiv,LDiv0,LDiv1,LDiv2,LDiv4,CurrentFre,Temp_T,SoundLength;
unsigned char Tone,Length,SL,SH,SM,SLen,XG,FD;
for(i=0;i<12;i++) // 依据调号及升降八度来生成新的频率表
{
j = i + Signature;
if(j > 11)
{
j = j-12;
NewFreTab[i] = FreTab[j]*2;
}
else
NewFreTab[i] = FreTab[j];
if(Octachord == 1)
NewFreTab[i]>>=2;
else if(Octachord == 3)
NewFreTab[i]<<=2;
}
SoundLength = 0;
while(Sound[SoundLength] != 0x00) //核算歌曲长度
{
SoundLength+=2;
}
Point = 0;
Tone = Sound[Point];
Length = Sound[Point+1]; // 读出第一个音符和它时时值
LDiv0 = 12000/Speed; // 算出1分音符的长度(几个10ms)
LDiv4 = LDiv0/4; // 算出4分音符的长度
LDiv4 = LDiv4-LDiv4*SOUND_SPACE; // 一般音最长距离规范
TR0 = 0;
TR1 = 1;
while(Point < SoundLength)
{
SL=Tone%10; //核算出音符
SM=Tone/10%10; //核算出凹凸声
SH=Tone/100; //核算出是否升半
CurrentFre = NewFreTab[SignTab[SL-1]+SH]; //查出对应音符的频率
if(SL!=0)
{
if (SM==1) CurrentFre >>= 2; //低声
if (SM==3) CurrentFre <<= 2; //高音
Temp_T = 65536-(50000/CurrentFre)*10/(12000000/SYSTEM_OSC);//核算计数器初值
Sound_Temp_TH0 = Temp_T/256;
Sound_Temp_TL0 = Temp_T%256;
TH0 = Sound_Temp_TH0;
TL0 = Sound_Temp_TL0 + 12; //加12是对中止延时的补偿
}
SLen=LengthTab[Length%10]; //算出是几分音符
XG=Length/10%10; //算出音符类型(0一般1连音2顿音)
FD=Length/100;
LDiv=LDiv0/SLen; //算出连音音符演奏的长度(多少个10ms)
if (FD==1)
LDiv=LDiv+LDiv/2;
if(XG!=1)
if(XG==0) //算出一般音符的演奏长度
if (SLen<=4)
LDiv1=LDiv-LDiv4;
else
LDiv1=LDiv*SOUND_SPACE;
else
LDiv1=LDiv/2; //算出顿音的演奏长度
else
LDiv1=LDiv;
if(SL==0) LDiv1=0;
LDiv2=LDiv-LDiv1; //算出不发音的长度
if (SL!=0)
{
TR0=1;
for(i=LDiv1;i>0;i–) //发规则长度的音
{
while(TF1==0);
TH1 = Sound_Temp_TH1;
TL1 = Sound_Temp_TL1;
TF1=0;
}
}
if(LDiv2!=0)
{
TR0=0; BeepIO=1;
for(i=LDiv2;i>0;i–) //音符间的距离
{
while(TF1==0);
TH1 = Sound_Temp_TH1;
TL1 = Sound_Temp_TL1;
TF1=0;
}
}
Point+=2;
Tone=Sound[Point];
Length=Sound[Point+1];
}
BeepIO = 1;
}
//**************************************************************************
#endif
//挥着翅膀的女孩
unsigned char code Music_Girl[]={ 0x17,0x02, 0x17,0x03, 0x18,0x03, 0x19,0x02, 0x15,0x03,
0x16,0x03, 0x17,0x03, 0x17,0x03, 0x17,0x03, 0x18,0x03,
0x19,0x02, 0x16,0x03, 0x17,0x03, 0x18,0x02, 0x18,0x03,
0x17,0x03, 0x15,0x02, 0x18,0x03, 0x17,0x03, 0x18,0x02,
0x10,0x03, 0x15,0x03, 0x16,0x02, 0x15,0x03, 0x16,0x03,
0x17,0x02, 0x17,0x03, 0x18,0x03, 0x19,0x02, 0x1A,0x03,
0x1B,0x03, 0x1F,0x03, 0x1F,0x03, 0x17,0x03, 0x18,0x03,
0x19,0x02, 0x16,0x03, 0x17,0x03, 0x18,0x03, 0x17,0x03,
0x18,0x03, 0x1F,0x03, 0x1F,0x02, 0x16,0x03, 0x17,0x03,
0x18,0x03, 0x17,0x03, 0x18,0x03, 0x20,0x03, 0x20,0x02,
0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x20,0x03, 0x21,0x03,
0x20,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x1F,0x03,
0x1B,0x03, 0x19,0x03, 0x19,0x03, 0x15,0x03, 0x1A,0x66,
0x1A,0x03, 0x19,0x03, 0x15,0x03, 0x15,0x03, 0x17,0x03,
0x16,0x66, 0x17,0x04, 0x18,0x04, 0x18,0x03, 0x19,0x03,
0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x20,0x03, 0x21,0x03,
0x20,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x1F,0x03,
0x1B,0x03, 0x19,0x03, 0x19,0x03, 0x15,0x03, 0x1A,0x66,
0x1A,0x03, 0x19,0x03, 0x19,0x03, 0x1F,0x03, 0x1B,0x03,
0x1F,0x00, 0x1A,0x03, 0x1A,0x03, 0x1A,0x03, 0x1B,0x03,
0x1B,0x03, 0x1A,0x03, 0x19,0x03, 0x19,0x02, 0x17,0x03,
0x15,0x17, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x18,0x03,
0x17,0x04, 0x18,0x0E, 0x18,0x03, 0x17,0x04, 0x18,0x0E,
0x18,0x66, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x18,0x03,
0x20,0x03, 0x20,0x02, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66,
0x20,0x03, 0x21,0x03, 0x20,0x03, 0x1F,0x03, 0x1B,0x03,
0x1F,0x66, 0x1F,0x04, 0x1B,0x0E, 0x1B,0x03, 0x19,0x03,
0x19,0x03, 0x15,0x03, 0x1A,0x66, 0x1A,0x03, 0x19,0x03,
0x15,0x03, 0x15,0x03, 0x17,0x03, 0x16,0x66, 0x17,0x04,
0x18,0x04, 0x18,0x03, 0x19,0x03, 0x1F,0x03, 0x1B,0x03,
0x1F,0x66, 0x20,0x03, 0x21,0x03, 0x20,0x03, 0x1F,0x03,
0x1B,0x03, 0x1F,0x66, 0x1F,0x03, 0x1B,0x03, 0x19,0x03,
0x19,0x03, 0x15,0x03, 0x1A,0x66, 0x1A,0x03, 0x19,0x03,
0x19,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x00, 0x18,0x02,
0x18,0x03, 0x1A,0x03, 0x19,0x0D, 0x15,0x03, 0x15,0x02,
0x18,0x66, 0x16,0x02, 0x17,0x02, 0x15,0x00, 0x00,0x00};
//同一首歌
unsigned char code Music_Same[]={ 0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x66, 0x18,0x03,
0x17,0x02, 0x15,0x02, 0x16,0x01, 0x15,0x02, 0x10,0x02,
0x15,0x00, 0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x02,
0x17,0x03, 0x18,0x03, 0x19,0x02, 0x15,0x02, 0x18,0x66,
0x17,0x03, 0x19,0x02, 0x16,0x03, 0x17,0x03, 0x16,0x00,
0x17,0x01, 0x19,0x02, 0x1B,0x02, 0x1B,0x70, 0x1A,0x03,
0x1A,0x01, 0x19,0x02, 0x19,0x03, 0x1A,0x03, 0x1B,0x02,
0x1A,0x0D, 0x19,0x03, 0x17,0x00, 0x18,0x66, 0x18,0x03,
0x19,0x02, 0x1A,0x02, 0x19,0x0C, 0x18,0x0D, 0x17,0x03,
0x16,0x01, 0x11,0x02, 0x11,0x03, 0x10,0x03, 0x0F,0x0C,
0x10,0x02, 0x15,0x00, 0x1F,0x01, 0x1A,0x01, 0x18,0x66,
0x19,0x03, 0x1A,0x01, 0x1B,0x02, 0x1B,0x03, 0x1B,0x03,
0x1B,0x0C, 0x1A,0x0D, 0x19,0x03, 0x17,0x00, 0x1F,0x01,
0x1A,0x01, 0x18,0x66, 0x19,0x03, 0x1A,0x01, 0x10,0x02,
0x10,0x03, 0x10,0x03, 0x1A,0x0C, 0x18,0x0D, 0x17,0x03,
0x16,0x00, 0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x70,
0x18,0x03, 0x17,0x02, 0x15,0x03, 0x15,0x03, 0x16,0x66,
0x16,0x03, 0x16,0x02, 0x16,0x03, 0x15,0x03, 0x10,0x02,
0x10,0x01, 0x11,0x01, 0x11,0x66, 0x10,0x03, 0x0F,0x0C,
0x1A,0x02, 0x19,0x02, 0x16,0x03, 0x16,0x03, 0x18,0x66,
0x18,0x03, 0x18,0x02, 0x17,0x03, 0x16,0x03, 0x19,0x00,
0x00,0x00 };
//两只蝴蝶
unsigned char code Music_Two[] ={ 0x17,0x03, 0x16,0x03, 0x17,0x01, 0x16,0x03, 0x17,0x03,
0x16,0x03, 0x15,0x01, 0x10,0x03, 0x15,0x03, 0x16,0x02,
0x16,0x0D, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x10,0x03,
0x10,0x0E, 0x15,0x04, 0x0F,0x01, 0x17,0x03, 0x16,0x03,
0x17,0x01, 0x16,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x01,
0x10,0x03, 0x15,0x03, 0x16,0x02, 0x16,0x0D, 0x17,0x03,
0x16,0x03, 0x15,0x03, 0x10,0x03, 0x15,0x03, 0x16,0x01,
0x17,0x03, 0x16,0x03, 0x17,0x01, 0x16,0x03, 0x17,0x03,
0x16,0x03, 0x15,0x01, 0x10,0x03, 0x15,0x03, 0x16,0x02,
0x16,0x0D, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x10,0x03,
0x10,0x0E, 0x15,0x04, 0x0F,0x01, 0x17,0x03, 0x19,0x03,
0x19,0x01, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x17,0x01,
0x16,0x03, 0x16,0x03, 0x16,0x02, 0x16,0x0D, 0x17,0x03,
0x16,0x03, 0x15,0x03, 0x10,0x03, 0x10,0x0D, 0x15,0x00,
0x19,0x03, 0x19,0x03, 0x1A,0x03, 0x1F,0x03, 0x1B,0x03,
0x1B,0x03, 0x1A,0x03, 0x17,0x0D, 0x16,0x03, 0x16,0x03,
0x16,0x0D, 0x17,0x01, 0x17,0x03, 0x17,0x03, 0x19,0x03,
0x1A,0x02, 0x1A,0x02, 0x10,0x03, 0x17,0x0D, 0x16,0x03,
0x16,0x01, 0x17,0x03, 0x19,0x03, 0x19,0x03, 0x17,0x03,
0x19,0x02, 0x1F,0x02, 0x1B,0x03, 0x1A,0x03, 0x1A,0x0E,
0x1B,0x04, 0x17,0x02, 0x1A,0x03, 0x1A,0x03, 0x1A,0x0E,
0x1B,0x04, 0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03,
0x17,0x0D, 0x16,0x03, 0x17,0x03, 0x19,0x01, 0x19,0x03,
0x19,0x03, 0x1A,0x03, 0x1F,0x03, 0x1B,0x03, 0x1B,0x03,
0x1A,0x03, 0x17,0x0D, 0x16,0x03, 0x16,0x03, 0x16,0x03,
0x17,0x01, 0x17,0x03, 0x17,0x03, 0x19,0x03, 0x1A,0x02,
0x1A,0x02, 0x10,0x03, 0x17,0x0D, 0x16,0x03, 0x16,0x01,
0x17,0x03, 0x19,0x03, 0x19,0x03, 0x17,0x03, 0x19,0x03,
0x1F,0x02, 0x1B,0x03, 0x1A,0x03, 0x1A,0x0E, 0x1B,0x04,
0x17,0x02, 0x1A,0x03, 0x1A,0x03, 0x1A,0x0E, 0x1B,0x04,
0x17,0x16, 0x1A,0x03, 0x1A,0x03, 0x1A,0x0E, 0x1B,0x04,
0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x0F,0x02,
0x10,0x03, 0x15,0x00, 0x00,0x00 };
void main()
{
InitialSound();
while(1)
{
Play(Music_Girl,0,2,350);
Play(Music_Same,0,2,350);
Play(Music_Two,0,2,350);
}
}

点击下载Music Encode

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

再例如:关于“世上只要妈妈好”的单片机音乐演奏程序

单片机演奏一个音符,是经过引脚,周期性的输出一个特定频率的方波。
这就需求单片机,在半个周期内输出低电平、别的半个周期输出高电平,循环往复。
半个周期的时刻是多长呢?众所周知,周期为频率的倒数,可以经过音符的频率计算出半周期。
演奏时,要依据音符频率的不同,把对应的、半个周期的守时时刻初始值,送入守时器,再由守时器准时输出凹凸电平。

下面是个网上广泛撒播的单片机音乐演奏程序,它可以循环的播映“世上只要妈妈好”这首乐曲。很多人都关怀怎么修正这个乐曲的内容,可是不知怎么下手。
做而论道对这个程序,给出阐明,期望对我们有所协助,今后我们自己就可以编写进去新的乐曲。

在这个程序中,有两个数据表,其间寄存了事前算好的、各种音符频率所对应的、半周期的守时时刻初始值。
有了这些数据,单片机就可以演奏从低声、中音、高音和超高音,四个八度共28个音符。

演奏乐曲时,就依据音符的不同数值,从半周期数据表中找到守时时刻初始值,送入守时器即可操控发音的腔调。
比方把表中的0xF2和0x42送到守时器,守时器依照这个初始值来发生中止,输出的方波,人们听起来,这便是低声1。

乐曲的数据,也要写个数据表,程序中以 code unsigned char sszymmh[] 命名。
这个表中每三个数字,阐明晰一个音符,它们别离代表:
第一个数字是音符的数值1234567之一,代表多来咪发…;
第二个数字是0123之一,代表低声、中音、高音、超高音;
第三个数字是时刻长度,以半拍为单位。
乐曲数据表的完毕是三个0。

程序如下:

#include
sbit speaker = P1^7;
unsigned char timer0h, timer0l, time;
//————————————–
//单片机晶振选用11.0592MHz
// 频率-半周期数据表 高八位 本软件共保存了四个八度的28个频率数据
code unsigned char FREQH[] = {
0xF2, 0xF3, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, //低声1234567
0xF9, 0xF9, 0xFA, 0xFA, 0xFB, 0xFB, 0xFC, 0xFC,//1,2,3,4,5,6,7,i
0xFC, 0xFD, 0xFD, 0xFD, 0xFD, 0xFE, //高音 234567
0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF}; //超高音 1234567

// 频率-半周期数据表 低八位
code unsigned char FREQL[] = {
0x42, 0xC1, 0x17, 0xB6, 0xD0, 0xD1, 0xB6, //低声1234567
0x21, 0xE1, 0x8C, 0xD8, 0x68, 0xE9, 0x5B, 0x8F, //1,2,3,4,5,6,7,i
0xEE, 0x44, 0x6B, 0xB4, 0xF4, 0x2D, //高音 234567
0x47, 0x77, 0xA2, 0xB6, 0xDA, 0xFA, 0x16}; //超高音 1234567
//————————————–
//世上只要妈妈好数据表 要想演奏不同的乐曲, 只需求修正这个数据表
code unsigned char sszymmh[] = {
6, 2, 3, 5, 2, 1, 3, 2, 2, 5, 2, 2, 1, 3, 2, 6, 2, 1, 5, 2, 1,
//一个音符有三个数字。前为第几个音、中为第几个八度、后为时长(以半拍为单位)。
//6, 2, 3 别离代表:6, 中音, 3个半拍;
//5, 2, 1 别离代表:5, 中音, 1个半拍;
//3, 2, 2 别离代表:3, 中音, 2个半拍;
//5, 2, 2 别离代表:5, 中音, 2个半拍;
//1, 3, 2 别离代表:1, 高音, 2个半拍;
//
6, 2, 4, 3, 2, 2, 5, 2, 1, 6, 2, 1, 5, 2, 2, 3, 2, 2, 1, 2, 1,
6, 1, 1, 5, 2, 1, 3, 2, 1, 2, 2, 4, 2, 2, 3, 3, 2, 1, 5, 2, 2,
5, 2, 1, 6, 2, 1, 3, 2, 2, 2, 2, 2, 1, 2, 4, 5, 2, 3, 3, 2, 1,
2, 2, 1, 1, 2, 1, 6, 1, 1, 1, 2, 1, 5, 1, 6, 0, 0, 0};
//————————————–

void t0int() interrupt 1 //T0中止程序,操控发音的腔调
{
TR0 = 0; //先封闭T0
speaker = !speaker; //输出方波, 发音
TH0 = timer0h; //下次的中止时刻, 这个时刻, 操控腔调凹凸
TL0 = timer0l;
TR0 = 1; //发动T0
}
//————————————–
void delay(unsigned char t) //延时程序,操控发音的时刻长度
{
unsigned char t1;
unsigned long t2;
for(t1 = 0; t1 < t; t1++) //两层循环, 共延时t个半拍
for(t2 = 0; t2 < 8000; t2++); //延时期间, 可进入T0中止去发音
TR0 = 0; //封闭T0, 中止发音
}
//————————————–
void song() //演奏一个音符
{
TH0 = timer0h; //操控腔调
TL0 = timer0l;
TR0 = 1; //发动T0, 由T0输出方波去发音
delay(time); //操控时刻长度
}
//————————————–
void main(void)
{
unsigned char k, i;
TMOD = 1; //置T0守时工作方式1
ET0 = 1; //开T0中止
EA = 1; //开CPU中止
while(1) {
i = 0;
time = 1;
while(time) {
k = sszymmh[i] + 7 * sszymmh[i + 1] – 1;
//第i个是音符, 第i+1个是第几个八度
timer0h = FREQH[k]; //从数据表中读出频率数值
timer0l = FREQL[k]; //实际上, 是守时的时刻长度
time = sszymmh[i + 2]; //读出时刻长度数值
i += 3;
song(); //宣布一个音符
} } }
//======================================
应网友要求,下面再具体写一下曲谱和数据的转化联系。
以李叔同大师的《送行》的前二末节来阐明转化的办法。

这部分的歌词是:“长 亭 外, 古 道 边,”;
这部分的曲谱是:| 5 35 1 - | 6 16 5 - |。
(留意:曲谱中的1是高音,上边是带点的;还有些音符,应该有下划线,在这儿都无法标出。感兴趣的网友应该去检查正规的曲谱。)

那么,据此就可以写出《送行》前二末节的数据表:
//————————————–
code unsigned char sszymmh[] = {
5, 2, 2, 3, 2, 1, 5, 2, 1, 1, 3, 4,
//嗦,中音,2个半拍; 咪,中音,1个半拍; 嗦,中音,1个半拍; 哆,高音,4个半拍
6, 2, 2, 1, 3, 1, 6, 2, 1, 5, 2, 4,
//啦,中音,2个半拍; 哆,高音,1个半拍; 啦,中音,1个半拍; 嗦,中音,4个半拍
0, 0, 0};
//完毕符号
//————————————–

记住:三个数字一组,代表一个音符。
第一个数字是1234567之一,代表音符哆来咪发…;
第二个数字是0123之一,代表低声、中音、高音、超高音;
第三个数字是半拍的个数,代表时刻长度。
当三个数字都是0,就代表乐曲数据表的完毕。

用这个数据表,替换掉程序中《世上只要妈妈好》的数据表,本程序就可以播映《送行》的前两末节。

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/ziliao/sheji/267095.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部