Copyright: Embed.exe ® 1994 by Jamie O'Connell


Contents
EMBED.EXE

EMBED.EXE is a DOS utility that creates Multimedia Gif files that can be viewed with MMGIF.EXE, a Windows 3.1 Gif viewer. Both EMBED.EXE and MMGIF.EXE are available on the Sight and Sound Forum (SSFORUM) on CompuServe. Multimedia Gif files can contain many Gif images synchronized to music from a MIDI file and simultaneously play digital sound from wave files.

Tutorial

Required Script Sections

[Files]

[MIDIn]

Optional Script Sections

Advanced [MIDIn]

Script Options

How To

Run EMBED.EXE

Specify Image Transitions

Support

Product Support

The Graphics Interchange Format is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated. Windows is trademark of Microsoft Corporation.


Support
Product Support

EMBED.EXE and its companion program MMGIF.EXE were envisioned and created by CompuServe Staff in the Sight And Sound Forum. Consequently, it will be supported within the Sight And Sound Forum on CIS:  GO SSFORUM

Credits and Acknowledgment

Chief Wizop Visionary:	Jim Maki	-Sysop	[76701,33]
Design and Implementation:	Jamie O'Connell	-Sysop	[72662,1433]
EMBED.EXE- GIF Embedder:	Tom LeCompte	-Sysop	[76711,572]
Help File	Jerry Jorgenrud		[75060,1040]

Disclaimer

This program is provided without any warranty, expressed or implied, including but not limited to fitness for a particular purpose.


Tutorial

This tutorial is designed to demonstrate the minimum requirements necessary to create a multimedia Gif. There are many options available to give you complete control over the mmgif you create, but reading about them at an early stage can make using embed.exe seem unnecessarily complicated. Start with a simple slide show and explore additional options as you become more comfortable.

To assemble a multimedia GIF you need Gifs and at least one MIDI file. A MIDI file is required as a timing device, but it can be a blank file, one without music. A file for this purpose called null.mid is available on the Sight and Sound Forum and is also packaged in the embed.zip file. Null.mid has only timing events, no music.

Once you have decided on the Gifs and other files that will go into your mmgif, you need to write a script that EMBED.EXE will follow as it creates the mmgif. The script file is a plain ASCII file similar to a Windows .ini file. Use Notepad or a similar text editor that can save plain text files, and open a new file. A sample script has been provided that demonstrates more advanced techniques, but in the beginning this simple one will get you started.

Just as with regular .ini files, any line preceded by a semi-colon is treated as a comment line by EMBED.EXE. You can write explanatory notes to yourself in this way. So, you might start your script file with the lines:

; myfab.scr -- script file name

; Script for MYFAB.GIF

; Talented Author, Copyright 1995

Next, setup the Files section.


Example Script

Select the Example button on the Help menu bar to open the script window.

This script, called techno.scr, covers most of the more advanced ways to use embed.exe, and also contains some additional comments about these techniques.

Note that the example can be printed, or copied to the clipboard as a template for editing your own script. The window can also be sized and moved to fit alongside the main help window so you can refer back and forth. The example window can be closed by double-clicking on the System Menu bitmap

or by using the Menu itself. Alternatively, it will close if you close the main help window using FILE / EXIT.


[Files]

This section of the script specifies what files you want to include in the final mmgif, and also specifies the name of the file you will create. So far your script looks like this:

; myfab.scr -- script file name

; Script for MYFAB.GIF

; Talented Author, Copyright 1995

Now add the [Files] section. There will be three mandatory entries. You must provide the name of the output file, the name of the MIDI file, and the name of at least one Gif. You can optionally include a comments text that will be stored within the Gif and can be read by selecting the Details Menu item in MMGIF.EXE. You can also include the names of any wave files that will be played by your mmgif.

You only need the full path names for the files that are not in the same directory as your script file.

Assuming you are ambitious and want to include everything in this mmgif, your script file might look something like this:

; myfab.scr -- script file name

; Script for MYFAB.GIF

; Talented Author, Copyright 1995

;section name

[Files]

; Name of the file that will be created

GIFOut=c:\mygifs\myfab.gif

; There must be at least one MIDI file

MIDI1=c:\mymidi\great.mid

;There must be at least one Gif

; Obviously, there will usually be several

GIF1=c:\mygifs\great.gif

GIF2=c:\mygifs\great2.gif

GIF3=c:\mygifs\gr8_2.gif

GIF4=c:\mygifs\wow.gif

; To include extra information

Comment=c:\texts\myfab.txt

; Any optional wave files

WAV1=c:\waves\yahoo.wav

Note that there are no spaces before and after the equals sign.

The numbers assigned to the files, such as GIF1, are only identifiers and do not determine the order they will be played or viewed. That comes later, in the next section -- [MIDIn].

There is no requirement that these numbers be consecutive or even numbers, just unique identifiers for each Gif and Wav. GIFx, GIFy, and GIFz would also work.


[MIDIn]

This section specifies when each gif is viewed or wave is played. The small "n" after MIDI refers to the number or identifier you assigned to the MIDI file in the [Files]. In our example, we only have one MIDI file, which we identified as MIDI1, so there will only be one MIDI section, [MIDI1]. If you had two MIDI files, and the second one you identified as MIDI2, there would be a [MIDI2] section, and so on.

Remember that the MIDI file controls the timing for all events. You can specify the time for an event either in beats.ticks (MIDI lingo) or in minutes:seconds:hundredths. The order that the events are listed in the script does not have to be sequential. The last event can be specified first, for example. Embed.exe determines the order from the times, not the order they are listed.

Under the section you already have, add:

;Section Name

[MIDI1]

;Specifies the order the MIDI files

;are played. If there is more than one

;MIDI file, SongNumber=2 plays when

;the first song is done.

;This parameter is required even if

;there is only one MIDI file.

SongNumber=1

;The following identifiers, like TIME1,

;only have to be unique. The exact

;name can be whatever you like

;The following specifies that GIF1

;will display at 2.25 seconds after

;the start

TIME1=GIF1, 02:25

;GIF2 displays at 20 seconds

TIME2=GIF2, 20:00

;GIF3 at Twentieth beat of song

TIME3=GIF3, 20.00

;One minute, 5.30 seconds

TIME4=GIF4, 1:05:30

;If you have a Wave file specified

;this plays it at 40 seconds after the start.

TIME5=WAV1, 40:00

    Click the button to view the complete Tutorial Script

(Note that the last line of the script must be terminated with a carriage return.)

And that's all you need for your simple script! Save the file into a convenient directory (perhaps where the gifs are stored, but it can be in any directory), and give it a file extension of .scr. Now you can run EMBED.EXE to create the mmgif or continue on and read about the advanced options for the [MIDIn] section and other optional sections of the script file.


;You can copy this to the clipboard

;and paste it into Notepad.

;Substitute your MIDI file,

;your Gif files, and the directory

;for myfab.gif.

;Save the file as myfab.scr.

;Run embed to create myfab.gif.

;To include wave and comments files

;add their file names and remove the

;semi-colons in front of Comment

;and/or WAV1 and TIME5.

;----------------------------

;myfab.scr -- script file name

;Script for MYFAB.GIF

;Talented Author, Copyright 1995

[Files]

GIFOut=c:\mygifs\myfab.gif

MIDI1=c:\mymidi\great.mid

GIF1=c:\mygifs\great.gif

GIF2=c:\mygifs\great2.gif

GIF3=c:\mygifs\gr8_2.gif

GIF4=c:\mygifs\wow.gif

;Comment=c:\texts\myfab.txt

;WAV1=c:\waves\yahoo.wav

[MIDI1]

SongNumber=1

TIME1=GIF1, 02:25

TIME2=GIF2, 20:00

TIME3=GIF3, 20.00

TIME4=GIF4, 1:05:30

;TIME5=WAV1, 40:00


Advanced [MIDIn]

You can specify additional options on the Event line following the time. The purpose of these additional options is to be able to override the methods specified in the optional [GIFn] section. These options are stored in the MIDI file rather than in the Gif. This means that one Gif can be displayed in a variety of ways even though it is only stored once in the assembled mmgif. Here is a table showing each element of an event line and some example entries.

	EventID	PicID	Time	Show	Origin X	Origin Y	Dispose
Ex. 1	TIME1=	GIF1,	2.120,	NONE,	32,	64,	RMOV
Ex. 2	TIME2=	GIF3,	01:03:30,	SPOT,	-1,	-1,	KEEP
Ex. 3	TIME3=	GIF2,	03:65,	HZFN,	220,	0,	NONE

Example #1

TIME1 is the name of the event. It can be anything that's easy for you to keep track of. It shows GIF1 at 2 beats, 120 ticks into the MIDI file. NONE means that there are no special Show Parameters. 32, 64 means that the top left corner of the image will start 32 pixels across and 64 pixels down from the top left corner of the screen, overriding any Origin parameter specified in the [GIF1] section, if any. RMOV specifies the disposal method, overrriding any Dispose parameter specified in the [GIF1] section.

Example #2

GIF3 is displayed at 1 minute, 3.30 seconds into the MIDI file in a Spiral Out method. The -1 parameters mean that the image will be displayed at the location specified in the [GIF3] section, or at 0, 0 if there is no specification in the GIF3 section. See GIFn for more information. KEEP specifies that the image will be retained when the next image is displayed.

Example #3

GIF2 is displayed at 3.65 seconds into the MIDI file (when the minutes aren't specified they are assumed to be zero). It displays in a Horizontal Fan method at 220 pixels across and zero pixels down from the top left corner. NONE specifies that the background is erased. In other words, this image will be blanked out when the next image is displayed.

See also More MIDI Options.


More [MIDIn] Options

[MIDI1]
SongNumber=1	;This keyword is required
MeloPoly=Calculate	;This keyword specifies melodic polyphony. ;The default is to calculate, but you may ;override the calculation with a number ;indicating the polyphonic requirements.
PercPoly=5	;This (optional) keyword specifies percussive ;polyphony (calculated by default).
ChanMap=0110111001000000	;This keyword specifies the MIDI channel ;mapping (channel 1 is on the left). It is ;optional - the default is to compute it.
PCMPrep=66	;Specifies that a Wave prep event should be ;inserted into the MIDI file 66 ticks before the ;Play event is triggered.
Time3=GIF7,33.0
Time5=GIF3,0.0
Time9=GIF7,148.119
Time7=WAV0,148.0
Time8=WAV4,14.1

As you can see, the section name is derived from the MIDI file keyword. The SongNumber keyword is required. It allows grouping of multiple versions of a single MIDI file for different polyphony requirements (in this case all MIDI files in the group would have the same SongNumber).

To take the first example: the Time3 keyword is unique and specifies that the GIF7 image should be displayed at beat 33 (no ticks) of the MIDI file. The second example causes GIF3 to be displayed at beat 0 (the begining of the performance).  In the 3rd example GIF7 is again displayed, at beat 148 and 119 ticks.  The 4th plays WAV0 at beat 148, and the 5th plays WAV4 at beat 14 tick 1


Optional Script Sections

[GIFn]

[WAVn]

[GIFOut]

[Options]


[GIFOut]

If you specify this section in your script file you can add the following options:

CenterImages=1

GlobalPalette=GIFn

Screen=X, Y

Background=n


[GIFn]

If you specify this section (where n is the same number or identifier you assigned to a particular Gif) you can control the following: (These parameters are valid every time a Gif is displayed unless overridden in the [MIDIn] section).

Origin=X,Y

Dispose=NONE ; or KEEP, or RMOV

Palette=Global ; or Local

Transparent=n


[WAVn]

If you specify this section (where n is the same number or identifier you assigned to the particular wave file) you can control whether or not the wave file is compressed by EMBED.EXE when it stores it in the Gif.

Compress=MSADPCM ; or NONE

Wave files are compressed into MS-ADPCM format by default, in order to reduce file sizes. MMGIF will either decompress them in memory or send them to the Wave Mapper as-is, depending on its configration.

Of course, any Wave already compressed will not be compressed again.If you have trouble compressing a Wave, you may specify: Compress=NONE. However, this usage really should be used sparingly, especially on large wave files.


[Options]

If you specify this section, you can include the following option:

Duplicate=Fold ; or Repeat


Running Embed
Run EMBED.EXE

EMBED.EXE is a DOS program. There are several ways to approach running a DOS program from within Windows.

1. One way is to double-click the DOS icon that Windows sets up in the Main program group and then run the EMBED.EXE program from the DOS command line. If you put EMBED.EXE in a directory that is in your PATH statement, then you only have to type "embed" followed by the path and name of the script file. Otherwise you have to type the full path for EMBED.EXE when you run it. If you "cd" to the directory where your script file is located and EMBED.EXE is in a directory in your PATH, then you can type "embed myfab.scr". The finished "myfab.gif" will be in the directory you specified in your script, or in the same directory as the script if you did not specify a directory. When done, return to Windows by typing "exit" and pushing <enter>.

2. Another way is to associate the script files with EMBED.EXE in File Manager. (Highlight an .scr file in File Manager and choose associate from the File menu). Then, double clicking on the myfab.scr file in File Manager will start a DOS session and run EMBED.EXE, passing it the name myfab.scr. When EMBED.EXE is done it will automatically return to Windows. (If the file extension .scr is already associated with some other program that you want to leave associated with the other program, then you won't be able to do this).

3. A variation on the second way is to create a .pif file for EMBED.EXE using the PIF editor. You can specify settings that customize the DOS session, including specifying that it run in a window. Save the .pif file with an appropriate name (such as embed.pif). Then, instead of associating the .scr extension with EMBED.EXE, you associate it with the embed.pif (or whatever name you gave it). When you double-click on myfab.scr (or push enter when it's highlighted), EMBED.EXE runs in a window while you do something else, and when it's done, the window closes.

Whatever way you choose, when EMBED.EXE is done you  will have a Gif file with the file name you specifed in the [Files] GIFOut= section.

Thak you for using EMBED!


Show Parameters

Specifying one of these parameters on the event line in the [MIDIn] section will cause the GIF to be displayed in the particular transition style. Note that if a particular Gif has been defined with a Transparent= value in its [GIFn] section then it cannot be displayed with one of these Show Parameters.

The best thing to do is try all these and see what happens.

NONE	Nothing Special
TP2B	Top To Bottom Wipe
LF2R	Left To Right Wipe
BT2T	Bottom to Top Wipe
RT2L	Right to Left Wipe
UL2R	Upper Left to Lower Right Diagonal
LL2R	Lower Left to Upper Right Diagonal
UR2L	Upper Right to Lower Left Diagonal
LR2L	Lower Right to Upper Left Diagonal
HZCR	Horizontal Crush
VTCR	Vertical Crush
SPIN	Spiral In
SPOT	Spiral Out
RBLK	Random Blocks
HZFN	Horizontal Fan
VTFN	Vertical Fan


Origin

The Origin parameter specifies where to display the image. It's value is measured in Pixels from the upper left corner of the GIF logical screen. The X number is the number of pixels across from left to right. The Y number is the number of pixels down from top to bottom.


Dispose

The dispose method specifies how to dispose the GIF after displaying  (when another image is to be displayed).  It can be:

NONE - the background is erased by MM-GIF

KEEP - the image is retained

RMOV - the image is removed, uncovering the previous background. Note: this is a fairly expensive operation and should be used sparingly on small images.


Palette

Palette specifies which palette a GIF image should use. It can be either "Global" or "Local". If not specified, and the GIF has no local palette, the Global palette contained in the GIF is written as a Local palette in the MMGIF.


Transparent

Specifies the Color Table index of the "transparent" color. This causes pixels with this color to not be painted (shows through). Note that a GIF that uses a transparent color can never be displayed with a transition.


CenterImages

Forces centering (value=1) or forces non-centering (value=0) of images


GlobalPalette

The GlobalPalette spec. tells EMBED which image to use for the GIF global palette. There is one global palette for the entire MMGIF. Each image can either use the global palette, or supply  a "Local" Palette. If a local Palette is present in a GIF, it overrides the Global Palette.


Screen

A Screen parameter specifies screen dimensions in pixels (640, 480 for example) and overwrites any calculated dimensions.


Background

The "n" is a number that specifies the index into the global color table of the color to use for the background.


Duplicate

The Duplicate parameter specifies how to treat multiple GIFn= statements which point to the same GIF image file. If the value is "Repeat", the GIF is repeated multiple times in the MMGIF (probably not too useful). A value of "Fold" can be used with an already multiple GIF, to assign different Identifiers for the various internal images. The default is to "Fold".


; Annotated Script for TECHNO.GIF

; Jamie O'Connell 941126

[Options]

Duplicate=Fold

; The Duplicate parameter specifies how to treat multiple GIFn= statements

; which point to the same GIF image file. If the value is "Repeat", the

; GIF is repeated multiple times in the MMGIF (probably not too useful).

; A value of "Fold" can be used with an already multiple GIF, to assign

; different Identifiers for the various internal images.  The default is

; to "Fold".

;----------------------------------------------------------------------

; The [Files] Section Names The input bitmaps, the MIDI Files, the comment

; file, the output GIF, and the PCM (WAV) files.  All values

; are pathnames.

[Files]

; GIF keys are in the format, GIFn -- n is a unique number for the file

GIF1=C:\UGIF\GIFS\BALLS2.GIF

GIF2=C:\UGIF\GIFS\BALLs3.GIF

GIF3=C:\UGIF\VR\VROBOT.GIF

; Wave keys are in the format, WAVn -- n is the number of the file

WAV1=C:\WINDOWS\SND\BOING.WAV

WAV2=C:\WINDOWS\SND\LASER.WAV

; MIDI keys are in the format, MIDIn -- n is the number of the file

MIDI1=C:\ugif\assmb\ROUNDA.MID

MIDI2=C:\ugif\assmb\ROUNDBAS.MID

MIDI3=C:\somthing.mid

; 941025 -- "Comment=" may also be specified as "comments="

Comment=c:\ugif\assmb\TECHNO.TXT

; The output file key must always be named: "GIFOut=":

GIFOut=c:\ugif\mgifs\TECHNO.GIF

;------------------------------------------------------------------

; Each GIF image identified, may have a section describing various

; aspects of the image.

[GIFOut]

; The GIFOut section specifies info about the output stream

CenterImages=1

; Forces centering (value=1) or forces non-centering (value=0) of images

GlobalPalette=GIF1

; The GlobalPalette spec. tells EMBED which image to use for the

; GIF global palette.  There is one global palette for the entire

; MMGIF: each image can either use the global palette, or supply

; a "Local" Pallete.  If a local Palette is present in a GIF, it

; overrides the Global Palette.

Screen=230,460

; A Screen parameter specifies screen dimensions and overwrites any

; calculated dimensions.

Background=3

; This specifies the index into the global color table of the color to

; use for the background.

; ---------------------------------------------------------------------

[GIF1]

Origin=32,64

; The Origin parameter specifies where to display the image.  It's

; value is measured in Pixels from the upper left corner of the

; GIF logical screen. (see also: Origin in MIDI File events)

Dispose=RMOV

; The dispose method specifies how to dispose the GIF after displaying

; (when another image is to be displayed).  It can be:

; NONE - the background is erased by MM-GIF

; KEEP - the image is retained

; RSTB - the image is restored to the background color *** Not Implemented ***

; RMOV - the image is removed, uncovering the previous background.

;        Note: this is a fairly expensive operation and should be used

;              sparingly on small images.

;

; (see also: Dispose in MIDI File events)

Palette=Global

; Palette specifies which palette a GIF image should use.  It can be

; either "Global" or "Local".  If not specified, and the GIF has no

; local palette, the Global palette contained in the GIF is written

; as a Local palette in the MMGIF

Transparent=45

; Specifies the Color Table index of the "transparent" color.  This causes

; pixels with this color to not be painted (shows through)

[GIF2]

Palette=Local

Origin=32,64

Dispose=Keep

Transparent=3

; -----------------------------------------------------------------

; Each wave file may specify the type of compression to perform

; Currently only MSADPCM is supported.

[WAV2]

Compress=MSADPCM

; The compression parameter may also be "NONE", specifying that no

; compression is to be performed.

;--------------------------------------------------------------------

; The [MIDIn] section(s) describe when to play Image (GIF) and PCM (WAVE)

; events. The keys (TIMEn is used here) can be whatever you like so long

; as each is unique.  The value represents the image key, and the time for

; display in BEATS.TICKS.  The Song Number is required if there is more

; than one song.

;

; NOTES

; New Format for Image Events!:

;

; TIME1=GIF1,00:02:90,LFRT,32,64,RMOV

; EvID--PicID--Time---Show-Orign-Dispose

;

; Time can now be specified in MIN:SEC:FRAC. Minutes may be omitted.

; An origin value of "-1" will cause the default

; value to be used (the one specified in the GIFn section).

;

;  TIME2=GIF4,03:65,SPOT,-1,-1,KEEP

;

;  This would show GIF4 at 3.65 seconds with a spiral out method, and

;  retain the image after display.  It would use the origin specified

;  in the [GIF4] section (or 0,0 if that origin wasn't specified).

;

; When the "Show" "Origin" and "Dispose" methods are specified in an event

; they are stored inside the MIDI file, as opposed to part of the GIF itself.

; This allows a single image to be displayed in a variety of ways and places,

; even though it is stored only once in the resulting MMGIF.

;

; The "Origin" spec. and "Dispose" method in an event overides any method

; specified in the [GIFn] sections.

;

; SUPPORTED SHOW PARAMETERS

;

;   NONE    Nothing Special

;   TP2B    Top To Bottom Wipe

;   LF2R    Left To Right Wipe

;   BT2T    Bottom to Top Wipe

;   RT2L    Right to Left Wipe

;   UL2R    Upper Left to Lower Right Diagonal

;   LL2R    Lower Left to Upper Right Diagonal

;   UR2L    Upper Right to Lower Left Diagonal

;   LR2L    Lower Right to Upper Left Diagonal

;   HZCR    Horizontal Crush

;   VTCR    Vertical Crush

;   SPIN    Spiral In

;   SPOT    Spiral Out

;   RBLK    Random Blocks

;   HZFN    Horizontal Fan

;   VTFN    Vertical Fan

;

[MIDI1]

SongNumber=1

TIME1=GIF1,02.0

TIME9=WAV1,20.0

TIME3=GIF2,52.0,RBLK,-1,-1,NONE

TIME11=WAV2,52.0

TIME4=GIF3,84.0,SPIN,32,35,KEEP

TIME5=WAV2,84.0

TIME2=WAV1,88.0

TIME6=GIF2,116.0

TIME10=WAV2,116.0

TIME7=WAV1,148.0

TIME8=GIF1,148.0

TIME12=WAV2,155.0

[MIDI2]

SongNumber=1            ; note this is another rendition of above

MeloPoly=Calculate

TIME1=GIF1,02:00,UR2L,0,0,NONE

TIME9=WAV1,20:00

TIME3=GIF2,52.0

TIME11=WAV2,52.0

TIME4=GIF3,84.0,SPOT,120,24,KEEP

TIME5=WAV2,84.0

TIME2=WAV1,88.0

TIME6=GIF2,1:16:00,NONE,0,0,KEEP

TIME10=WAV2,1:16:00

TIME7=WAV1,148.0

TIME8=GIF1,148.0,RT2L

TIME12=WAV2,155.0

[MIDI3]

SongNumber=2        ; this is a separate song, which will be played after

                    ; the first one

TIME1=GIF1,10.0,RBLK,0,0

TIME2=GIF2,78.0,VTFN

TIME3=WAV1,20.0