jmickle66666666/DoomUnity

soundfont/midi issues

Closed this issue · 9 comments

First of all, there's a minor error checking for midis to be enabled- #19.

Apart from that, selecting a soundfont and enabling midis throw some errors.

With params -iwad freedoom1.wad -soundfont Roland_SoundCanvas.sf2 I get this:

Can't find lump: D_DM2TTL
 
(Filename: C:\buildslave\unity\build\artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

ArgumentNullException: Argument cannot be null.
Parameter name: buffer
  at System.IO.MemoryStream..ctor (System.Byte[] buffer) [0x00000] in <filename unknown>:0 
  at AudioSynthesis.Midi.MidiFile..ctor (System.Byte[] data) [0x00000] in <filename unknown>:0 
  at GameSetup.PlayMidi (System.String name) [0x00000] in <filename unknown>:0 
  at GameSetup.StartGame () [0x00000] in <filename unknown>:0 
  at GameSetup.SetupWad (.IwadInfo info) [0x00000] in <filename unknown>:0 
  at GameSetup.Start () [0x00000] in <filename unknown>:0 

I'm just using a random copy of the soundfont I googled, so that could definitely be part of the issue. My copy is 9,887,744 bytes (on disk, thanks Windows).

Ah, D_DM2TTL is a track from Doom 2. I need to define the title music tracks in the iwad info.

Should be fixed with c4afff1

Still having issues- in editor and in the built player, I now have this error:

Can't find lump: 
UnityEngine.Debug:LogError(Object)
WadFile:GetLump(String) (at Assets/jmickle666/wadstuff/WadFile.cs:54)
GameSetup:PlayMidi(String) (at Assets/jmickle666/GameSetup.cs:230)
GameSetup:StartGame(IwadInfo) (at Assets/jmickle666/GameSetup.cs:218)
GameSetup:SetupWad(IwadInfo) (at Assets/jmickle666/GameSetup.cs:170)
GameSetup:OnGUI() (at Assets/jmickle666/GameSetup.cs:177)

The lump name appears to either be null or "".

Same error with -iwad freedoom1.wad freedoom2, and manual wad selection.

I've just realised this now happens regardless of commandline args, and whether midis are enabled or not.

did you rebuild the engine wad?

nope!!!!!!!! just realised too!

Just rebuilt it, seems to be the same issue.

Is the engine wad supposed to be a pwad?

IT WORKS. I DON'T WANT TO TALK ABOUT IT.
2017-12-22_17-51-22

the joy