Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 597505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:17:17+00:00 2026-05-13T16:17:17+00:00

i’m attempting to add my own continuous pitch modulation (vibrato) to my OpenAL object

  • 0

i’m attempting to add my own continuous pitch modulation (vibrato) to my OpenAL object by assigning the sound’s pitch to the path of a sine wave. this is my callback method, which is repeating every 1/30 of a second, as well as the getter and setter for the pitch.

#define kMaximumAplitude 0.025
#define kVibratoDegreeIncrements is 45
#define kDegreesToRadians(x) (M_PI * (x) / 180)

- (void)vibratoCallBack:(NSTimer *)timer
       {
       float newPitch = kMaximumAplitude * sin(kDegreesToRadians(vibratoDegreeIncrements));
       self.pitch += newPitch;

       vibratoDegreeIncrements += kVibratoDegreeIncrements;
       }

- (void)setPitch:(ALfloat)newPitch
 {
 pitch = newPitch; 
 alSourcef(sourceID, AL_PITCH, pitch);
 }

- (ALfloat)pitch
 {
 return pitch;
 }

the default pitch is set at 1.0, so the above outputs the following sine wave cycle:

Wrong Pitch: 1.000000
Wrong Pitch: 1.017678
Wrong Pitch: 1.042678
Wrong Pitch: 1.060355
Wrong Pitch: 1.060355
Wrong Pitch: 1.042678
Wrong Pitch: 1.017678
Wrong Pitch: 1.000000

however, if you look at those numbers they are not much of a sine wave. the reason, as far as i can see, is that self.pitch is adding itself along with the sine wave increments. i would like the base pitch (unmodulated pitch) to remain constant prior to the vibrato method’s pitch change. doing so would allow me to continue to control the base pitch using a UISlider (for example) while the modulation effect can optionally and accuratelyoccur without affecting the base pitch. i can’t find a way.

below is the proper sine wave output that i would like to add to the current pitch:

Correct Pitch: 0.000000
Correct Pitch: 0.017678
Correct Pitch: 0.025000
Correct Pitch: 0.017678
Correct Pitch: 0.000000
Correct Pitch: -0.017678
Correct Pitch: -0.025000
Correct Pitch: -0.017678
Correct Pitch: -0.000000

therefore, if the current, unmodulated pitch is at 1.5, i would like the output to look like this:

Desired Pitch: 1.500000
Desired Pitch: 1.517678
Desired Pitch: 1.525000
Desired Pitch: 1.517678
Desired Pitch: 1.500000
Desired Pitch: 1.482322
Desired Pitch: 1.475000
Desired Pitch: 1.482322
Desired Pitch: 1.500000

how is it possible to change the pitch without really effecting the pitch? is there a way to compensate for the modulation to take place inside the method so that the effect can occur on a moving (or movable) base pitch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:17:17+00:00Added an answer on May 13, 2026 at 4:17 pm

    I think you just need to separate the data apart. Have one pitch store your base pitch, which would he an unmodified sine wave. Then you need another method to produce a vibrato sound wave, that is in sync with your base pitch. Then you need a getter to return the current pitch of the final waveform. In other words, you don’t need to store the pitch of the final waveform, as you’re doing now, you just need to calculate it on demand.

    - (ALfloat) getFinalPitch
    {
    return getBasePitch() + getVibratoPitch();
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
i got an object with contents of html markup in it, for example: string
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.