Skip to content

Add pitch bend range conversion options #20

Open

Description

@Millennium-Eagle

Different composers can use different pitch bend ranges depending on what software they use to create the midi and what song they are composing. Seq64 expects certain non-standard ranges that match the game it is converting to (12 half steps for Ocarina of Time) during conversion, and when standard or other pitch bend ranges are used (including the standard 2 half steps), the software straight up doesn't know how to handle them and will end up with midis with messed up pitch bends or missing ones (if it can't find "off" events). There are also problems with other CC events, like Volume, that I don't understand the nuances of, but probably stem from similar issues; the software expecting them to work one way when they actually work another way. Since the methods the midis use to control these CC events are actually stored in the midi (otherwise it would sound different in every midi player), it is probably best if seq64 could automatically compensate for these differences in ranges by converting the values to ones that correctly correspond to the ranges it wants. Otherwise, this requires manually redoing these events in the correct ranges, assuming there is a simple way for the composer to do that, which there often isn't. This also requires the composer knowing the difference in ranges in different CCs between programs, assuming the programs they use even makes these values visible.

Activity

  1. sauraen commented on Sep 26, 2021

    @sauraen
    Owner

    You are correct that Seq64 does not modify pitch bend ranges and assumes that the arranger made the pitch bend ranges match those of the game they are importing into. Generally, Seq64 assumes that the arranger is familiar with the game's sound format and restrictions and created a MIDI which fits these restrictions, rather than trying to support any arbitrary MIDI to be imported.

    I have considered supporting the MIDI pitch bend range RPN. However, there are two complexities to this:

    • Seq64 would have to know the pitch bend range of every game using Music Macro Language (Audioseq). While I know this for OoT, I don't know this for most of the other games.
    • Not all MIDI editor programs support changing the bend range. Or in some, for example using most DAWs with VST sample players, the bend range can be changed in the VSTs but that may be a completely separate mechanism from getting the RPN to be in the output MIDI stream. So, if this change is implemented and the user is using a MIDI editor without this feature, their MIDIs will be locked to a bend range of 2 (MIDI default if the RPN is not specified), and it won't be possible for them to create the pitch bends they want in the game. The solution would be an optional override on the incoming MIDI bend range in the GUI.

    These are not too difficult and I can make them if you would like, however they basically just shift the burden from the arranger making the bends correct at arranging time to making them correct at import time. They still have to know what the game expects and what their software put into their MIDI.

    missing ones (if it can't find "off" events)

    This applies to notes, not pitch bends. Unless you're talking about pitch bend of zero after nonzero pitch bends as being "off", but 0 should always be 0 regardless of what the range is. Seq64 complaining about can't find note off can happen if the arranger puts a loop point in the middle of a note, or if they have two overlapping notes (same pitch on the same channel). The latter is technically invalid MIDI, though many MIDI editors will let you create it. The reason it is invalid is because it's impossible to determine which note off connects to which note on.

    There are also problems with other CC events, like Volume, that I don't understand the nuances of, but probably stem from similar issues; the software expecting them to work one way when they actually work another way.

    Not sure what you're talking about here. If you have optimization disabled, Seq64 just converts every CC to the appropriate type of Music Macro Language command with the same value. There is some nuance here in that Audioseq volume commands, for example, are range 0-255 whereas MIDI volume commands are 0-127, but MIDI files can actually have the upper bit set for a value above 128, though this is invalid MIDI. It is not always clear what putting those higher values would do in the game's sequence player. But it's very unlikely anyone would run into this unless there were editing their MIDIs in a hex editor.

    If you can provide a MIDI which reproduces this issue, and the issue continues when optimization is disabled, please let me know and I will investigate.

  2. Millennium-Eagle commented on Sep 28, 2021

    @Millennium-Eagle
    Author

    I think the option should be available for pitch bend compensation for the very reason you say: a lot of editors don't even have pitch bend range modification (although when using a DAW that allows it, I always adjust it depending on the song). When composing a midi, one probably has to conform to the standard pitch bend range (which would result in the midi probably not having any specific range information) even if they know what the pitch bend range of the game is supposed to be, and makes sure the rest of the midi conforms to the game's standards. The option to compensate for the range difference using a GUI option in seq64 may be the only way someone can do so using the tools they have, and whether or not they can do it during the editing process or can only do it during the conversion process it would have to happen at SOME point.

    As for the volume issues, that volume range discrepancy might explain something. From what I can tell, seq64 can sometimes solve the difference in an expression envelope by doubling the values and sticking a bunch of zeros in between, which causes a stuttering effect and even a complete muting of the channel if the envelope ends with an inserted 0. I'll try to be more specific with the issues there and actually give an example midi and errors as soon as I can, as well as some other event related errors that puzzle me. This also includes the pitch bend "off" errors that confuse me for the very reason you say (what exactly is the debugger talking about?).

  3. sauraen commented on Sep 28, 2021

    @sauraen
    Owner

    I just ran into a bug yesterday with Seq64's support for Music Macro Language commands represented by multiple CCs, where for some reason it sometimes (but not always) is unable to find volume commands. The error message is something like "In multiple CC command (first CC 7) could not find secondary CC 7, setting to zero!" This doesn't have to do with "couldn't find note off" though. But it sounds like this may be the same bug as you're seeing with the zeros. I will fix this ASAP as it's blocking me as well.

    I will think about what is the best way to support rescaling pitch bends.

  4. sauraen commented on Sep 29, 2021

    @sauraen
    Owner

    I have fixed the CC bug. Please download v2.1.1.

    I don't have time to add the pitch bend range scaling system at the moment, but it's on my list.

  5. changed the title [-]Various CCs are messed up during conversion when unexpected ranges are used.[/-] [+]Add pitch bend range conversion options[/+] on Sep 29, 2021
  6. Millennium-Eagle commented on Sep 29, 2021

    @Millennium-Eagle
    Author

    Brilliant. (Although the GUI still says 2.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions