让不懂编程的人爱上iPhone开发(2013秋iOS7版)-第1篇(11)
时间:2025-04-20
时间:2025-04-20
void HandleMidiEvent(char byte1, char byte2, char byte3, int deltaFrames)
{
char command =(byte1 & 0xf0);
if(command == MIDI_NOTE_ON && byte3 !=0)
{
PlayNote(byte2 + transpose, velocityCurve[byte3]/ 127.0f, deltaFrames);}
elseif((command == MIDI_NOTE_OFF)
|| (command == MIDI_NOTE_ON && byte3 ==0))
{
StopNote(byte2 + transpose, velocityCurve[byte3]/ 127.0f, deltaFrames);}
elseif(command == MIDI_CONTROL_CHANGE)
{
if(data2 ==64)
DamperPedal(data3, deltaFrames);
elseif(data2 == 0x7e || data2 == 0x7b)
AllNotesOff(deltaFrames);
}
}
这 许 觉 编 经验 语 码 码 C语 编 这 语 纪60 发 们 发 Unix 统 统 Windows,Mac,Linux iOS Unix 统
发iOS应 语 为Objective-‐C 标 C语 扩 Objective-‐C C语 时 还 对 编 Objective-‐Oriented Objective-‐C 谓 问 铁 Mac 丝 濒临灭绝 2007 伟 iPhone产 发 历 遗 Objective-‐C语 进 们 视线 为 发语