ETC EM61-0013E-V1

EM61000 IDE
V2.0
Tone-Waveform File (twf)
Procedure
Application Notes
ELAN MICROELECTRONICS CORP.
Doc. # AP-EM61-0013E-V1
First Edition
September 2002
Trademark Acknowledgments
IBM is a registered trademark and PS/2 is a trademark of IBM.
Microsoft, MS, MS-DOS, and Windows are registered trademarks of Microsoft Corporation.
Easy Sound is a registered trademark of ELAN Microelectronics Corp.
© 2001-2002 ELAN Microelectronics Corporation
All Rights Reserved
Printed in Taiwan, ROC, 09/2002
The contents of in this document is subject to change without notice. ELAN Microelectronics assumes no
responsibility for errors that may appear in this manual. ELAN Microelectronics makes no commitment to
update, or to keep current, the information contained in this manual. The software described in this manual is
furnished under a license or nondisclosure agreement, and may be used or copied only in accordance with the
terms of the agreement.
ELAN Microelectronics products are not intended for use in life support appliances, devices, or systems. Use of
ELAN Microelectronics in such applications are not supported and is prohibited.
NO PART OF THE EASY SOUND® AND OF THIS MANUAL MAY BE REPRODUCED OR
TRANSMITTED IN ANY FORM OR BY ANY MEANS WITHOUT THE EXPRESS WRITTEN
PERMISSION OF ELAN MICROELECTRONICS.
ELAN MICROELECTRONICS CORPORATION
ii
Headquarters:
Hong Kong Office:
No. 12, Innovation Road 1,
Science-based Industrial Park,
Hsinchu, Taiwan, R.O.C.
Rm. 1005B, 10/F Empire Centre
68 Mody Road, Tsimshatsui
Kowloon , HONG KONG
Tel: +886 3 5639977
Tel: +852 2838-8715
Fax: +886 3 5639966
http://www.emc.com.tw
Fax: +852 2838-0497
EM61IDE twf Operation Application Notes
Contents
PREFACE............................................................................................................................iv
1.0 Introduction to twf File ...............................................................................................1
1.1 Tools Required to Create a User-Defined twf File...............................................1
1.2 Correlation Between twf File and MIDI Playback...............................................1
1.3 Types of twf Files and its Location in MIDI ........................................................1
2.0 Playing the Default MIDI under EM61IDE ..............................................................2
2.1 Getting Your Tools Ready ....................................................................................2
2.2 Download and Play MIDI through EM61000 ICE ..............................................2
3.0 Create a User-Defined twf File that will Run with Your MIDI
under EM61IDE...........................................................................................................4
3.1 Processing 8-Bit Mono wav File with Sound Editor............................................4
3.1.1 Edit a Tone Type 8-Bit Mono wav File ....................................................4
3.1.2 Processing a Percussion Type 8-Bit Mono wav File................................8
3.2 Convert wav to twf File with Elan’s Wav2Twf Tool............................................8
3.2.1 Convert Tone Type wav into twf File.......................................................8
3.2.2 Convert Percussion Type wav into twf File ........................................... 11
3.3 Editing Existing Instrument Map (*.ist) and Envelope (*.env) Files.................12
3.3.1 Editing the Instrument Map File (*.ist)..................................................12
3.3.2 Editing Envelope File (*.env) ................................................................13
3.4 Compiling a MIDI File with EM61IDE Program ..............................................14
4.0 Create an Animated Song MIDI that will Run under EM61IDE .........................16
4.1 The Concept of Animated Songs Application....................................................16
4.2 Procedure on Creating Animated Song MIDI....................................................16
4.2.1 Edit a Raw Tone Type 8-Bit Mono wav File of an Animal Call............16
4.2.2 Translate Refined Animal Call wav to twf File
with Elan’s Wav2Twf Tool .....................................................................19
4.2.3 Re-define Instrument Map (*.ist) and Envelope (*.env) Files ...............20
4.2.4 Composing MIDI for Animal Song .......................................................22
4.2.5 Compiling a MIDI File with EM61IDE Program ..................................23
EM61IDE twf Operation Application Notes
iii
PREFACE
This Application Notes is applicable to EM61000 Series Integrated
Development Environment (EM61IDE) Version 2.0. This tool supports all
series of EM61000 chips (EM61001 ~ EM61500).
iv
EM61IDE twf Operation Application Notes
1.0 Introduction to twf File
1.1
Tools Required to Create a User-Defined twf File
The default twf file is automatically created when you install EM61000
Integrated Development Environment (EM61IDE). It is located under the
\instlib folder of your EM61IDE directory.
To create your own twf file, refer to Section 3 of this Application Note for the
details of the following two-stage procedures:
1. In the first stage, you need a sound-editing tool to edit a pre-recorded
tone and process it into a wav file.
2. In the second stage, you need the Elan WAV2TWF development tool
(provided through special arrangement) to process and convert your
wav file into twf format.
1.2
Correlation Between twf File and MIDI Playback
Generally, when MIDI is played on PC, the playback sound is sourced from the
tone library of sound card or from a PC connected audio device. Likewise,
When MIDI is played under EM61IDE tool; the playback sound is sourced
from a twf file located under the EM61IDE \instlib folder. The twf file may be
a default or user-defined file. Due to differences in sources, the MIDI playback
with the twf file will sound different from MIDI playback from other sources.
1.3
Types of twf Files and its Location in MIDI
twf file is categorized as either Tone or Percussion type. When creating a twf
file, the file type must be initially defined in order to have it properly assigned to
its appropriate MIDI channel (see Section 3.2). If the twf file you are creating
does not require any frequency adjustment during MIDI playback, define your
twf file as Percussion type. Otherwise, define it as Tone type.
Depending on how do you configure your Instrument Map file (*.ist) file (see
Section 4.2.3), Percussion type Twf files will be assigned to MIDI’s Channel 10
and Tone type to other channels. MIDI has up to 16 channels. Only one
channel, i.e., Channel 10 accommodates Percussion instruments. The
remaining 15 channels accommodate the Tone instruments.
The Channel 10 staff is made up of different pitch scale (high to low), each of
which is designated with a unique percussion instrument number (e.g., Pitch
Scale 48 is designated with Instrument number “48:hi_mid ton”; Pitch Scale 60,
with Instrument number “60:hide bongo,” etc.). Note that each pitch scale
number represents one unique percussion instrument.
EM61IDE twf Operation Application Notes
1
The Tone channels are represented by its pitch position on the staff. That is,
Pitch Scale 48 represents Pitch Position C3, Pitch Scale 60 is Pitch Position C4
(middle-C), etc. Tone (non-percussion) musical instruments are assigned to the
remaining 15 channels and each channel is assigned with unique musical
instrument.
2.0 Playing the Default MIDI under EM61IDE
The following sections will describe the procedure of playing the default MIDI
files under EM61IDE V2.0 with your PC connected to the EM61000 ICE.
2.1
Getting Your Tools Ready
1. Connect EM61000 ICE to your PC as shown in the figure below.
Refer to the EM61000 Series IDE User’s Guide for EM61000 ICE
installation and setup details.
To EMV60KB Key Board
EM61000 ICE
Printer Port
Printer
Port
Speaker
Figure 2.1 Connecting EM61000 ICE to Host Computer
2. Apply power to EM61000 ICE, then, start your EM61IDE program.
2.2
Download and Play MIDI through EM61000 ICE
NOTE
EM61IDE may not be able to support some MIDI formats. Please refer to EM61000 MIDI
Application Notes (issue March 2002) for details.
1. When the main window displays after EM61IDE is invoked, click on
the Play MIDI icon from the Tool Bar and browse for the default
MIDI you want to play from the resulting dialog box (see figure).
2
EM61IDE twf Operation Application Notes
Click the Play MIDI icon
to display the Select
MIDI file to play dialog
box.
Browse and select for
the MIDI file you wish to
play from the resulting
dialog box and click the
Open button.
Figure 2.2 Select MIDI file to play Dialog
2. The Select MIDI file to play dialog box will then appear. Browse
and select the MIDI file you wish to download and play with the
EM61000 ICE from the dialog box.
3. Click the Open button when your MIDI file has been located and
selected. The downloading of MIDI data to EM61000 ICE starts.
4. Observe EM61IDE down- loads
your MIDI data to EM61000
ICE. If downloading is
successful, the Debug tab of the
Output Window will display the
message“ICE download program
data OK!”
Output Window
5. If you have also installed the
EMV60KB Keyboard with your
EM61000 ICE, you can pause the
MIDI play- back by pressing the
keyboard K2 key. To continue
playing, press K1.
Figure 2.3 Output Window Showing
Successful MIDI Data
Download
6. To select and play another MIDI, click on the Exit Debugging from
the main window tool bar, and repeat procedure in Items 1 to 5 above.
EM61IDE twf Operation Application Notes
3
Exit Debugging icon
Figure 2.3 Exit Debugging Icon
3.0 Create a User-Defined twf File that will Run with
Your MIDI under EM61IDE
With an existing 8-bit mono wav file, you can create your own twf files that will
play MIDI on EM61000 ICE through the EM61IDE program. For tone type or
non-percussion wav file, the process involves –
1. Edit a raw 8-bit mono tone wav file with a sound editor (e.g., Sound
Forge, Cool Edit, etc.).
2. Translate refined tone wav file into twf file with Elan’s WAV2TWF
tool.
3. Define Instrument Map (*.ist) and Envelope (*.env) files with a text
editor.
4. Compose MIDI with CakeWalk tool or equivalent.
5. Compile, playback, and debug MIDI with EM61IDE system.
No sound editing is required for the percussion type mono wav file. It is
directly converted to twf file through the Wav2Twf tool.
NOTE
EM61000 Series IC does not support 16-bit wav files.
3.1
Processing 8-Bit Mono wav File with Sound Editor
3.1.1 Edit a Tone Type 8-Bit Mono wav File
1. With a sound-editing tool, run your pre-recorded 8-bit mono wav
(4 ~ 44 KHz) and observe its waveform. The example below (using
the Sound Forge as the sound-editing tool), shows the mono
waveform of a pitch c3 tone with 12 KHz sampling frequency.
4
EM61IDE twf Operation Application Notes
Sampling frequency
Figure 3.1 Sample Pitch c3, 12 KHz 8-bit Mono Waveform
2. From the displayed waveform, select and test-listen the loop area of
your choice. When satisfied, mark a sustaining loop (enclose with a
start and end points) within the selected loop for further processing.
NOTE
1. Magnify the selected loop for easy marking of a sustaining loop.
2. A narrower sustaining loop will save you more memory space.
In the sample figure below, the sustaining loop is marked between
start point 1378 and end point 1469.
Sustaining Loop
Waveform
magnified 1:4
Figure 3.2 Sample WAV Sustaining Loop Set at Positions
1378 & 1469 (Start & End Points Respectively)
EM61IDE twf Operation Application Notes
5
3. Then, convert the start (1378 in this example) to a new integer value
nearest to the multiple of 128. Hence, the new start point is now 1408
(1378/128 = 10.76 ¼11x128 = 1408).
As there is a 30 points (1408 − 1378 = 30) difference between the
previous and new start points position, increase the end point by 30
points accordingly. The new end point now becomes 1499 (1469 +
30).
To summarize, the new start point & end point position for the
example sustaining loop, are now at 1408 and 1499 respectively or as
indicated in the figure below.
Adjusted
Sustaining Loop
Figure 3.3 Sample WAV Sustaining Loop with Start & End Points Moved to New Position
after Conversion with the Multiple of 128 (1408 & 1499 Respectively)
6
EM61IDE twf Operation Application Notes
4. Delete all data after Point 1499 as illustrated below. Then save the
remaining data as *.wav file (sample is saved as 040_c3_ok.wav).
Final Sustaining Loop
with looping area
truncated
Waveform
magnified 1:2
Figure 3.4 Sample WAV with All Data after Sustaining Loop End Point Deleted
The above procedure may be simplified and summarized in the following
diagram:
.wav = A+B
Loop Start
Address = 128 x K
(where K = integer)
Loop End Address
C (Deleted Area)
A (Attack + Decay)
B (Sustaining Loop Area)
Figure 3.5 Simplified Diagram of the Final Result of the Edited Sample wav
EM61IDE twf Operation Application Notes
7
3.1.2 Processing a Percussion Type 8-Bit Mono wav File
No loop setting is required for the percussion type mono wav file. It is directly
converted to twf file through the Wav2Twf tool. It should be defined in the
Instrument Map file (*.ist) as assigned to MIDI’s Channel 10.
1. With your sound editor, record an 8-bit mono wav (4 ~ 44 KHz)
percussion. The end point should be 00.
2. Then save it as wav file.
3.2
Convert wav to twf File with Elan’s Wav2Twf Tool
After saving your refined wav file with the sound editor, you are now ready to
convert the file into twf format that your EM61IDE can read and use as MIDI
playback.
NOTE
Wav2Twf should be installed under the same folder where the EM61IDE execution file is
located.
3.2.1 Convert Tone Type wav into twf File
1. Open Wav2Twf by clicking on the Wav2Twf.exe. The following
main window will then display.
Select File button
Figure 3.6 Wav2Twf Default Main Window
Click on Select file button. From the dialog box that displays, select
the edited tone wav file (040_c3_ok.wav in this example) you wish to
convert into twf file and click Open button.
8
EM61IDE twf Operation Application Notes
Figure 3.7 Wav2Twf Select wav File Dialog Box
2. Define parameters of the tone wav file in the main window. Referring
to the sample wav in Section 3.1.1, the parameters should look like
this:
Save file button
Figure 3.8 Define Tone wav File Parameters
Use Tab key to move between fields. Ignore Begin note & End note
fields.
EM61IDE twf Operation Application Notes
9
Where:
Base note
is the note from c0 to c8 that represents the record pitch
frequency as derived from middle C (=C4, =60).
Delta value
is the value from −999 to 999 that stands for the N
value in the equation below. It represents the deviation
of the playback pitch frequency and sampling rate
from their respective recording state. It is calculated
using the equation –
B = (1 ± N/1000) x A
Where: B is the default value of playback pitch
frequency deviation provided by the
Wav2Twf program.
N is the Delta value or the user-defined
playback pitch frequency deviation.
A is the standard playback sampling rate
based on the user-defined record
sampling rate.
If N or Delta value is equal 0 (as used in the example),
the pitch frequency and sampling rate playback status
will remain unchanged from its record state.
Sync
is the synchronization (or otherwise) of the envelope
dynamics (volume change) and the sustaining loop
start point. Generally, the value is 0 (sync). As a
rule-of-thumb, if the sustaining loop area (see Figure
3.5) exceeds 1000 points, initially set the Sync value to
1 (no sync). But if the play result is unsatisfactory, try
switching the Sync value to 0 (sync) and compare
results.
3. Click the Save file button when you are done and a twf file (*.wav)
will be created and stored in the folder you have selected. At the same
time, properties of the newly converted twf file are also displayed for
your reference.
10
EM61IDE twf Operation Application Notes
Click to view properties
of an existing twf files
Loop Length and
Loop Type
Figure 3.9 Currently Saved Tone wav File Properties
Note that the displayed loop type uses 128 as the midpoint between
long and short loop types. When loop length is below 128, loop type
is considered short. Likewise, when loop length is above 128, loop
type is considered long. Hence, the loop type displayed in the above
example is short loop as the loop length is 92.
To view properties of existing twf files, click View Twf Header
button. Then from its pertinent folder, select the file you want its
properties displayed.
3.2.2 Convert Percussion Type wav into twf File
Figure 3.10 Define Percussion wav File Parameters
EM61IDE twf Operation Application Notes
1. Open Wav2Twf by clicking on
the Wav2Twf.exe. When the
Wav2Twf main window
displays, click on Select file
button to browse and select a
modified percussion wav file
from folder.
2. Define parameters of the
percussion wav file in the main
window. The parameters should
look as shown in the text boxes
of the above figure. Type, Loop
start address, Delta value, and
Sync are defined as 0. Ignore the
other text boxes.
Use Tab key to move between
text boxes.
11
3. Click the Save file button when you are done and a twf file will be
created and stored in your assigned folder. At the same time,
properties of the newly converted percussion twf file are displayed in
the right window for your reference.
Figure 3.11 Currently Saved Percussion wav File Properties
3.3
Editing Existing Instrument Map (*.ist) and Envelope (*.env)
Files
Instrument Map (*.ist) and Envelope (*.env) files are automatically generated
when you create a new MIDI project with the EM61IDE program. These files
bear the same filenames as that of your project and are located under the exe
folder of the EM61IDE directory. You can always modify these files to suite
the requirements of your project.
3.3.1 Editing the Instrument Map File (*.ist)
Using a text editor, edit the Instrument file to re-define settings of the following
parameters to suite your playing MIDI:
Path
Rising & falling frequency within pitch range
Normal and detune frequency playback
Volume
Corresponding Envelope (*.env) file
12
EM61IDE twf Operation Application Notes
[General]
title=EM61000 Instrument File
version=2.0
$WORKDIR=d:\Work61\emc61\61002mBox_WORLD\user_TWF
[Instrument List]
tone group=1
tone group 0=T040
percussion group=0
[T040]
name=TEST
scale=g2-B7
G2-B7 =T040_C3 %NORMAL %91
[Template List]
t040_C3=% USER
$WORKDIR\040_c3_OK.twf %1
Figure 3.12 A Typical Example of an Instrument Map (*.ist) File
See Section 4.2.3 for an example of an actual *.ist file editing.
3.3.2 Editing Envelope File (*.env)
You can edit the Envelope file to add more user-defined envelope parameters (a
separate Application Note on this subject will be issued in the near future).
[General]
title=EM61000 Envelope Data File
version = 2.0
Total envelope number = 2
[Envelope 0]
AD group =1
AD group 0 =120 120 120 120
Sustain main = 4 3 55
Sustain vibration = 0 0 0
Release = 1
-1
[Envelope 1]
AD group = 1
AD group 0 = 107 107 -1
Sustain main = 0 0 0
Sustain vibration = 0 0 0
Release = 1
Figure 3.13 A Typical Example of an Envelope (*.env) File
EM61IDE twf Operation Application Notes
13
3.4
Compiling a MIDI File with EM61IDE Program
IMPORTANT!
1.
When writing a piece of MIDI, it should be written in musical scale format and include all
the defined notation range. Be sure that the specified MIDI instrument patch numbers
are properly defined for the correct tone you want to generate.
The MIDI file should also be a valid format (i.e., it must be compatible with the General
Midi (GM) specification and saved as “MIDI Format 1” type file), and that it is assigned
with a valid filename suffix (s*.mid or *.mit).
2.
Before you start to compile, replace the existing MIDI file in the project you are about to
open with your own MIDI file through a file manager. This file is located in the EM61IDE
folder. You may make your MIDI file filename either identical or different with that of the
exiting one.
If different filename is used, be sure to ask your programmer to properly reflect the new
filename in the project’s ASM file .
3.
If you have the Instrument Map (*.ist) and Envelop (*.env) files separately prepared,
(not edited from the existing project) copy your files into the project folder and delete
the existing ones. Make sure your files bear the same filenames as that of the project.
4.
Make sure you have your EM61000 ICE installed and connected to your PC in order to
immediately play and listen to your project right after compilation.
1. With the EM61IDE Program running, open an existing play MIDI
project by clicking on the Project menu, and then click the Insert
Files to Project… command. Browse for your MIDI file from the
resulting dialog and click OK to insert.
2. From the Project menu, click Rebuild All command.
Click “Insert Files to
Project” to insert your
MIDI file into Project
“Rebuild All” menu
command and tool bar icon
Figure 3.14 “Rebuild All” Command
14
EM61IDE twf Operation Application Notes
3. From the Debug menu, click
Go (F5) command to start
compilation.
“Go” menu command and
tool bar icon
5.2
Figure 3.15 “Go” Command
4. When the compilation is
successfully completed, the
Build tab of the Output Window
will display “Voice compiled
successfully” message.
Figure 3.14 Output Window Showing
Successful MIDI Compilation
At the same time, a Vlg window will also display the detailed voice
ROM data and memory sizes of the various files involved in the
compilation. Total size of the files is also provided as well as the
remaining capacity of the EM61 series chip involved.
Summary of accumulated
memory space
Figure 3.16 Vlg Window Showing Voice ROM Data
5. You can now start listening to the twf file in your MIDI file and re-edit
twf and/or MIDI. file if you are not satisfied with the result.
EM61IDE twf Operation Application Notes
15
4.0 Create an Animated Song MIDI that will Run
under EM61IDE
4.1
The Concept of Animated Songs Application
Utilizing the calling sound of animals (i.e., dog’s bark, cat’s meow, bird’s
chirping, etc.) as sound source, transform it into pitched tones, and visualize it
as unique musical instrument to create musical voices. That is, a recorded bark
of a dog can be transformed into two or three octaves. The created twf file will
be of tone type as the resulting sound effects during playback will be multi-tone
with variable frequencies.
4.2
Procedure on Creating Animated Song MIDI
The procedure involved (as summarized below) is somewhat similar with the
processing of tone type musical instrument but with some uniqueness as
described in the following sections.
1. Edit raw tone wav file with a sound editor (e.g., Sound Forge, Cool
Edit, etc.).
2. Translate refined tone wav file into twf file with Elan’s WAV2TWF
tool.
3. Re-define Instrument Map (*.ist) and Envelope (*.env) files of an
existing project with a text editor.
4. Compose MIDI with CakeWalk tool or equivalent.
5. Compile and playback MIDI with EM61IDE system.
4.2.1 Edit a Raw Tone Type 8-Bit Mono wav File of an Animal Call
Waveform
total
length
1. With a sound-editing tool, run your pre-recorded 8-bit mono wav
animal call (4 ~ 44
KHz) and observe its
waveform. The
example at left (using
the Sound Forge sound
editor), shows the
mono waveform of a
dog bark at 14 KHz
sampling frequency
with a total length of
3946 points (located at
positions 0 to 3945).
Sampling
frequency
Figure 4.1 Sample 14 KHz 8-bit Mono Waveform of a Dog Bark
16
EM61IDE twf Operation Application Notes
2. Animal call has an irregular frequency. It has no uniform loop area
where you can select and obtain a Sustaining Loop as required for
processing a tone type wav file. A dummy Sustaining Loop must
therefore, be created to fulfill the program requirement. Otherwise,
the program will not process the raw wav file correctly.
To create a dummy Sustaining Loop, add one full “silence” loop at the
end of the existing waveform or between Position 3946 (loop start
point) and Position 3947 (loop end point).
NOTE
The narrower the sustaining loop is, the less memory space it will occupy
Original Dummy “Silence”
Sustaining Loop
Figure 4.2 Sample Dummy wav Dummy Sustaining Loop Added at Positions 3946
and 3947
3. Then, adjust the start point (3946 in this example) to a new positive
integer value nearest to the multiple of 128. Hence, the new loop start
point is now at Position 3968 (3946/128 = 30.83 ¼31x128 = 3968).
As there is a 22 points (3968 − 3946) difference between the original
and new start positions, increase the loop end position by 22 points
accordingly. This will move the new loop end point to Position 3969
(3947 + 22).
To summarize, the new start & end positions for the example dummy
“silence” sustaining loop, are now at Positions 3968 and 3969
respectively or as indicated in the following figure.
EM61IDE twf Operation Application Notes
17
Adjusted Dummy
“Silence”
Sustaining Loop
Figure 4.3 Sample wav Sustaining Loop with Start & End Points Moved to New Positions
after Adjustment with the Multiple of 128 (Positions 3968 & 3969 Respectively)
4. In normal instrument tone type processing, all data to the right or after
loop end position are deleted. Then the remaining data is saved as
*.wav file.
In the case of tone type animal call (or dog bark in this example), data
do not exist after the loop end position. Hence, the waveform is
directly save as *.wav file after the dummy “silence” loop start and
end points are adjusted (sample is saved as dog_0.wav).
Final dog bark
waveform total
length
Saving file status
Figure 4.4 Sample Dog Bark wav Being Saved After Editing
18
EM61IDE twf Operation Application Notes
4.2.2 Translate Refined Animal Call wav to twf File with Elan’s Wav2Twf Tool
After saving your refined wav file with the sound editor, you are now ready to
convert the file into twf format that your EM61IDE can read and use as MIDI
playback.
1. Open your Wav2Twf program and select the refined animal call wav
file (dog_0.wav for the dog bark in this example) as described in
Section 3.2.1.
NOTE
Wav2Twf should be installed under the same folder where the EM61IDE
execution file is located.
2. Enter the parameters of the wave file in the text boxes provided in the
main widow (see Section 3.2.1 for the descriptions of some of the
items).
Although dog bark has a variable frequency and is different from
common musical instruments, you still need to provide a tone type
value for the Base note (C0~C8) parameter. The “c4” value provided
in the example below is to set the “c4” in your MIDI composition to
play the original waveform frequency (dog bark of 14000 Hz. in this
example). You can also assign other pitch, e.g., “g4,” “e4,” etc., to
represent the MIDI setting for playing the original waveform
frequency (see Section 4.2.4 on MIDI composition).
Select File button
This value represents
the MIDI setting for
playing the original
waveform frequency
Save File button
Figure 4.5 Defining Animal Call Tone wav File Parameters
EM61IDE twf Operation Application Notes
19
3. Click the Save file button when you are done and a twf file will be
created (DOG_C4.twf in the example) and stored in the folder you
have selected. At the same time, properties of the newly converted twf
file are displayed for your reference.
Click to view properties
of an existing twf files
Loop Type and
Loop Length
Figure 4.6 Currently Saved Tone wav File Properties
Note that the displayed loop type uses 128 as the midpoint between
long and short loop types. When loop length is exactly 128 or below,
loop type is considered as short. Likewise, when loop length is above
128, loop type is considered long. Hence, the loop type displayed in
the above example is short loop as the loop length is 2.
To view properties of existing twf files, click View Twf Header
button. Then from its pertinent folder, select the file you want to have
its properties displayed.
4.2.3 Re-define Instrument Map (*.ist) and Envelope (*.env) Files
1. Edit the Default Instrument Map File (*.ist) to Set Instrument Patch
for Animal Call
Using a text editor, open the Instrument Map file (*.ist) and look under the
Section [Intrument List] where the tone and percussion group types twf library
for EM61IDE are located. As the animal call file (dog bark DOG_C4.twf in this
example) is a tone type file, you may edit and assign the animal call patch in the
tone group portion (see figure below).
20
EM61IDE twf Operation Application Notes
a) From among the specified MIDI instruments patch numbers (Txxx), look
for an undefined instrument number (from 0 to 127) and define one such
number as your “dog bark instrument patch number” (T120 under “tone
group 11” is used in this example or as illustrated in the following figure).
Define an unused number
as your “dog bark
instrument patch number”
T120
Figure 4.7 Instrument Map (*.ist) File Showing the Top (Tone Group)
Portion of the [Instrument List] Section
b) Then go down below the [Intrument List] section and into the sub-sections
of individual instrument definitions. Look for the existing instrument
number that precedes the one you have added (i.e., [T117] in this example)
and insert the “dog bark instrument patch number” detailed definition
(name, scale, etc.) next to it as shown in the figure below.
Detailed definition of the
“dog bark instrument patch
number”
Figure 4.8 Instrument Map (*.ist) File Showing Part of the Individual Tone
Group Instrument Patch Number Detailed Definitions
EM61IDE twf Operation Application Notes
21
c) In Section [Template List] of the *.ist file, look for the existing instrument
number that precedes the one you have added (i.e., [T117] in this example)
and insert the “dog bark instrument patch number,” the path to your twf file,
and add the envelope parameter next to it as illustrated below.
Insert “dog bark instrument
patch number,” path to your
twf file, and add the
envelope parameter”
Figure 4.9
Instrument Map (*.ist) File Showing the [Template List]
Section
2. Editing the Default Envelope File (*.env)
Edit the contents of the default Envelope file to meet your requirements. You
can edit the Envelope file to add more user-defined envelope parameters.
4.2.4 Composing MIDI for Animal Song
When composing MIDI for animal song, keep in mind that:
1. The corresponding instrument name for the instrument number
defined in the Instrument Map (*.ist) file for the animal call (e.g.,
T120 for DOG_C4.twf) must be correctly reflected under the Patch
column of your MIDI editor (Cakewalk is used for this demo).
According to GM Tone (0~127) Table, the sample Patch 120 is Guitar
Fret Noise, hence, the instrument name must be entered under the
Patch column (see following figure). Its corresponding MIDI Port
should be defined as General MIDI.
Figure 4.10 Defining Patch and MIDI Port Data in the Cakewalk MIDI Editor
22
EM61IDE twf Operation Application Notes
2. When it becomes necessary to exceed the MIDI pitch scale defined in
the Instrument Map (*.ist) file (c3~d6 in the example), you can do one
of the following:
Revise the Instrument Map (*.ist) entry on pitch scale. For
example, if you defined MIDI to play the Pitch e6 but your current
*.ist setting is “scale=c3-d6,” e6 will be soundless. So you need to
revise the scale setting as “scale=c3-e6.”
Perform transposition with your MIDI settings.
4.2.5 Compiling a MIDI File with EM61IDE Program
Before you start to compile your MIDI file with the user-defined twf, *.ist, and
*.env files, be sure you have your EM61000 ICE installed and connected to
your PC in order to immediately debug your project right after compilation.
Follow the procedures stated in Section 3.4 of this publication.
EM61IDE twf Operation Application Notes
23