音频合成与MoMu STK
audio synthesis with MoMu STK
是否有人成功地在iOS上使用MoMu STK实现了Instrument ?我有点堆积的初始化流的仪器。我正在使用教程代码,看起来像缺少的东西
<>之前RtAudio dac;//计算StkFloat中有多少字节并设置RtAudio流。RtAudio: StreamParameters参数;parameters.deviceId = dac.getDefaultOutputDevice();参数。nChannels = 1;RtAudioFormat格式= (sizeof(StkFloat) == 8) ?Rtaudio_float64: rtaudio_float32;unsigned int bufferFrames = RT_BUFFER_SIZE;dac。openStream(& parameters, NULL, format, (unsigned int)Stk::sampleRate(), & bufferframes, &tick, (void *)&data);之前错误描述说输出设备的输出参数无效,但当我跳过分配设备id时,它就不能正常工作了。什么主意都可以
RtAudio仅适用于桌面应用程序,在iOS上实现时不需要打开流。
的例子:
头文件:
#import "Simple.h"
// make struct to hold
struct TickData {
Simple *synth;
};
// Make instance of the struct in @interface=
TickData data;
实现文件:// init the synth:
data.synth = new Simple();
data.synth->keyOff();
// to trigger note on/off:
data.synth->noteOn(frequency, velocity);
data.synth->noteOff(velocity);
// audio callback method:
for (int i=0; i < FRAMESIZE; i++) {
buffer[i] = data.synth -> tick();
}
是的,我在商店里有几个应用程序,上面运行着STK类。请记住,在iOS上运行STK所需的设置与在桌面上运行STK所需的设置不同。
下面是如何在iOS应用中使用STK类的教程:https://arielelkin.github.io/articles/mandolin