[英]In generating Midi Track using C# Code, how Can I make the tone being played, not fading out?
I am building a small MIDI composer application, using the Stanford Library . 我正在使用斯坦福图书馆构建一个小型MIDI作曲家应用程序。 It is almost complete, except for a small problem: sound vanishes after the NoteOn
command, but I want notes to keep on playing until I release the button. 它几乎完成,除了一个小问题: NoteOn
命令后声音消失,但我希望音符继续播放,直到我释放按钮。
With MIDI, you should hear the note continue forever until you send a NoteOff command. 使用MIDI,您应该听到音符一直持续,直到您发送NoteOff命令。 If you're hearing a note begin but then fade out (without having sent a NoteOff message), then it might be that the channel is set to an instrument that naturally fades out on its own - like a marimba or steel drum sound. 如果你听到一个音符开始然后淡出(没有发送NoteOff消息),那么可能是频道被设置为一个自然淡化的乐器 - 就像马林巴琴或钢鼓声。
That would be down to the MIDI device that you are addressing. 这将归结为您正在寻址的MIDI设备。 You might be able to tell it to increase the sustain level of the envelope via MIDI NRPN or SysEx, but this would be device specific. 您可以通过MIDI NRPN或SysEx告诉它增加信封的延音级别,但这可能是设备特定的。 Generally a string or pad voice will maintain a high sustain, whereas a piano or other percussive sound will consistently fade to zero regardless of sustain level. 一般来说,弦乐或乐队的声音将保持高延音,而钢琴或其他打击乐声音将始终衰减到零,无论持续水平如何。
So, you are saying that when you play a note it decays normally (as if you head down a piano key) and you don't want that? 所以,你说当你演奏音符时它会正常衰减(好像你低下一把钢琴键)并且你不想要那样?
That is a feature of the synthesizer and has nothing to do with MIDI. 这是合成器的一个功能,与MIDI无关。 You will need to pick a patch that doesn't do this. 您需要选择不执行此操作的修补程序。 Organ patches should work fine. 器官补丁应该可以正常工作
If instead you are saying that your note stops immediately (as if you hit the key and immediately released) then you have something sending a note-off command or a note command with 0 velocity. 相反,如果你说你的音符立即停止(好像你按下了键并立即释放),那么你有一些东西发送一个音符关闭命令或一个0速度的音符命令。 Check to make sure you are in fact sending 7-bit values for velocity and what not. 检查以确保您实际上是为速度发送7位值,而不是。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.