…Show last 516 lines
610714h 1 dword Length in bytes of the drum kit map (always
62 256)
630718h 1 dword Number of drum kit maps (always 1)
64071ch 1 dword File offset where MIDI patch maps start
650720h 1 dword Total length in bytes of all MIDI patch maps
66 (always number of MIDI patch maps multiplied
67 by 256)
680724h 1 dword Number of MIDI patch maps
690728h 1 dword File offset where drum note maps start
70072ch 1 dword Total length in bytes of all drum note maps
71 (always number of drum note maps multiplied by
72 256)
730730h 1 dword Number of drum note maps
740734h 1 dword File offset where instrument headers start
750738h 1 dword Total length in bytes of all instrument
76 headers (always number of instrument headers
77 multiplied by 23)
78073ch 1 dword Number of instrument headers
790740h 1 dword File offset where patch headers start
800744h 1 dword Total length in bytes of all patch headers
81 (always number of patch headers multiplied by
82 76)
830748h 1 dword Number of patch headers
84074ch 4 string Spacer*
850750h 1 dword File offset where array #1 starts
860754h 1 dword Total length in bytes of all "cubbyholes" in
87 array #1 (always number of "cubbyholes" in
88 array #1, multiplied by 2)
890758h 1 dword Number of "cubbyholes" in array #1
90075ch 1 dword File offset where array #1 starts
910760h 1 dword Total length in bytes of all "cubbyholes" in
92 array #2 (always number of "cubbyholes" in
93 array #2, multiplied by 2)
940764h 1 dword Number of "cubbyholes" in array #2
950768h 1 dword File offset where array #3 starts
96076ch 1 dword Total length in bytes of all "cubbyholes" in
97 array #3 (always number of "cubbyholes" in
98 array #3, multiplied by 2)
990770h 1 dword Number of "cubbyholes" in array #3
1000774h 1 dword File offset where sample headers start
1010778h 1 dword Total length in bytes of all sample headers
102 (always number of sample headers multiplied by
103 16)
104077ch 1 dword Number of sample headers
1050780h 4 string Spacer*
1060784h 1 dword File offset where sample waveform area begins
1070788h 1 dword Total length of sample waveform area in bytes
108
109
110
111Bank Map
112********
113The bank map assigns one MIDI patch map to each of the 128 MIDI banks. The
114bank map is 256 bytes long.
115
116OFFSET Count TYPE Description
1170000h 1 word MIDI patch map assigned to MIDI bank #0
1180002h 1 word MIDI patch map assigned to MIDI bank #1
1190004h 1 word MIDI patch map assigned to MIDI bank #2
1200006h 1 word MIDI patch map assigned to MIDI bank #3
121...
12200feh 1 word MIDI patch map assigned to MIDI bank #127
123
124
125
126Drum Kit Map
127************
128The drum kit map assigns one drum note map to each of the 128 MIDI drum kits.
129Each drum kit map is 256 bytes long.
130
131OFFSET Count TYPE Description
1320000h 1 word Drum note map assigned to MIDI drum kit #0
1330002h 1 word Drum note map assigned to MIDI drum kit #1
1340004h 1 word Drum note map assigned to MIDI drum kit #2
1350006h 1 word Drum note map assigned to MIDI drum kit #3
136...
13700feh 1 word Drum note map assigned to MIDI drum kit #127
138
139
140
141MIDI Patch Maps
142***************
143The MIDI patch maps assign one instrument to each of the 128 MIDI patches. Each
144MIDI patch map corresponds to one or more MIDI banks. One MIDI patch map can be
145used by more than one MIDI bank; in fact, all of the MIDI banks can use the
146same MIDI patch map if desired (which would allow a smaller filesize and save
147system RAM). The number of MIDI patch maps is set in the .ECW file header.
148Each MIDI patch map is 256 bytes long.
149
150OFFSET Count TYPE Description
1510000h 1 word Instrument assigned to MIDI patch #0 when
152 using a MIDI bank whose entry in the bank map
153 is equal to 0
1540002h 1 word Instrument assigned to MIDI patch #1, bank #0
1550004h 1 word Instrument assigned to MIDI patch #2, bank #0
1560006h 1 word Instrument assigned to MIDI patch #3, bank #0
157...
15800feh 1 word Instrument assigned to MIDI patch #4, bank #0
159
160
161If there are multiple MIDI patch maps (according to the file header), then
162the MIDI patch maps must follow one another immediately with no gaps between:
163
164OFFSET Count TYPE Description
1650100h 1 word Instrument assigned to MIDI patch #0 when
166 using a MIDI bank whose entry in the bank map
167 is equal to 1
168...
16901feh 1 word Instrument assigned to MIDI patch #127 when
170 using a MIDI bank whose entry in the bank map
171 is equal to 1
1720200h 1 word Instrument assigned to MIDI patch #0 when
173 using a MIDI bank whose entry in the bank map
174 is equal to 2
175etc.
176
177
178
179Drum Note Maps
180**************
181The drum note maps assign one instrument to each of the 128 MIDI drum notes.
182Each drum note map corresponds to one or more MIDI drum kits. One drum note map
183can be used by more than one drum kit; in fact, all of the drum kits can use
184the same drum note map if desired (which would allow a smaller filesize and
185save system RAM). The number of drum note maps is set in the .ECW file header.
186Each drum note map is 256 bytes long.
187
188OFFSET Count TYPE Description
1890000h 1 word Instrument assigned to MIDI drum note #0 when
190 using a drum kit whose entry in the drum kit
191 map is equal to 0
1920002h 1 word Instrument assigned to MIDI patch #1, drum kit
193 #0
1940004h 1 word Instrument assigned to MIDI patch #2, drum kit
195 #0
1960006h 1 word Instrument assigned to MIDI patch #3, drum kit
197 #0
198...
19900feh 1 word Instrument assigned to MIDI patch #4, drum kit
200 #0
201
202
203If there are multiple drum kit maps (according to the file header), then
204the drum kit maps must follow one another immediately with no gaps between:
205
206OFFSET Count TYPE Description
2070100h 1 word Instrument assigned to drum note #0 when
208 using a drum kit whose entry in the drum kit
209 map is equal to 1
210...
21101feh 1 word Instrument assigned to drum note #127 when
212 using a drum kit whose entry in the drum kit
213 map is equal to 1
2140200h 1 word Instrument assigned to drum note #0 when
215 using a drum kit whose entry in the drum kit
216 map is equal to 2
217etc.
218
219
220
221Instrument Headers
222******************
223The instrument headers assign one or more patches (that is, the INTERNAL
224patches used in the waveset, as opposed to MIDI patches, which are EXTERNAL) to
225each of the instruments. The instrument headers also affect certain properties
226of the instruments, such as tuning and pan. The number of instrument headers is
227set in the .ECW file header. Each instrument header is 23 bytes long.
228
229
230OFFSET Count TYPE Description
2310000h 1 char Determines the function of the remaining 22
232 bytes in the current instrument header
233
234
235When the byte at offset 0000h of an instrument header has a value of 2, the
236rest of the header is arranged as follows:
237
238OFFSET Count TYPE Description
2390001h 1 char When set to a value of 0, only the first
240 instrument sub-header (see below) is active.
241 When set to 2 or 3, only the second instrument
242 sub-header is active. When set to 1, both
243 instrument sub-headers are active. Any other
244 value makes neither sub-header active.
2450002h 1 char Seems to be the note number above which only
246 the second instrument sub-header is used;
247 otherwise, only the first instrument
248 sub-header is used. This is only the case when
249 the byte at offset 0001h is set to a value of
250 0.
251
252FIRST INSTRUMENT SUB-HEADER
2530003h 1 int Patch assigned to this instrument sub-header
2540005h 1 char Amplitude and envelope steepness (signed)
2550006h 1 char Pan (signed; 193 seems to be extreme left and
256 64 seems to be extreme right
2570007h 1 char Coarse tune (signed; measured in semitones)
2580008h 1 char Fine tune (signed; seems to be measured in
259 increments of 1/256 of a semitone)
2600009h 1 int Amount of delay before onset of notes (seems
261 to be measured in miliseconds)
262000bh 1 char Unknown. For tremolo strings and most if not
263 all drum kit percussion, has value of either
264 1 or 2.
265000ch 1 char If, in two or more instrument sub-headers,
266 the byte at offset 000ch has the same value,
267 only one of the patches played by those
268 instrument sub-headers can sound
269 simultaneously. Examples of instruments where
270 this is desirable include open/closed hi-hats
271 and open/closed triangles.
272
273SECOND INSTRUMENT SUB-HEADER (same as first)
274000dh 1 int Patch assigned to this instrument sub-header
275000fh 1 char Amplitude and envelope steepness (see above)
2760010h 1 char Pan
2770011h 1 char Coarse tune
2780012h 1 char Fine tune
2790013h 1 int Delay
2800015h 1 char Unknown. For side stick and acoustic snare,
281 has value of 1.
2820016h 1 char Probably same function as byte at offset
283 0000ch
284
285
286When the byte at offset 0000h of an instrument header has a value of 255, the
287rest of the header is arranged as follows:
288
289OFFSET Count TYPE Description
2900001h 1 char Unknown.
2910002h 1 int The number of another instrument header.
2920004h 1 char When a MIDI note is played with a note number
293 less than or equal to the value of this byte,
294 the instrument header specified by the value
295 at offset 0002h is used. (One can think of
296 these bytes as IF-THEN statements: IF the
297 note number <= the value at offset 0004h, GOTO
298 instrument header #X, where X is the value
299 stored at offset 0002h.)
3000005h 1 int The number of another instrument header.
3010007h 1 char When a MIDI note is played with a note number
302 less than or equal to the value of this byte,
303 the instrument header specified by the value
304 at offset 0005h is used.
3050008h 1 int The number of another instrument header.
306000ah 1 char When a MIDI note is played with a note number
307 less than or equal to the value of this byte,
308 the instrument header specified by the value
309 at offset 0008h is used.
310000bh 1 int The number of another instrument header.
311000dh 1 char When a MIDI note is played with a note number
312 less than or equal to the value of this byte,
313 the instrument header specified by the value
314 at offset 000bh is used.
315...
3160014h 1 int The number of another instrument header.
3170016h 1 char When a MIDI note is played with a note number
318 less than or equal to the value of this byte,
319 the instrument header specified by the value
320 at offset 0014h is used. (The value here MUST
321 be 127.)
322
323
324If there are multiple instrument headers (according to the file header), then
325the instrument headers must follow one another immediately with no gaps
326between.
327
328
329
330Patch Headers
331*************
332The patch headers (which refers to the INTERNAL patches used in the waveset, as
333opposed to MIDI patches, which are EXTERNAL) assign one "cubbyhole" in array #1
334to each patch. The patch headers also affect certain properties of the patches,
335such as the pitch and amplitude envelopes. The number of patch headers is set
336in the .ECW file header. Each patch header is 76 bytes long.
337
338OFFSET Count TYPE Description
3390000h 1 char Magnitude of pitch envelope (signed). Negative
340 values cause pitch to fall rather than rise.
341 A value of 0 effectively disables pitch
342 envelope.
3430001h 1 char MIDI controller 1 (modulation) sensitivity
3440002h 1 char Scale. A value of 0 denotes a 12-tones-per-
345 octave (i.e. chromatic) scale. A value of 1
346 causes this patch to ignore the MIDI note
347 number, so that every key on the keyboard is
348 the same pitch. A value of 2 denotes a 24-
349 tones-per-octave (i.e. quarter tone) scale.
3500003h 8 string Unknown
351000bh 1 int "Cubbyhole" in array #1 assigned to this patch
352000dh 1 char Changes tuning slightly
353000eh 2 string Unknown
3540010h 1 char Shifts the split points of the samples played
355 by this patch
3560011h 10 string Unknown
357001bh 1 char Causes pitch to change more rapidly upon
358 note release when pitch envelope is enabled.
359 May be the destination of the release phase
360 of the pitch envelope.
361001ch 1 char Delay before pitch envelope enters attack
362 phase
363001dh 1 char Initial pitch for pitch envelope**
364001eh 1 char Attack time for pitch envelope
365001fh 1 char Attack level for pitch envelope
3660020h 1 char Decay time for pitch envelope
3670021h 1 char Decay level for pitch envelope
3680022h 1 char Sustain time for pitch envelope
3690023h 1 char Sustain level for pitch envelope
3700024h 1 char Release time for pitch envelope
3710025h 1 char Influence of MIDI note velocity on magnitude
372 of pitch envelope
3730026h 1 char Unknown (may be proportional to attack time
374 of pitch envelope)
3750027h 1 char Influence of MIDI note number on pitch
376 envelope time (0=none; 127=huge)
3770028h 1 char When set to 0, the pitch envelope enters the
378 release phase when a MIDI note-off command
379 is received. When set to 1, pitch envelope
380 never enters the release phase.
3810029h 16 string Unknown
3820039h 1 char Possibly the destination of the release phase
383 of the amplitude envelope.
384003ah 1 string Unknown
385003bh 1 char Initial amplitude for amplitude envelope**
386003ch 1 char Attack time for amplitude envelope
387003dh 1 char Attack level for amplitude envelope
388003eh 1 char Decay time for amplitude envelope
389003fh 1 char Decay level for amplitude envelope
3900040h 1 char Sustain time for amplitude envelope
3910041h 1 char Sustain level for amplitude envelope
3920042h 1 char Release time for amplitude envelope
3930043h 1 char Influence of MIDI note velocity on magnitude
394 of amplitude envelope.
3950044h 1 char Unknown. Seems to affect amplitude attack.
3960045h 1 char Influence of MIDI note number on amplitude
397 envelope time.
3980046h 1 char When set to 0, the amplitude envelope enters
399 the release phase when a MIDI note-off command
400 is received. When set to 1, amplitude envelope
401 never enters the release phase.
4020047h 1 string Unknown
4030048h 1 char Pitch LFO (i.e. vibrato) depth. A value above
404 0 will add pitch modulation to a patch even
405 when MIDI controller 1 (modulation) is set to
406 0.
4070049h 1 char Pitch LFO (i.e. vibrato) speed.
408004ah 1 char Delay before pitch LFO (i.e. vibrato) reaches
409 full depth.
410004bh 1 string Unknown
411
412
413
414Array #1 "Cubbyholes"
415*********************
416The "cubbyholes" in array #1 assign one "cubbyhole" in array #2 to each
417"cubbyhole" in array #1. The number of "cubbyholes" in array #1 is set in the
418.ECW file header.
419
420
421"CUBBYHOLE" #0:
422OFFSET Count TYPE Description
4230000h 1 int "Cubbyhole" in array #2 assigned to this
424 "cubbyhole".
425
426If there are multiple "cubbyholes" (according to the file header), then the
427"cubbyholes" must follow one another immediately with no gaps between.
428
429"CUBBYHOLE" #1:
430OFFSET Count TYPE Description
4310002h 1 int "Cubbyhole" in array #2 assigned to this
432 "cubbyhole".
433"CUBBYHOLE" #2:
434OFFSET Count TYPE Description
4350004h 1 int "Cubbyhole" in array #2 assigned to this
436 "cubbyhole".
437etc.
438
439
440
441Array #2 "Cubbyholes"
442*********************
443The "cubbyholes" in array #2 assign one "cubbyhole" in array #3 to each
444"cubbyhole" in array #2. The number of "cubbyholes" in array #2 is set in the
445.ECW file header.
446
447
448"CUBBYHOLE" #0:
449OFFSET Count TYPE Description
4500000h 1 int "Cubbyhole" in array #3 assigned to this
451 "cubbyhole".
452
453If there are multiple "cubbyholes" (according to the file header), then the
454"cubbyholes" must follow one another immediately with no gaps between.
455
456"CUBBYHOLE" #1:
457OFFSET Count TYPE Description
4580002h 1 int "Cubbyhole" in array #3 assigned to this
459 "cubbyhole".
460"CUBBYHOLE" #2:
461OFFSET Count TYPE Description
4620004h 1 int "Cubbyhole" in array #3 assigned to this
463 "cubbyhole".
464etc.
465
466
467
468Array #3 "Cubbyholes"
469*********************
470The "cubbyholes" in array #2 assign one sample header to each "cubbyhole" in
471array #2. The number of "cubbyholes" in array #2 is set in the .ECW file
472header.
473
474
475"CUBBYHOLE" #0:
476OFFSET Count TYPE Description
4770000h 1 int Sample header assigned to this "cubbyhole".
478
479If there are multiple "cubbyholes" (according to the file header), then the
480"cubbyholes" must follow one another immediately with no gaps between.
481
482"CUBBYHOLE" #1:
483OFFSET Count TYPE Description
4840002h 1 int Sample header assigned to this "cubbyhole".
485"CUBBYHOLE" #2:
486OFFSET Count TYPE Description
4870004h 1 int Sample header assigned to this "cubbyhole".
488etc.
489
490
491
492Sample Headers
493**************
494The sample headers indicate where the individual samples are to be found in the
495sample waveform area. They also specify how those samples are looped (if at
496all), and any split points between one sample and another. The number of sample
497headers is set in the .ECW file header. Each sample header is 16 bytes long.
498
499OFFSET Count TYPE Description
5000000h 1 char If a MIDI note is received with a MIDI note
501 number above this value, the next sample
502 header is used instead. If the MIDI note
503 number is still greater than the byte value at
504 offset 0000h of the next sample header, the
505 sample header after the next sample header is
506 used and so on until the MIDI note number is
507 less than or equal to the byte value at offset
508 0000h.
5090001h 1 char Determines whether this sample is looped. May
510 also control other aspects of the sample. This
511 may be a bitmapped byte. A value of 0 disables
512 looping; values of 2, 3, 128, 144, 146, 148,
513 and 227 enable looping.
5140002h 1 char Fine tune (signed; seems to be in increments
515 of 1/256 of a semitone)
5160003h 1 char Coarse tune (signed; measured in semitones)
5170004h 1 dword Offset in sample waveform area where this
518 sample begins, multiplied by 8. Sample
519 waveform data can be shared by multiple sample
520 headers.
5210008h 1 dword Offset in sample waveform area of this
522 sample's loop point, multiplied by 8.
523000bh 1 dword Offset in sample waveform area of this
524 sample's end loop point, multiplied by 8
525 (fractional loop lengths permitted). This is
526 also where the sample ends when looping is
527 disabled. If a sample plays beyond the end of
528 the file, the operating system may lock up.
529
530If there are multiple sample headers, then the sample headers must follow one
531another immediately with no gaps between.
532
533
534
535Sample Waveform Area
536********************
537
538The sample waveform area stores the actual sample waveform data used by the
539sound card's MIDI synthesizer. The sample waveform data is stored using 16-bit,
540mono, signed samples, with LSB first (Intel byte order). Theoretically, the
541sample waveform area can be up to 512 megabytes in size (sample start/loop/end
542loop points in the sample headers are specified using dwords, which have a
543maximum value of 2^32 or 4294967296. Diving this value by 8 - the sample start/
544loop/end loop points are measured in 1/8 bytes - we get 536870912 bytes, or 512
545megabytes. Note that this limit is only theoretical, as the author has not
546actually tested it). The size of the sample waveform area is set in the .ECW
547file header.
548
549
550
551
552
553
554
555
556NOTES
557*****
558
559*A "spacer" is a series of 4 bytes of unknown purpose. The contents of a spacer
560are usually 01h, 00h, 01h, 00h; however, changing the contents does not seem to
561have any effect whatsoever. Only the size and placement of spacers matters;
562their contents do not.
563
564**Most if not all of the values dealing with the envelopes are unsigned and,
565confined to values between 0 and 127. Using values between 128 and 255
566typically generates unpredictable results.
567
568
569
570Contact Info
571************
572E-mail: earwaxcandle at hotmail.com (change " at " to "@")
573
574
575
576[Keywords: .ECW file format, .ECW format, waveset file format, waveset format]