• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Beep ( frequency, duration)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beep ( frequency, duration)


  • Subject: Re: Beep ( frequency, duration)
  • From: Wim Lewis <email@hidden>
  • Date: Mon, 29 Dec 2014 13:14:09 -0800

On Dec 29, 2014, at 2:12 AM, Michael Crawford <email@hidden> 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 (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Beep ( frequency, duration)
      • From: Michael Crawford <email@hidden>
References: 
 >Beep ( frequency, duration) (From: "Raglan T. Tiger" <email@hidden>)
 >Re: Beep ( frequency, duration) (From: Michael Crawford <email@hidden>)

  • Prev by Date: Re: Beep ( frequency, duration)
  • Next by Date: Re: Beep ( frequency, duration)
  • Previous by thread: Re: Beep ( frequency, duration)
  • Next by thread: Re: Beep ( frequency, duration)
  • Index(es):
    • Date
    • Thread