简体   繁体   English

在使用C#Code生成Midi Track时,如何才能播放音调,而不是淡出?

[英]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.

相关问题 如何使用此C#代码制作子例程? - How can I make a subroutine out of this C# code? 生成成员时,如何防止在 C# 的 VS 代码中添加“private”访问修饰符? - How can I prevent the `private` access modifier from being added in VS Code for C# when generating members? 使用 c# 中的 midi 从 Neurosky 耳机生成音乐 - generating music from neurosky headset using midi in c# 我可以使用kinect判断肤色或体温吗? - Can I figure out skin tone or body temperature using kinect? 我怎样才能在 C# 中制作参数`out`? - How can i make params `out` in C#? c#如何使用Windows.Devices.Midi将MIDI消息发送到内置的Microsoft GS Wavetable Synth? - c# How do I send MIDI messages to the built in Microsoft GS Wavetable Synth using Windows.Devices.Midi? C#-我需要弄清楚如何使GUI监听IF语句中被按下的按钮 - C# - I need to figure out how to make GUI that listens for buttons being pressed in a IF statement 如何使用相同的变量使这个VB代码在C#中工作? - How can I make this VB code work in C# using the same variable? C#如何使此代码更好或更短? - C# How can I make this code better or shorter? 我如何在 C++ 和 C# 中跟踪 function 的进度 - How can i track the progress of a function in C++ and C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM