• 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
compilter bug nighmare?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compilter bug nighmare?


  • Subject: compilter bug nighmare?
  • From: Alexey Menshikov <email@hidden>
  • Date: Mon, 27 Jun 2005 09:53:14 +0300

Hi,
I have a commercial project - audio plug-ins (VST).
After switching to Tiger/Xcode2.0 i decided to release new version
but the plug-in works wrongly. _Sometimes_ it does not produce audio.
That may happens after running several instances of plug-in, sometimes
it doesn't work with first instance.

That project worked on Panther - i can run the old binary but the same
project compiled on xcode2 sometimes fail.

After commenting several parts of code i found code that possible makes
it work wrong - IIR biquad filter.
But hell, it works perfectly under win32 and early xcode.
One more notice - works nice with Development target.

What do in that cases? Try to reorganize code? I havn't any compiler warnings
on that file :(

--------------------------------------- cut --------------------------------------

The code looks like this:

float   coef [4 * FILTER_ORDER + 1];
float   history [2 * FILTER_ORDER];


        float getValue(float in)
        {
                unsigned int i;
                float *hist1_ptr, *hist2_ptr, *coef_ptr;
                float xout, new_hist, history1, history2;

                coef_ptr = coef; // coefficient pointer

                hist1_ptr = history;        // first history
                hist2_ptr = hist1_ptr + 1; // next history

                // 1st number of coefficients array is overall input scale factor, * or filter gain
                xout = in * (*coef_ptr++);

                for (i = 0; i < length; i++)
                {
                        history1 = *hist1_ptr;
                        history2 = *hist2_ptr;

                        xout = xout - history1 * (*coef_ptr++);
                        new_hist = xout - history2 * (*coef_ptr++); // poles

                        xout = new_hist + history1 * (*coef_ptr++);
                        xout = xout + history2 * (*coef_ptr++);      // zeros

                        *hist2_ptr++ = *hist1_ptr;
                        *hist1_ptr++ = new_hist;
                        hist1_ptr++;
                        hist2_ptr++;
                }
                return xout;
        }

I used "return in;" and it worked so i suspect the bug somewhere up
there :)
--------------------------------------------

Alexey Menshikov

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >[ANN] The Mac XCode 2 Book now available (From: David Hoerl <email@hidden>)

  • Prev by Date: Re: XCode 2.0: what happened to long long?
  • Next by Date: What ends up in the "Bundle Resources" group
  • Previous by thread: [ANN] The Mac XCode 2 Book now available
  • Next by thread: Command /usr/bin/g++-3.3 failed with exit code 1
  • Index(es):
    • Date
    • Thread