DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

IMFCreator
Page 3 of 3 Goto page Previous  1, 2, 3
DieHard Wolfers Forum Index -> Beta Breakers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

Topics: 55
Posts: 2115
Location: Canada
blank.gif

PostPosted: Thu Jan 12, 2006 6:59 am
   Subject: Re: Odd Imf problems.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I tried to open IMFCreator (the version currently on your site), and when I opened any midis, nothing happened.
Then it kept saying GetIMFPosition() "IMFPlayer not initialized!" after I closed the program down. When I press Ok, it keeps coming back.
The more times I open IMFCreator and try to load a midi, then close it, the more popups keep coming on and saying that message.
Even if I right click the bottom of my screen (where all the error messages are) and press Close Group, they instantly come back again.
I thought maybe I had something else running that's using wave/midi/SW Synth, so I turned off Windows Media Player, Chaosedit, and FLStudios.
Still seems to do it though, so maybe I need to restart my computer or something. Got too many interesting things open at the moment though.
My Ctrl-Alt-Delete doesn't seem to work either now, neither does clicking on the Task Manager exe manually. Ha.

Just thought I'd let you know. Hrmm, maybe this topic should be merged with the IMF Creator thread.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

Topics: 55
Posts: 2115
Location: Canada
blank.gif

PostPosted: Thu Jan 12, 2006 7:34 pm
   Subject: Re: Odd Imf problems.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ok, I finally restarted my computer and the program seems to work now. Smile
Guess the repeating error message was just temporary, or it meant that I had to restart my computer after installing - lol.

Adam Biser wrote:
EDIT: In the meantime, you can probably just delete the sysex commands from your MIDI file.

I noticed that the midi file was grouped into a multi channel, so I just pressed "Split Track into Single-Layered Tracks" in Anvil Studios and then it seemed to play fine. Is that the same thing as a sysex command? I'm learning alot of words by reading your posts (like Tooltips; I'm so uninformed - haha).
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Thu Jan 12, 2006 8:57 pm
   Subject: Re: Odd Imf problems.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'll check that problem out, Chris.

SysEx is short for System Exclusive commands. Basically, they are commands for a particular brand/make of synthesizer and/or sound card. At least that's what I understand them to be.

Some vague info:
http://www.terzoid.com/noize/nzsysex.html
Has some links to PDFs with SysEx information to be included in the next revision of the MIDI specs.
http://www.midi.org/about-midi/specinfo.shtml

Anvil might strip them out automatically, so simply saving the file in Anvil might have fix things even if you didn't split the tracks. There are three MIDI formats, two of which are popular. One stores data in multiple tracks, kind of like you would see on music manuscript paper for an orchestra. The other stores all song data in a single track, kind of like a condensed score, but it remembers which instruments play which notes. The "split track to single layered tracks" probably converts from the latter format to the former.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

Topics: 55
Posts: 2115
Location: Canada
blank.gif

PostPosted: Fri Jan 13, 2006 8:56 am
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks for the info Adam. Smile
I probably should have just looked it up on google to save you some time.

Ok, I looked at the original midi in a hex editor, and there was no occurances of F0 or F7. Midis don't contain any kind of extra compression, right? Then I went to the event editor, and clicked "Filter Events" and checked "System Exclusive", then it said "No events were deleted", so I guess Anvil Studios didn't recognize any of them as System Exclusive. If I saved the file, though, it would still start off with the minute of silence, so I tried filtering out the "Program Change" events, and then the midi worked in IMFCreator, but of course alot of things sounded wrong because I deleted the Program Change events. I loaded the original midi again, and noticed that there was a Program Change that occured twice in a row, so I deleted one of them, and then the midi worked in IMFCreator. I tried loading the original midi again, and deleting other Program Change events, just to see if it was speficially that event that was causing the problem, and the midi still didn't work from deleting any others, so that tells me that these lines probably have something to do with the problem:

::: CODE :::
18, Min:Sec:Frames=0:00:00, ChannelVolume, chan: 4, value: 120
19, Min:Sec:Frames=0:00:00, Panpot, chan: 4, value: 64
20, Min:Sec:Frames=0:00:00, ProgramChange, chan: 9, value: 1
21, Min:Sec:Frames=0:00:00, ChannelVolume, chan: 9, value: 127
22, Min:Sec:Frames=0:00:01, ProgramChange, chan: 9, value: 1
23, Min:Sec:Frames=0:00:01, ProgramChange, chan: 9, value: 1

24, Min:Sec:Frames=0:00:03, NoteOn, chan: 1, note: 60, vel: 110, dur: 20

Once you delete one of those two repeating events, the midi work fine in IMFCreator. If I try to change the value of one, it doesn't work, but if I change the channel number of one, it works, so maybe you can't have two ProgramChange events on the same channel at the same time. The weird thing is, though, that if I change the channel number, save it, then change the channel number back, it still works, so something else must have changed from doing that specific alteration.

Here's the two midi files, all I can tell so far is that the working one is one byte larger than the other, but I haven't fully compared their events/data.
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Fri Jan 13, 2006 9:00 am
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

OK, guess the sysex commands weren't the issue. I remember that I had a problem with them once and never got around to fixing it. I grabbed that zip and I'll see what's going on here. At least you were able to make an IMF that works for him.

EDIT: Strange that the different is only one byte because an instrument change uses two. One as the MIDI command, one for the new value.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

Topics: 55
Posts: 2115
Location: Canada
blank.gif

PostPosted: Mon Mar 06, 2006 12:55 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'm curious, would you ever consider having an option so that you could select from 64k, 128k, and 256k for the IMF output instead of just 64k? I looked for something similar but didn't notice anything. Even if a song gets truncated, I would still like to know what the ending would sound like sometimes in IMF. Who knows, someone might be able to adjust the limit one day, and then they would be able to test it. I have some pretty long midis that could go well in some big levels. Just an idea.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:54 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Mar 06, 2006 7:12 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I encourage that feature for a different reason; now that WOLF4GW is out, the 64K-limit for IMFs might not necessarily be a restraint any longer.

There is a feature to pack more music into the same IMF without exceeding the 64K limit, though. Robert Prince mentioned that the IMF can be specified to replay an earlier part of its data rather than repeating the same data in the IMF file over and over. This made the overall size of the IMF shorter. Do you have any details about this IMF instruction, Adam?
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Mon Mar 06, 2006 8:45 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I don't think it would be too hard to add this ability.

@Tricob: I've seen no such instruction and I strongly doubt it exists because IMF is interpreted as an array of byte data. It can't jump around.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:54 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Mar 06, 2006 10:14 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'll invite you to prove me wrong, then. My theory is that there's at least two such instructions in the "Get Them!" theme; one with the drum patterns, the other with the Electric Piano. You'll notice that when translating the IMF to Midi format, both instruments run out of notes right when they're supposed to start repeating themselves.

This is the result of IMF2MIDI, anyway. So why can the notes of all the other instruments be translated, but drums and Electric Piano can't? Even if I'm wrong here, whatever's causing this to happen will be an interesting find, wouldn't you agree? Smile
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Tue Mar 07, 2006 7:07 am
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

IMF instructions are four bytes in length.
byte 0 - the adlib register to modify
byte 1 - the value to send to the register
byte 2-3 - how many tics to wait before going to the next instruction.
They playing of such takes place in lines 398 to 409 in ID_SD_A.ASM.

Here are the registers from ID_SQ.EQU:
::: CODE :::
;   Stuff for the AdLib
;   Operator registers
alChar            =   20h
alScale            =   40h
alAttack         =   60h
alSus            =   80h
alWave            =   0e0h
;   Channel registers
alFreqL            =   0a0h
alFreqH            =   0b0h
alFeedCon         =   0c0h
;   Global registers
alEffects         =   0bdh

Channel registers have a register for each channel, ie: alFreqL goes from 0xa0 to 0xa9
Operator registers have a register for each operator, ie: alChar is from 0x20 to 0x35

More info

The structure of an IMF is that all channels are jumbled together into one data stream. MIDI files are note like that. Each track is separate, unless you save as file type 0, which jumples all MIDI events into one track. The jumbled nature makes it impossible to just say "play this tracks stuff starting at position X" unless the entire song repeated. But then you'd have to make some pretty major modifications to the assembly code.

This just shows me that IMF2MIDI has a bug. I've not used it, so I don't know.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:54 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue Mar 07, 2006 7:05 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks for the IMF info, Adam. Smile One last question - If one IMF channel ran out of data before the other ones did, is the Wolfenstein code designed to replay that channel from the beginning, without doing the same with the rest?
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Tue Mar 07, 2006 8:32 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Let me stress again, IMF is not like MIDI files. In MIDI, you can save data in much the same way that one would write it down a staff paper. You can do one instrument per track, or even one instrument part per track. IMF is not like this.

The process of making an IMF file is very much analogous to condensing an orchestra score to be played by a pianist. You're going to lose some notes and all the notes are jammed together instead of being separate for each instrument. The only difference is that IMF allows you to define what instrument plays which note. But the togetherness of the notes is still the same. Like one of those one-man bands. You don't really think of it as "the knee cymbal part ran out of notes," but more like "he doesn't use the knee cymbals any more this song". Something like that... anyway. The IMF limit pertains to all notes, not a particular instrument or channel.

To think of adlib channels as being only one instrument is not good. IMFCreator will try to keep an instrument in one channel because that uses less data than having to re-define the instrument elsewhere. However, it can occur, but you won't hear the difference. A channel can switch instruments each note, if need be, but the length limit will be reached quickly.

There's nothing in IMF nor the standard MIDI definitions (there ARE some non-standard MIDI definitions, yes) that says to simply repeat a certain section of the song X number of times. If the part stops, it just stops.

Hope that makes things a bit clearer... maybe.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 30 Oct 2017

Topics: 55
Posts: 2115
Location: Canada
blank.gif

PostPosted: Wed Mar 08, 2006 4:15 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Adam Biser wrote:
Hope that makes things a bit clearer... maybe.

I like to picture the structure of an IMF as more of an mp3 or wave file than a midi. It takes all the events from 0:00 and grabs them, then says "play these for x amount of time, until an event change occurs", then it grabs whatever is next in the timeline (say, it'll shut off the first note at 0.00.3, then play two new notes at 0.00.8, then something from 0.01.4, etc.), but everything is read in order according to time, every instruction you want to use must be happening at the same time until you tell it to move the timeline ahead for it to play an event at a new time. It must have everything stored in order based on time because it's reading everything in realtime as it's playing it to your ears. I find it really easy and fun to picture when you think about it like that. Smile

The idea of having a loop instruction would be pretty cool though. You could say "if a byte equals 0xF8, move the data pointer back the amount of bytes that the next two bytes tells you", which could be calculated in advance from the midi by storing the address of the start of the loop beforehand somewhere, then subtracting your current location from it as you post the "backwards jump length" into the 0xF8. Then, the last byte or next four bytes could contain how many times it should loop, having a variable in memory that keeps track of how many times you've looped it already, ignoring the loop instruction and setting the counter back to 0 once it reaches the number of loops in the reference. That's basically all you'd have to do, I think. You could probably even create a loop feature by accident just by changing a certain address in memory (whatever address says where you're supposed to be reading from in the IMF at the time). Sort of reminds me of how you could look at tile 65,24 on the map after hitting a pushwall and it will change that value to 1,24 so you end up on the other side of the level in one of my Melee levels. Haha.
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Wed Mar 08, 2006 6:21 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@Chris: Well, you can look at it like that, though WAV files store wave forms and don't have events or anything. IMF matches the MIDI file type 0 completely. This file type matches what goes out the MIDI port when you play a MIDI song through a keyboard or something. MIDI also has a 'do this until I tell you otherwise' sort of mentality'. It gives a NoteOn event, a delay time, then a NoteOff event.

As for programming a loop function. It might not be too difficult, but it might put a bit of a strain on the engine. Maybe not. I'm not sure. I'm not an assembly code person, I'd have to shoot out to C land for a bit and I don't know how much that might slow things down. It's a good idea though.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:54 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Mar 08, 2006 6:56 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Chris wrote:
The idea of having a loop instruction would be pretty cool though.

Well, I'll be looking into the "play IMF" parts of the code later on this week and see just how the file is played back. Going by Adam's reply to my last question, I think he misunderstood my last question (The question related solely to how the Wolfenstein code played back the IMF, not about "special codes" in the IMF that normally wouldn't play back). But that's okay, as it was probably more a Code Crackers type of question, anyway. I blame myself for his misunderstanding. Sorry, Adam. Sad
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Wed Mar 08, 2006 7:52 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The answer I gave is correct. No. The code is not designed in such a way. You can always change it, as Chris says. But you'd be expanding the definition of an IMF file. Even with Chris' change, you'd be repeating all notes from a particular point, not just a particular track.

Here's the IMF playback code (from ID_SD_A.ASM):
::: CODE :::
   mov   ax,[es:di+2]               ; Get time to next event
   add   ax,[WORD PTR alTimeCount]
   mov   [WORD PTR sqHackTime],ax
   mov   ax,[WORD PTR alTimeCount+2]
   adc   ax,0
   mov   [WORD PTR sqHackTime+2],ax

   mov   ax,[es:di]                  ; Get register/value pair
   xor   bh,bh
   mov   bl,ah
   xor   ah,ah
   CALL alOut C,ax,bx

   add   di,4
   mov   [WORD PTR sqHackPtr],di

Hope that helps you.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:54 ago.

Topics: 160
Posts: 8007
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Mar 08, 2006 8:34 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Adam Biser wrote:
The answer I gave is correct. No. The code is not designed in such a way. You can always change it, as Chris says. But you'd be expanding the definition of an IMF file. Even with Chris' change, you'd be repeating all notes from a particular point, not just a particular track.

Here's the IMF playback code (from ID_SD_A.ASM):
::: CODE :::
   mov   ax,[es:di+2]               ; Get time to next event
   add   ax,[WORD PTR alTimeCount]
   mov   [WORD PTR sqHackTime],ax
   mov   ax,[WORD PTR alTimeCount+2]
   adc   ax,0
   mov   [WORD PTR sqHackTime+2],ax

   mov   ax,[es:di]                  ; Get register/value pair
   xor   bh,bh
   mov   bl,ah
   xor   ah,ah
   CALL alOut C,ax,bx

   add   di,4
   mov   [WORD PTR sqHackPtr],di

Hope that helps you.

Thanks for trying to help, Adam. But that's not the part of the code I'm looking for. Smile
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Wed Mar 08, 2006 8:42 pm
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
Well, I'll be looking into the "play IMF" parts of the code later on this week and see just how the file is played back.

Tricob wrote:
that's not the part of the code I'm looking for.

I thought you wanted the code that takes care of "how the file is played back." That is all the "play IMF" code in there other than the Adlib card detection and such, which isn't part of the playback code. But anyway, best of luck finding whatever it is. Smile

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 15 Oct 2017

Topics: 22
Posts: 1281
Location: Rauma - Finland
finland.gif

PostPosted: Sun Nov 05, 2006 12:11 am
   Subject: Re: IMFCreator
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Thank you for this program Adam, you're a real life saver. Mr Green

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Beta Breakers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 3 of 3 Goto page Previous  1, 2, 3
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts WDC
Author: Adam Biser
556 48004 Tue Oct 03, 2017 6:13 am
Adam Biser View latest post
No new posts ChaosEdit preRelease released ;D
Author: Ripper
177 24509 Fri Oct 09, 2009 6:03 pm
Tricob View latest post
No new posts Problems with FloEdit II... (Please help!)
Author: Metal Overlord
13 4065 Wed May 17, 2006 11:24 pm
Codetech84 View latest post
No new posts ChaosEdit: Second beta phase started!
Author: Ripper
151 25845 Sun Apr 24, 2005 4:42 am
Zombie_Plan View latest post
No new posts Beta Testing - How do you go about it?
Author: BrotherTank
1 1551 Sat Apr 09, 2005 2:51 am
Zombie_Plan View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group