Search:
Submit Search


Sample Rate Setting

Using the CODM to create your own organ definitions, exchange CODM organ definitions, ...

Sample Rate Setting

Postby wurlitzerwilly » Tue Dec 14, 2010 7:55 am

As we are starting to see a few more Virtual Organs that are generated using the CODM and make use of different multiple sample sets, I am wondering what the ramifications are when the sample rate code is set at a different rate than from that intended for the samples themselves?

i.e. A sample rate code of '2' (44.1KHz) where one set of samples was designed for 44.1KHz and another for 48KHz, and both sample sets are used in the same ODF.

I remember some time back accidentally setting the sample rate in the ODF header to 44.1KHz and using it in conjunction with 48KHz samples. It badly affected tuning.

Regards,

Alan.
User avatar
wurlitzerwilly
Member
 
Posts: 934
Joined: Tue Mar 06, 2007 12:21 pm
Location: South Coast, UK.

Re: Sample Rate Setting

Postby mdyde » Tue Dec 14, 2010 8:12 am

Hello Alan,

Provided that the true sample pitch is stored correctly in the sample files (or they are tuned perfectly to A-440/equal), and that each CODM ODF's Rank.Samples_RankBasePitch64ftHarmNumIfAssumedTunedToConcertPitch parameter is set accordingly to tell Hauptwerk where to read the pitch information, then having a different output sample rate set in the ODF shouldn't have any adverse effects on tuning, since Hauptwerk will re-pitch each sample/pipe in real-time according to the sample's sample rate and the output sample rate.

To see this in action, you can use 'Organ | Load organ ...' to load the StAnnesMoseley-ForLocked48kHzDrivers organ definition, which loads the standard (44.1 kHz) St. Anne's samples, but re-pitches them in real-time to 48 kHz for output. It will still play at the correct pitch.

However, it's very important that you don't set the output (i.e. CODM ODF) sample rate *lower* than the sample rate of any of the samples, otherwise you will potentially get severe aliasing because an anti-aliasing filter is not applied (for performance reasons). For example, if you set the ODF sample rate to 44.1 kHz and any 48 kHz samples were used and those samples contained any frequencies above 22,050 Hz (before or after any tremulant or other forms of pitch modulation) then those high frequencies would 'wrap around' to give unnatural (non harmonically-related) low-frequencies:

http://en.wikipedia.org/wiki/Anti-aliasing_filter

That won't be an issue if you set the output (ODF) sample rate at or above the highest sample rate of any of the samples.

However, even if some or all of the samples are 44.1 kHz and you set the output rate to 48 kHz there will be some noticeable loss of audio quality due to the fairly significant degree of real-time re-pitching needed.

Summary: you'll always get the best audio quality if the output sample rate and the sample rates of the individual samples match, although it's acceptable for the output rate to be higher than the rate of some of the samples. In neither case will the pitch be adversely affected, provided that the ODF and samples are formatted correctly.
Best regards,
Martin.

[Please use email or the Contact page if you need to contact us privately, rather than private forum messages.]

Image
User avatar
mdyde
Moderator
 
Posts: 10644
Joined: Fri Mar 14, 2003 2:19 pm
Location: UK

Re: Sample Rate Setting

Postby wurlitzerwilly » Tue Dec 14, 2010 12:55 pm

Thanks Martin.

Obviously my tuning issue was possibly a one-off, dependent on the samples I was using.

Your warning to always set the sample rate equal to or higher than the samples is well heeded. Thank you.

Regards,

Alan.
User avatar
wurlitzerwilly
Member
 
Posts: 934
Joined: Tue Mar 06, 2007 12:21 pm
Location: South Coast, UK.


Return to Custom Organ Design Module (CODM)

Who is online

Users browsing this forum: No registered users and 1 guest