On Dec 29, 2014, at 2:12 AM, Michael Crawford <mdcrawf...@gmail.com> wrote:
>    for ( int i = 0; i < inNumberFrames; ++i ){
>       *sample++ = sin( twoPi * ( now / 100.0 ) );
>       now += 1.0;
>    }


Depending on what your overall goal is, it might be easier to use the software 
MIDI synthesizer instead of computing the samples yourself— if you want a 
bandlimited start and end, or even a music-like attack/decay/release envelope 
or a spectrum more complicated than a pure sine wave, using something like the 
AVMIDIPlayer class might free you from a bunch of realtime requirements and 
bookkeeping.

(On the other hand, I’ve never tried using it, so I don’t know if its simple 
API hides a well of frustration.)


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to