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

Instructions on how to create/add music #9

Open
Happy-Ferret opened this issue May 5, 2019 · 3 comments
Open

Instructions on how to create/add music #9

Happy-Ferret opened this issue May 5, 2019 · 3 comments

Comments

@Happy-Ferret
Copy link

Happy-Ferret commented May 5, 2019

I'd appreciate a short tutorial on how to create/add midi music to a ScummC game.
For testing purposes I took a midi file of the Secret of Monkey Island main theme, dropped it next to the soun tool and ran soun -midi MainTheme.midi, then renamed output.soun, dropped it into examples/openquest and added the following two lines to officeroom.scc

startMusic(themeMusic);

The startMusic bit I added directly inside if(firstInit).

Expected result: Having music play in the background.
Actual result: The game crashes.

@Happy-Ferret
Copy link
Author

Happy-Ferret commented May 8, 2019

I ended up getting this somehow to work (although it still sounds godawful), after realizing I was supposed to merge all tracks into one.

However, there are still instances of the engine crashing after specific control sequences.

../../build.Mark-PC/x86_64-gnu-gcc-5.4.0-debug/midi music/gsmonkey.mid sounds/test.mid -merge-track 2 -merge-track 1 -merge-track 0 -merge-track 3 -merge-track 4 -merge-track 5 -merge-track 6 -merge-track 7 -merge-track 8 -merge-track 9 -merge-track 10 -merge-track 11 -merge-track 12 -merge-track 13 -merge-track 14 -merge-track 15 -merge-track 16 -set-type 0

For instance, the Monkey Island 2 theme song immediately crashes ScummVM.

EDIT: NVM. Turns out when websites advertise the MIDIs as "ripped" they mean as in recorded off of an MT-32 or the likes.

I went ahead and ripped the MIDI straight from the actual game files. The originals work fine alas can't be loaded by my MIDI editor. Well. Can't have it all...

@Wavestation
Copy link

Wavestation commented Feb 20, 2021

Hello @Happy-Ferret, I'm currently working to make a soundtrack for "Open Quest", in order to experience myself with iMuse implementation. I'm experiencing the same crash issue :'( ... I wondering if you tried with a MIDIFile directly extracted from MI2 resources, or a file downloaded on the Internet ?

I think system is waiting for some specific SysEX commands into the MIDIFile in order to play propely.

In addition, MIDI File has to be in "2" format : http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html#BM2_2
I've got a little translator program at studio to merge several MIDI "0" files into an unique MIDI "2" ... I'll test it asap !

@Wavestation
Copy link

Wavestation commented Feb 20, 2021

I progressed in my investigations ... here is a summary of my operations. I did all on a Macintosh under OS 10.11.

  1. I composed a short MIDI tune with my favorite sequencer (aka Digital Performer from Mark of the Unicorn) and exported it as MIDIFIle 0 named "LOBBY0.MID"
  2. I converted this file using a DOS utility called "MIDI0TO2" into a DOSBox session, to a file "LOBBY2.MID"
  3. I used the 'soun' tool included in the package to put my MIDIFile into a .soun resource fork with this command : soun -gmd LOBBY2.MID -o lobby.soun
  4. I used the same code than yours to play the music.
  5. It PARTIALLY worked ... the game doesn't crashes, and the sequence plays ... but ONLY the drum track is audible. I guess I have to deal with control changes (volume, expression, etc.) or other things to make it more "musical".
    Addendum : To make the tune looping correctly, I think I have to deal with iMuse SysEx hook messages, but I'll try it in a further experience !

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

2 participants