Play multiple midi notes simultaneously in iOS using Audio units -
i need play multiple tracks simultaneously in app. tracks may normal sound files or set of midi notes. so, have configured sound graph , connected various sound units (file player aus , sampler aus) multi channel mixer output connected remote io unit playing sound files , midi notes. sampler units loaded sf2 files of various instruments. of works fine 1 time have more 2 midi sampler sound units , seek play midi notes simultaneously through units using musicdevicemidievent function, output sound gets distorted/broken after few loops. need simultaneously play 10 instrument tracks , problem starts right after add together 3rd midi unit. can point me if there problem in approach , if so, can allow me know how can accomplish task of playing midi notes of various instruments simultaneously.
playing multiple midi notes on different tracks should not problem. got working fine. create sure stop midi note beingness played before play new one. can utilize same function stopping midi notes below
uint32 notecommand = kmidimessage_noteoff << 4 | 0; uint32 velocity = 0; musicdevicemidievent (samplerunit, //audiounit notecommand, note, //note beingness played velocity, 0);
ios core-audio
No comments:
Post a Comment