Defence Force logotype

Contents of /public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_ym2mym.htm

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1533 - (show annotations)
Thu Feb 20 18:56:22 2020 UTC (3 months ago) by dbug
File MIME type: text/html
File size: 8681 byte(s)
OSDK 1.16
3 <HTML lang=fr dir=ltr>
4 <HEAD>
5 <meta name="robots" content="noindex">
6 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
7 <title>OSDK - Ym2Mym</title>
8 <link href="documentation.css" rel="stylesheet" type="text/css">
9 </HEAD>
11 <BODY>
13 <hr>
14 <A href="documentation.htm"><img src="arrow_back.gif"></A>
15 <img src="pics/osdk_logo_small.png">
16 <hr>
18 <h1>Ym2Mym</h1>
20 <p id=chapter>Description</p>
22 <div class="article">
23 The Oric computers are equiped with a AY-3-8912 sound chip.
24 <br>
25 <br>
26 This component can be found in multiple variants in many other systems such as the MSX, Amstrad CPC, Atari ST, some of the Sinclair Spectrum machines, among other.
27 <br>
28 <br>
29 It is an unfortunate fact that only very few Oric games had music back in the 80ies, but this can be fortunately fixed today thanks to the huge catalog of available musics on the other machines!
30 </div>
33 <p id=chapter>YM Files</p>
35 <div class="article">
36 The YM file format was originally designed by Arnaud Carré as a way to record Atari ST musics to make them replayable on a PC.
37 <br>
38 <br>
39 Technically a YM file is simply a register dump of the music: A program captured 50 times per second the content of the values sent to the YM chip.
40 With 14 registers to record, 50 times per second, it means that one second of music takes 700 bytes, so roughly 42kbytes per minute of music.
41 <br>
42 <br>
43 The chosen solution was to store the data sorted by register number, and then compress the whole file with the LHA compressor, which typically reduces the music files to less than 10kb even for very long musics.
44 <br>
45 <br>
46 Unfortunatelly this means that the music file must be entirelly decompressed before it can be used, which makes it unusable on 8bit machines. That's where the MYM format comes in.
47 </div>
50 <p id=chapter>MYM Files</p>
52 <div class="article">
53 The MYM files are basically YM files that have been uncompressed and recompressed in a way that allows for partial decompression over time. The efficiency is not as good, but at least it works.
54 <br>
55 <br>
56 Ym2MYm can be used to perform this conversion. It will work only on YM files that do not use special timer effects such as digidrums or sid.
57 </div>
59 <p id=chapter>Retuning</p>
61 <p>There are multiple machines using variants of the AY or YM soudchip, but they don't all use the same clock frequency: If you attempt at replaying a music made originally for another machine, and if it had a different clock, the resulting music will play at a different frequency than the original.
62 </p>
63 <p>
64 If you want to preserve the original sound of the music, it is necessary to retune the register values so they compensate for the difference in frequency. In YM2MYM this is simply achieved by declaring the frequency of the source machine (using -r) and the one of the target machine (using -t).
65 </p>
66 <p>
67 Originally the tool was made to play Atari ST musics on the Oric computers, so by default, the tool will assume a 2MHz source clock and 1MHz target clock, but you can specify any arbitrary value.
68 </p>
69 <p>
70 For reference, here is the known clock speed of a few machines:
71 </p>
72 <ul>
73 <li>Oric: 1MHz
74 <li>Amstrad CPC: 1MHz
75 <li>Sinclair Spectrum: 1.7734MHz
76 <li>Atari ST: 2MHz
77 </ul>
78 <p>
79 Due to the fact that the soundchip registers have a specific range of valid values (from 0 to 4095 for the notes, from 0 to 65535 for the enveloppe duration and from 0 to 31 for the noise frequency), it is possible that the retuning results in a value being out of range, which obviously will also impact how the music sounds.
80 </p>
81 <p>
82 When this happen, the tool will display some warning message indicating how often the truncation happened, and how bad the truncation was. If you are lucky you will not notice, but the tool will also indicate at which position the worse case happened, so you can eventually tweak the tune.
83 </p>
84 <p>
85 Example:
86 </p>
87 <pre>
88 Found some clamping issues when retuning "data\Great Giana Sisters 1 - title.ym"'s frequency from 1MHz to 1.7734MHz at 50fps:
89 - 'Channel A' overflowed 560 times (maximum was 5077 [over 4095] at time position 3'17" (frame 9858)
90 - 'Noise Channel' overflowed 5070 times (maximum was 54 [over 31] at time position 0'27" (frame 1376)
91 </pre>
92 <p>
93 As a final note, we'd like to point out that if technically speaking the AY and YM chips are register compatible and behave mostly the same, they are not identical chip, so in practice the same music can sound different depending on how it uses volume changes and enveloppes:
94 </p>
95 <ul>
96 <li>Note transitions seem smoother on the YM (thanks to the higher internal accuracy)
97 <li>The output from the AY is louder.
98 <li>The YM output is cleaner
99 </ul>
102 <p id=chapter>Utilisation</p>
104 <p>To transform a binary file as a texte file:
105 </p>
106 <pre>
107 %OSDK%\bin\Ym2Mym [switches] source.ym destination.mym [load adress] [header name]
108 </pre>
111 <p id=chapter>Switches</p>
113 <ul>
115 <li>-rn Reference Clock
116 <br>
117 <ul>
118 <li>-r1 => Oric, Amstrad CPC</li>
119 <li>-r1.773400 => ZX Spectrum</li>
120 <li>-r2 => Atari ST [default]</li>
121 <br>
122 </ul>
123 </li>
125 <li>-tn Target Clock
126 <ul>
127 <li>-t0 => Use Reference (no retune)</li>
128 <li>-t1.0 => Oric, Amstrad CPC [default]</li>
129 <li>-t1.773400 => ZX Spectrum</li>
130 <li>-t2.0 => Atari ST</li>
131 <br>
132 </ul>
133 </li>
135 <li>-vn Verbosity
136 <br>
137 Enables or disable the printing of informative messages.
138 <ul>
139 <li>-v0 => Silent [default]</li>
140 <li>-v1 => Shows information about what Ym2Mym is doing</li>
141 <br>
142 </ul>
143 </li>
145 <li>-hn Header
146 <br>
147 Adds a tape compatible header
148 <ul>
149 <li>-h0 => No tape header [default]</li>
150 <li>-h1 => Use tape header (requires a start address and a name)</li>
151 <br>
152 </ul>
153 </li>
155 <li>-mn Max size
156 <br>
157 The MYM replay routine generally is provided with a limited size for the music. Using this switch you can force Ym2Mym to refuse to convert a music and output an error message if the final compressed file gets larger than the specified number.
158 <ul>
159 <li>-m0 => No size limit [default]</li>
160 <li>-m1234 => Outputs an error if the exported size is too large</li>
161 <br>
162 </ul>
163 </li>
165 <li>-dxn Duration mode
166 <br>
167 You can use this flag to force the tool to truncate the music after a specific number of frames (there's 50 frames in a second). Use -dt to truncate, and -df to fade.
168 <ul>
169 <li>-dt1234 => Truncate at frame 1234</li>
170 <li>-df1234 => Fade out at frame 1234</li>
171 <br>
172 </ul>
173 </li>
174 </ul>
176 <br>
178 <p id=chapter>History</p>
180 <p id=dateentry>Version 1.8</p>
181 <ul>
182 <li>Modified the semantics of the -t flag (now means Target Frequency) and added a -r flag (Reference Frequency) which both accept decimal values (like 1.0, 2.0 or 1.77340)</li>
183 </ul>
185 <p id=dateentry>Version 1.7</p>
186 <ul>
187 <li>Added a -f flag that can be used to export the music to WAV format instead of MYM</li>
188 </ul>
191 <p id=dateentry>Version 1.6</p>
192 <ul>
193 <li>Added the -dt/-df flags to shorten musics</li>
194 </ul>
196 <p id=dateentry>Version 1.5</p>
197 <ul>
198 <li>The verbose mode (-v1) now display the embedded informations such as author name, song name, and extra comments</li>
199 <li>Interleave register format is now also supported</li>
200 </ul>
202 <p id=dateentry>Version 1.4</p>
203 <ul>
204 <li>Fixed a stupid bug of signed data added in version 1.2</li>
205 </ul>
207 <p id=dateentry>Version 1.3 (Broken!)</p>
208 <ul>
209 <li>Added a -m flag to check if the exported file fits a maximum size</li>
210 </ul>
212 <p id=dateentry>Version 1.2 (Broken!)</p>
213 <ul>
214 <li>Added a -v flag to enable/disable verbosity</li>
215 <li>Added a -h flag to add a tape compatible header</li>
216 </ul>
218 <p id=dateentry>Version 1.1</p>
219 <ul>
220 <li>The tool is now able to extract LHA compressed YM files directly, should make the process much easier :)</li>
221 </ul>
223 <p id=dateentry>Version 1.0</p>
224 <ul>
225 <li>Added support for retuning (Atari ST songs are at 2MHz, Amstrad ones at 1MHz)</li>
226 <li>Added rude support for YM6 format (also skips most of the header)</li>
227 </ul>
229 <p id=dateentry>Version 0.2</p>
230 <ul>
231 <li>Added a rude YM5 loader. Skips most of the header.</li>
232 </ul>
234 <p id=dateentry>Version 0.1</p>
235 <ul>
236 <li>First version by Marq/Lieves!Tuore & Fit (marq@iki.fi)</li>
237 </ul>
240 <hr>
241 <A href="documentation.htm"><img src="arrow_back.gif"></A>
242 <img src="pics/osdk_logo_small.png">
243 <hr>
246 </BODY>
247 </HTML>

  ViewVC Help
Powered by ViewVC 1.1.26