Max*_*Max 3 objective-c core-audio audiounit ios coremidi
我目前正在努力有效地使用Ausampler Unit.我使用了apple示例中的代码:https://developer.apple.com/library/ios/#samplecode/LoadPresetDemo/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011214-Intro-DontLinkElementID_2
缺点似乎是它会立即停止一个音符/样本,如果相同的音符再次出现.因此,如果我发送带有长号预设的midi音符60.然后在拿着这个的时候,我又发了一张纸条60.它切断了第一个音符事件.有没有人知道是否/如何能够持有每一个音符直到音符关闭事件(这个特定音符)进来?
其他问题:如何在发送后改变音符的音量?例如,我用100速度发送了midi音符60和70.虽然音符60仍然播放,但我想减少音量,但保持音符70.这将被称为midi aftertouch.
希望你能帮忙:)
AUSampler(kAudioUnitSubType_Sampler)是单音的(参考和此处),因此为了同时播放相同音高的两个音符,您将需要两个"乐器" - 即AUSampler的实例.在我的项目中,我发现这不会增加内存开销,因为声音资源是共享的.
至于触后 - 我还没有探索过,但它看起来像你想要的属性kAUGroupParameterID_KeyPressure_FirstKey(参考这里,也许在这里).
Supporting the kAUGroupParameterID_KeyPressure parameter indicates to
hosts that your audio unit supports polyphonic "aftertouch" key pressure.
Each of the 128 MIDI key numbers can have its own value for polyphonic
aftertouch. To respond to aftertouch for a particular key, your audio
unit needs to support an additional parameter specifically for that key.
The aftertouch parameter ID for a given MIDI key is equal to the MIDI
key number plus 256. For example, the aftertouch parameter ID for MIDI
key #60 (middle C) is:
60 + kAUGroupParameterID_KeyPressure_FirstKey = 316
Run Code Online (Sandbox Code Playgroud)
如果你得到触后工作,请回复一些示例代码.
| 归档时间: |
|
| 查看次数: |
2222 次 |
| 最近记录: |