It is currently Fri Mar 29, 2024 6:16 am


Sample Rate Setting

Using the CODM to create your own organ definitions, exchange CODM organ definitions, ...
  • Author
  • Message
Offline
User avatar

wurlitzerwilly

Member

  • Posts: 944
  • Joined: Tue Mar 06, 2007 11:21 am
  • Location: South Coast, UK.

Sample Rate Setting

PostTue Dec 14, 2010 6: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.
Offline
User avatar

mdyde

Moderator

  • Posts: 15446
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Sample Rate Setting

PostTue Dec 14, 2010 7: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.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline
User avatar

wurlitzerwilly

Member

  • Posts: 944
  • Joined: Tue Mar 06, 2007 11:21 am
  • Location: South Coast, UK.

Re: Sample Rate Setting

PostTue Dec 14, 2010 11:55 am

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.

Return to Custom Organ Design Module (CODM)

Who is online

Users browsing this forum: No registered users and 1 guest