Wohlstand / libEDMIDI

Emu De Midi as the library
zlib License
10 stars 1 forks source link

Pitch bend has incorrect tuning #1

Closed jpcima closed 2 years ago

jpcima commented 5 years ago

Pitch bending uses a coarse/fine value pair, which is equal to: semitone offset, and a real valued factor in order to scale frequency.

Problem is that this does not compute correct pitch as compared to libADLMIDI. Most probably, I think the reason narrows it that it does not account for the octave value in the formula.

https://github.com/Wohlstand/libEDMIDI/blob/da2c481d4d099657a362d0580221d7810f381c34/src/COpllDevice.cpp#L243-L245

COpllDevice and CSccDevice are both affected by the tuning problem.

Wohlstand commented 2 years ago

Just now I tested the thing, and the "plus" test fails: Pitch.zip There are two tests that play two notes: one note was normal, second was modified with a very high offset value. Minus test works fine, but plus test causes falsch while on other synths it played correctly. Both tests must result in the same tone on both notes.

Wohlstand commented 2 years ago

My WIP song also fails Lo Que Traje De Colombia.mid.zip

Wohlstand commented 2 years ago

Okay, I found the reason at the just bad input formula, I replaced it with similar that libADLMIDI/libOPNMIDI has, and now works much better

Wohlstand commented 2 years ago

Closing this as no reply