1sfz2pat(1)                  General Commands Manual                 sfz2pat(1)
2
3
4

NAME

6       sz2pat - convert sample files into extended GUS patches
7

SYNOPSIS

9       sfz2pat filename.sfz
10

DESCRIPTION

12       This  documents  both the conversion program sfz2pat and the sfz loader
13       of the gt midi player.
14
15       The name of one or more  .wav  files  containing  samples  and  various
16       parameters  describing  the desired patch structure and how to play the
17       patch are given in a text  file  with  the  extension  .sfz.   Run  the
18       sfz2pat utility on filename.sfz, and, if all goes well, the result will
19       be a GUS patch file named filename.pat.
20
21       The same .sfz file can be loaded and played directly by gt.   Just  put
22       the  name  of  the  file into timidity.cfg or a file it sources, as you
23       would the name of a GUS .pat file.  Some features of  sfz  patches  can
24       only  be used when the patch is loaded directly, because they don't fit
25       into the GUS format.
26
27       The format of .sfz files is described  in  http://www.rgcaudio.com/sfz
28       format.htm.   See also http://www.drealm.org.uk/sfz/plj-sfz.html a more
29       lucid, less authoritative, account (from PL Jones).  An .sfz patch file
30       is  a  text  file  describing a single instrument, as implemented here.
31       (Though a whole set of drums can be characterized in a single .sfz file
32       for RGC Audio's player program, this implementation requires a separate
33       patch file for each drum.)
34
35       Typically, an instrument will have a number of different  samples,  and
36       which  sample  sounds  when  a  note  on that instrument is played will
37       depend on various circumstances -- the pitch of the note, how  loud  it
38       is,  and  so  on.  A sample thought of in relation to whether it sounds
39       when a note is played is referred to as a layer in the  RGC  documenta‐
40       tion,  but  I usually call it a sample.  Each individual sample (layer)
41       of an instrument is described in a region of the .sfz patch  file  (see
42       the <region> opcode below).
43
44       Only  a  very  tiny,  little, miniscule part of SFZ is currently inter‐
45       preted.  SFZ opcodes in the .sfz file that are not yet implemented  are
46       ignored.   Those  that  are  interpreted may or may not work exactly as
47       specified in the RGC Audio documentation (or as described here).
48
49       The .pat files that are created are GUS extended patch files,  so  they
50       can have velocity layers and can be in stereo.  If the source .wav file
51       is in stereo, the extended GUS patch derived from it will  also  be  in
52       stereo.   In  addition  to  .wav files, you can also use .aiff and .ogg
53       files for samples.  24-bit .wav files are ok, but for GUS patches, they
54       are  down-converted  to 16 bits, so the extra resolution is lost.  When
55       loading patches directly, all 24 bits are used.
56

OPCODES

58       Here are the opcodes currently intepreted.
59
60       <group>
61              Beginning of  global  opcodes  that  apply  thoughout  following
62              regions, until the next <group> or end of file.
63
64       <region>
65              Beginning  of  local  opcodes  that  apply  only  until the next
66              <region>, or <group> or end of file.
67
68       sample=filename
69              Gives path of a file containing sample data.
70
71       key=k  Note to play. k is a number 0-127 or an IPN note name (letter A-
72              G,  optional  #  or  b,  then octave from -1 to 9), and likewise
73              below for all values referred to as k.
74
75       hikey=k
76              Highest key of range.  Default is 60.
77
78       lokey=k
79              Lowest key of range.  Default is 60.
80
81       pitch_keycenter=k
82              Middle key of range.  Default is 60.
83
84       hivel=v
85              Highest velocity of range. v is a number 0-127.  Default is 127.
86
87       lovel=v
88              Highest velocity of range. v is a number 0-127.  Default is 0.
89
90       offset=n
91              Where patch starts in sample file, in samples from the beginning
92              of the file.  Default is 0.
93
94       end=n  Where patch ends in sample file, in samples.  Default is the end
95              of the file.
96
97       loop_start=n
98              Where the loop start point of patch is in sample file,  in  sam‐
99              ples.  Default is the offset of the sample.
100
101       loop_end=n
102              Where the loop end point of patch is in sample file, in samples.
103              Default is the end of the sample.
104
105       loop_mode=loop_sustain
106              Makes the sample loop while note is held.  Default is no loop.
107
108       volume=f
109              How loud to play the sample, in decibels.  Default is 0  decibel
110              change to what is found in the sample file.
111
112       amp_random=f
113              The  sample is amplified by a randomly selected amount from 0 to
114              f, given in decibels.  (This has no effect  when  creating  .pat
115              files.)
116
117       ampeg_release=f
118              Release time for the volume envelope, in seconds.
119
120       group=n
121              Defines the group the sample belongs to.
122
123       off_by=n
124              The  sample  will  stop  playing  when  a  note  from group n is
125              started.
126
127       trigger=first
128              The sample will be played only if no  other  note  in  the  same
129              group (and on the same channel) is playing.  (This has no effect
130              when creating .pat files.)
131
132       trigger=legato
133              The sample will be played only if another note in the same group
134              (and  on the same channel) is playing.  (This has no effect when
135              creating .pat files.)
136
137       hirand=f
138              The sample plays only when a randomly selected number between  0
139              and  1  is  less than f.  (This has no effect when creating .pat
140              files.)
141
142       lorand=f
143              The sample plays only when a randomly selected number between  0
144              and 1 is greater or equal to f.  (This has no effect when creat‐
145              ing .pat files.)
146
147       sw_hikey=k
148              Highest key in switch range.
149
150       sw_lokey=k
151              Lowest key in switch range.
152
153       sw_down=k
154              The sample will play only if note k  is  playing  (on  the  same
155              channel),  provided it falls within the switch range.  (This has
156              no effect when creating .pat files.)
157
158       sw_up=k
159              The sample will not play if note k is playing (on the same chan‐
160              nel),  provided  it falls within the switch range.  (This has no
161              effect when creating .pat files.)
162

BUGS

164       Probably, there are lots of bugs.  This is an experiment.
165

AUTHOR

167       Greg Lee <greg@ling.lll.hawaii.edu>
168
169
170
171                                  11 Oct 2004                       sfz2pat(1)
Impressum