Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N64 Soundbank Tool - Majora's Mask Midi Export #44

Open
lankv2 opened this issue Aug 6, 2022 · 11 comments
Open

N64 Soundbank Tool - Majora's Mask Midi Export #44

lankv2 opened this issue Aug 6, 2022 · 11 comments

Comments

@lankv2
Copy link

lankv2 commented Aug 6, 2022

When exporting the southern swamp sequence there is no pitch bend events. If you listen to the track from the game's ost there is clearly pitch bend. I use wine to run n64 soundbank tool and I use rosegarden and midieditor to edit the midis. I'm using majora's mask (u) decompressed rom. Other sequences have been successful in exporting the pitch bend events.

@lankv2 lankv2 changed the title N64 Soundbank Tool - Majoras Mask Midi Export N64 Soundbank Tool - Majora's Mask Midi Export Aug 6, 2022
@SubDrag
Copy link
Collaborator

SubDrag commented Aug 6, 2022

You'll have to be much more specific on what midi specifically, and when pitch bend should come.

@lankv2
Copy link
Author

lankv2 commented Aug 6, 2022

Legend of Zelda, The - Majora's Mask (U) Decompressed 0000000C 00C77B70.mid and the pitch bend should start at about 6 seconds in.

@SubDrag
Copy link
Collaborator

SubDrag commented Aug 7, 2022

Here's the debug parse - don't see any pitch bend events?
https://pastebin.com/E3vrH4ET

@mmontag
Copy link

mmontag commented Sep 23, 2022

@BENDER-V2 you're talking about the plucked instrument? This sounds like vibrato to me. There are a couple vibrato messages in the paste...

@lankv2
Copy link
Author

lankv2 commented Oct 13, 2022

@mmontag Might be, when i exported it to a midi file it seems that it did not keep the vibrato.

@SubDrag
Copy link
Collaborator

SubDrag commented Oct 13, 2022

Vibrato isn't supported for export. Midi doesn't support as much as the n64 sound engine does.

@DeathWrench
Copy link

What else is missing? I'm assuming vibrato isn't the only one. Are there any alternatives that are like vibrato that sound exacty like it when tweaked a certain way; that midi does support? I'm suggesting that if there is an alternative that sounds identical, could use that in replacement for things that have vibrato.

@SubDrag
Copy link
Collaborator

SubDrag commented Oct 14, 2022

Tremolo, etc. I don't think there's a good way to encode in midi. I think someone suggested in the past maybe just putting them in as extra midi commands so someone opening it in a tool, could see them, and manually adjust. But anyways there's no good way to do actually support vibrato.

@mmontag
Copy link

mmontag commented Oct 14, 2022

I must be missing something here, but... doesn't vibrato depth usually map to MIDI CC 1, the mod wheel? For example, this is a default modulator in the SoundFont spec and FluidSynth.

There's also the GM2 CC 76 (Vibrato Rate), CC 77 (Vibrato Depth), and CC 78 (Vibrato Delay).

@SubDrag
Copy link
Collaborator

SubDrag commented Oct 14, 2022

Sorry now I remember - the vibrato on N64 is defined on the *instruments, not in the midi. That's why most games I don't support vibrato (using standard formats). Now EAD games like Majora's Mask have it in the midi, so it might be possible. Do you know how the values translate from the debug parse to midi commands here? Not sure it's the same scale or direct translation. For example showing in this song vibrato of 05 and 09. Not sure what that translates too.

@L-Spiro
Copy link
Contributor

L-Spiro commented Oct 16, 2022

EAD music has MIDI controls for vibrato delay (0xE3), vibrato depth (0xD8), and vibrato rate (0xD7).
These can map to GM2 controls fine enough, and the vibrato works the same in all EAD games—a rate of 0x40 is always the default and runs at the same speed in all EAD games.
So the EAD vibrato delay times, vibrato depths, and vibrato rates can all be translated into hard numbers using code you can find in Nintendo Synthy-4:
https://github.com/L-Spiro/Nintendo-Synthy-4/blob/main/NS4/Src/MIDI/NS4MidiFile.h#L1812
Same with tremolo below that.

But there are 2 issues.

  1. The vibrato command in EAD isn’t always vibrato. In Lon Lon Ranch/Romani Ranch it is set to tremolo. In Yoshi’s Story: Rail Lift it is set to a ring modulator. It is the same set of commands (0xE3, 0xD8, and 0xD7), just the game patches it through a different effect externally from the MIDI file, so there is no way to know which effect to use.
    Still, it is almost always vibrato, and if the commands were added to the MIDI files then dozens of tracks will start to sound correct while only a few will sound incorrect.

  2. There is no MIDI standard for how to implement vibrato. We can know the EAD cycles-per-second, delay time, and total pitch-bend, but we can’t know these values on the GM side; they will be different in every player/synthesizer.
    Still, they should be at least similar, so you can take a few sample sets, time/measure them, and try to make conversions.
    But you should still keep the original data in the MIDI file, as it would be necessary for my work (though I currently just load the debug file). I would recommend adding them as comments/labels/lyrics inside the MIDI file, that way people who want the translated values can just play the file and people who want the original values can ignore the translated vibrato commands and parse the labels instead.

Here is the mentioned track with proper vibrato rendered using the code above: https://www.dropbox.com/s/skfvr6tmutsve18/042%20Southern%20Swamp%20%28Surround%29.mp3?dl=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants