Circumvent Fluidsynth Pitch Adjustment (Play Same Pitch on with Two Different Key Assignments)

• Nov 24, 2020 - 23:14

System setup:
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit):, revision: 465e7b6

Attachments: (zip file inclusions)


Background: in pipe bands, drummers use the berger uniline system is used to indicate sticking (right above and left below the line) on a uniline staff.

I have previously hacked this for snare drum playback by using two different drums for left and right. Pitch is imprecise so it works fine until I record a better sample to use.

Now, I've made a custom soundfont for pitched tenor drums (used both in bass clef for multi-voice and uniline for solo) and on a uniline staff, I'm trying to circumvent fluidsynth pitch adjustment and make both notes played by both left and right hand to sound the same in playback.

The test file (Scale Tune Test 1.mscz) in the thread below works correctly
with the included soundfile from that thread (Scale Tune Test 1.sf2)
So it is probably not a Fluidsynth issue and something I'm not doing right.

Things I've tried:
- Setting Scale tuning to 0 in instrument and preset (no change)
- Setting root key to 60 and scale tuning to zero (no change)
- Changing the tuning of one of the notes to lower by 1 semi-tone in the soundfont instrument setting (no change)
- Changing the keys that are used for the notes - adjusted in only sount font (no change)
- Changing the keys that are used for the notes - adjusted in sountfont and instruments file (no change)
- Duplicating the sample, lowering pitch on new sample, adding new sample as right hand (key 56). (no change)
- Copying the preset from Scale Tune Test 1.sf2 into my sound file and replacing the sample with my own sample (result: notes sound different when they should sound the same).

My test file is Test_for_left_right_pitch_match.mscz
The PB Solo Tenor custom instrument is the one I'm trying to improve.
PB Tenors (bass staff) is for pitch comparison: the solo tenor should match the A2 pitch on the PB tenors staff. These notes should all play back at the same pitch when I get this working.

Attachment Size
PB4Musescore 1.61 MB


I might be overlooking something, and I'm likely not giving the answer you were hoping for, but here goes:
If all you're looking for is a way to have a snare drum berger uniline staff, then consider the following:

  1. Add a "Concert Snare Drum" instrument to your score
  2. Use "Edit Drumset" on it and change the "Staff line" setting from 0 to 1 for the defined pitches (37 & 38), which will move all notes below the line
  3. Enter your rhythm pattern
  4. The workaround
    • Click on the first note that should go above the line
    • Check the "Fix to line" option under Note in the Inspector and give it a value of -1
    • Now select that notehead again. Make sure you select only the notehead, so no blue rectangle!
    • Use the right arrow key to move through the notes and when a note should move above the line use the paste command (Ctrl+V) to have it paste the notehead properties over.

If done correctly, pasting the notehead will not change the duration of the already entered notes. As both notes above and below the staff are still the same pitch and only visually displaced; playback will use the same sound for them.

Attachment Size
313543-berger-uniline.mscz 2.85 KB

In reply to by jeetee

Thanks so much for your response. I've already solved it for snares by editing the drumset to link -1 to one type of snare sound (marching I think: drumpitch=38) and +1 to another (electronic drumpitch=40). For Tenor (and Bass) drums, though, doing the same thing (two different samples) results in them being re-tuned a whole tone apart.

I'm going to look into your suggestion for tenor drums (pitched, but on berger uniline and with a custom soundfont). Ideally I want to write a plugin to do what you've suggested, since I typeset a lot of complex music on uniline staves and I'm trying to set up a process that's straightforward for the band members that I teach to use themselves when they are typesetting things.

Ideally I'm hoping there is a way to make it "just work" since there must be an adjustment I can make in the soundfont (or the instrument.xml file?) to stop fluidsynth from re-tuning the sample it plays.

I have solved this issue. I'm actually not 100% certain what the issue was, but I was fiddling with tuning in my soundfont, and then when I tested it in musescore (didn't work), my A3 tenor drum note still wasn't working, but I impulsively decided to try using the instrument/preset I had set up previously for E2. To my surprise, the left and right (above/below the line) notes matched - it behaved as expected.

So I duplicated that instrument and preset and replaced the sample with my A3 sample (kept scale tuning = 0), and the result was the pitch was the same within the instrument, but a semitone flat (transposition required because this in bagpipe key - bagpipe is a Bb instrument in musescore).

So, I set tuning (semi-tones) to 1, and this solved the issue.

Thanks to everyone for reading and supporting and hopefully this helps someone in the future.

Attachment Size 1.66 MB

Do you still have an unanswered question? Please log in first to post your question.