SalamanderGrandPianoV2.sfz plays over a semitone higher

• Jun 19, 2013 - 16:03
Type
Functional
Severity
S4 - Minor
Status
closed
Project

1. Open attached score (produced in 1.3).
2. 'Synthesiser'.
3. 'Zerberus'.
4. 'Add'.
5. Choose 'SalamanderGrandPianoV2.sfz'.
6. Select it in 'Mixer'.
7. 'Play'.

Result: The score sounds a semitone higher.

Using MuseScore 2.0 Nightly Build (7c7ca30) - Mac 10.7.5.


Comments

I tried SalamanderGrandPianoV3_OggVorbis and it was the same.

It actually (at least this one) plays approximately one and a half semitones higher.

Using MuseScore 2.0 Nightly Build (c1040d2) - Mac 10.7.5.

Chenlung also tested SalamanderGrandPianoV3_OggVorbis with Sforzando and it's sounding good. Looks like a problem in Zerberus? or, but less likely the effect?

@Chenlung can you try without any effect?

I can't reproduce it with MuseScoreNightly-2014-09-20-1907-5f30234.7z on Windows 7 (VirtualBox). Settings are (I didn't change them):

PortAudio
API: MME
Device: Mappeur de sons Microsoft - Output
MIDI Input: Empty field

My config on Xubuntu 14.10 is as follows:

ALSA audio
Device: default
Sample rate: 48000
Fragments: 3
Period Size: 1024

I've just found that changing the sample rate from 48000 to 44100 and restarting MuseScore solve the problem. To be sure it's not a problem only with my Xubuntu installation, I've tested it on a fresh install of Ubuntu Studio 14.10 in VirtualBox. I can reproduce the bug with all default settings, and when I change the sample rate, the bug no longer occurs.

I've also found that choosing PortAudio solves the problem too:

PortAudio
API: ALSA
Device: default

Obviously if you play a 44.1kHz sample back at 48kHz it is going to sound higher.

Presumably what is happening here is that MuseScore is not reading the sample rate from the file (or sample rate info is missing from the file) and using the ALSA default.

The easy fix would be to use the 48kHz version found here

http://freepats.zenvoid.org/Piano/

Big download though!

Audio files from the soundbank already are at 48000 Hz:

$ avprobe SFZ/SalamanderGrandPianoV3_OggVorbis/ogg/A0v1.ogg
avprobe version 11_beta1-6:11~beta1-2, Copyright (c) 2007-2014 the Libav developers
  built on Sep  4 2014 16:47:58 with gcc 4.9.1 (Ubuntu 4.9.1-10ubuntu2)
Input #0, ogg, from 'SFZ/SalamanderGrandPianoV3_OggVorbis/ogg/A0v1.ogg':
  Duration: 00:00:21.11, start: 0.000000, bitrate: 94 kb/s
    Stream #0.0: Audio: vorbis, 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      ENCODER         : libsndfile
# avprobe output

And I previously tested SalamanderGrandPianoV3_48khz24bit.tar.bz2 and it makes no difference about the bug. File properties:

$ avprobe SFZ/SalamanderGrandPianoV3_48khz24bit/48khz24bit/A0v1.wav
avprobe version 11_beta1-6:11~beta1-2, Copyright (c) 2007-2014 the Libav developers
  built on Sep  4 2014 16:47:58 with gcc 4.9.1 (Ubuntu 4.9.1-10ubuntu2)
[wav @ 0xf11800] max_analyze_duration 5000000 reached
Input #0, wav, from 'SFZ/SalamanderGrandPianoV3_48khz24bit/48khz24bit/A0v1.wav':
  Duration: 00:00:21.11, bitrate: 2304 kb/s
    Stream #0.0: Audio: pcm_s24le, 48000 Hz, 2 channels, s32, 2304 kb/s
# avprobe output
Status (old) active needs info

Hmmm - I will download and see if I can get to the bottom of this.

I'm suspecting that the actual samples are 44.1kHz but being reported as 48kHz.

Marking as needs info until I've done that.

Status (old) needs info active

OK I have now checked the files.

All the sample rates are correct. In fact it looks as though the playback of 48kHz samples is ignoring that and processing them as 44.1kHz

This suggests that Zerberus is following the ALSA default sample rate but not recognising samples that are 48kHz and treating them as though they are 44.1

But why doesn't it do this in Windows?????

Have you tried other SFZ files?

I can reproduce the bug with all SFZ soundbanks I've tested:

  • Sonatina Symphonic Orchestra . File properties:
    $ avprobe SFZ/Sonatina\ Symphonic\ Orchestra/Samples/Grand\ Piano/piano-f-a1.wav
    avprobe version 11_beta1-6:11~beta1-2, Copyright (c) 2007-2014 the Libav developers
      built on Sep  4 2014 16:47:58 with gcc 4.9.1 (Ubuntu 4.9.1-10ubuntu2)
    [wav @ 0xa8f800] max_analyze_duration 5000000 reached
    Input #0, wav, from 'SFZ/Sonatina Symphonic Orchestra/Samples/Grand Piano/piano-f-a1.wav':
      Duration: 00:00:08.50, bitrate: 1411 kb/s
        Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
    # avprobe output
    
  • <code>piano-strings-finger-plucked.sfz</code> . File properties:
    $ avprobe SFZ/plucked_piano_strings/samples/28-e0.wav
    avprobe version 11_beta1-6:11~beta1-2, Copyright (c) 2007-2014 the Libav developers
      built on Sep  4 2014 16:47:58 with gcc 4.9.1 (Ubuntu 4.9.1-10ubuntu2)
    [wav @ 0x1f41800] max_analyze_duration 5000000 reached
    Input #0, wav, from 'SFZ/plucked_piano_strings/samples/28-e0.wav':
      Duration: 00:00:25.46, bitrate: 1411 kb/s
        Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
    # avprobe output
    
  • <code>detuned_piano.sfz</code> . File properties:
    $ avprobe SFZ/detuned_piano/samples/key-07-g-1.wav 
    avprobe version 11_beta1-6:11~beta1-2, Copyright (c) 2007-2014 the Libav developers
      built on Sep  4 2014 16:47:58 with gcc 4.9.1 (Ubuntu 4.9.1-10ubuntu2)
    [wav @ 0x150d9a0] max_analyze_duration 5000000 reached
    Input #0, wav, from 'SFZ/detuned_piano/samples/key-07-g-1.wav':
      Duration: 00:00:17.99, bitrate: 1411 kb/s
        Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
    # avprobe output
    

Every sfz that I have to test are made of 48000Hz samples (including salamander v3), but they only sound right when I play them in 44100Hz mode. I tested in alsa and jack backends and the result is the same. They sound right when in 44100 and a little more than a semitone up in 48000. It means that it's acting as if it was playing a 44100 sample even if the sample is 48000. Probably it's resampling the samples to 44100 when they are loaded independently of the system sample rate. Then, if played in 48000, it sound higher.

Title SalamanderGrandPianoV2.sfz plays a semitone higher SalamanderGrandPianoV2.sfz plays over a semitone higher

Yes, 44000 to 48000 is about a semitone and a half.

I should have clarified the latter part better at the time.