💾 Archived View for gemini.spam.works › mirrors › textfiles › music › FORMATS › far-form.txt captured on 2022-06-12 at 16:06:26.
-=-=-=-=-=-=-
??????????????????????????????????????????????????????????????? ? ? ? ???? ?????? ?????? ?????? ?????? ?????? ?????? ? ?????? ? ???? ? ? ???? ? ? ? ? ? ? ? ? ? ???? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?????? ? ?????? ? ? ?????? ?????? ? ?????? ??????????????????????????????????????????????????????????????? ???????????? COMPOSER ? ? ? ??? ? ? ???? ??? ???? ? ???? ? ? ???? ? ? ???? ?? ? ???? ? ? ? ? ???? ? ???? ? ? ???? ? ? ? ? ? ? ? ? ? ? ???? ? ? 93! ??????????????????????????????????????????????????????????????? Format Specifications!! by Daniel Potter ----------------------------------------------------------------------------- Well, as you probably know, this is a pretty exciting program already. However, it would be nothing to a lot of people who would use it in their games, demos, etc, if I did not include the format specs. Besides that, I intend that this format, which although is CERTAINLY not the most efficient (basically a dump of the internals of the composer's editing mem), they will perhaps serve as a standard 16 channel format, with ease of use on the level of a MOD. Remember that this format is for EDITING purposes (storing EVERYTHING you're working on) so it may include information not completely neccessary. You can even see into the last moments of creation of the song through some of these variables :) You may process this info as you see fit, such as the scrolltext, which is not even supported in the current version of the composer. You could simply display it on the screen, or you could be creative, and have a scroller at the top of the screen while it's playing (that's the idea, for things like musicdisks). Farandole .FAR file (16 channel tracker) format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Header Note that with the way the file magic(s) are set up, you can see the name of the song by TYPEing it from DOS. For example, if the song name was "StarLit MoonRise" then you would see when you typed it out: FAR?StarLit MoonRise In case you're teeming over with all the anxiety of all the wasted information in the header, just think back to the last time you saw a tracker that saved every info about what you were doing last. Think of it as a project file in Borland C. len desc ----------------------------------------------------------------------------- 4 "FAR?" (file magic) 40 Song name 3 13,10,26 (bytes) (end of file chars) 2 Remaining length of header in bytes 1 Version number, major/minor upper/lower nybbles (0x10) 16 Channel ON/OFF map 1 Current editing octave 1 Current editing voice 1 Current editing row 1 Current editing pattern 1 Current editing order 1 Current editing sample 1 Current editing volume 1 Current top of screen display (top row visible) 1 Current editing area of the screen (0=sample,1=pattern,2=order) 1 Current tempo (default tempo) 16 Panning map, from 0-F for each channel 1 MarkTop (block) 1 MarkBot (block) 1 Grid granularity (default 4) 1 Edit Mode 2 Song text length (above) Song text of length STLen (field above) 256 Order bytes 1 Number of patterns stored in the file 1 Length of order used 1 LoopTo location 2*256 Length in bytes of each pattern - Determine number of rows stored for this pattern with this formula: Rows=((PatSize-2)/(16*4)) The -2 will be explained below. If the file is of a newer format than this one, then there might be extra stuff down here. The original header here will NEVER have anything new inserted before this space, to maintain a somewhat compatible file. The original header, described about will always be 869 bytes long+SongText len. So you should seek up HdLen-(869+STLen) bytes after reading the header in case there is more. Patterns len desc ---------------------------------------------------------------------------- 1 Break location in the pattern (length in rows) 1 Tempo for this pattern. ** THIS VALUE IS *NOT* USED ANYMORE!!! ** DO NOT SUPPORT IT!! Rows*16*4 Pattern data- len desc -------------------------------------------- 1 Note value - (Octave*12+Note)+1 or 0 for no note 1 Instrument/sample value 1 Volume - reversed byte. MSN is stored as LSN, LSN as MSN. This is for compatibility purposes. Basically, the lower nybble is the major volume adjust, upper nybble for minor adjust. 1 Effect, upper nybble is effect, lower nybble is parameter Current no provisions are made in this format to remove unused channels from the file. Sample Map This is an array of 0-7 (8 bytes) which is a set of 64 flags. Each flag corresponds to a sample, and these flags are packed into bytes. If the bit is set, the sample record IS stored in the file. Otherwise, it is not (and therefore should NOT be read). You can check to see if its present like this: if (SMap[SampleNumber/8] & (1<<(SampleNumber%8))) ReadSample(SampleNumber); Now that I think about it, I wonder why I didn't just store all the samples that are used up to the last used one? Who knows.. I was tired that night :) Samples/records All samples are stored just like they are in FSM format on disk. Each one is header-data-header-data, etc. Here is the header format: len desc --------------------------------------------------------------------------- 32 Name of sample 4 Length of sample (currently only support up to 64k samples) 1 Finetune (also not supported right now) 1 Volume ... yet another unsupported feature 4 Repeat Start 4 Repeat End - If the sample is looping, this should be set to the repeat end value. Otherwise, it should be set to the length of the sample. 1 Sample Type byte 1<<0 8/16 bit (8=0 16=1) 1 Looping mode byte 1<<3 On=looped, Off=not looped (len) Sample data in SIGNED format Info on playing- Here are how you generate the various FX: FEKT Hex# How! ---------------------------------------------------------------------------- Tempo 0xf? Notes per second is 32/Tempo. Pitch Adjust 0x1? Add ?*4 values to the value you're sending to the GUS. This is based on 16 channels. If you're using more or less, then you will have to calculate the pitch through this proportion: x ? -- = --- 16 chn which simplifies to chn*x=16*? or 16*? x=---- chn where ? is the amount, chn is the # of channels and x is the amount you add to the pitch value. Note that this effect and the one below are CUMULATIVE. Pitch Adjust 0x2? Do the same as above, except subtract from the val Fine Tempo up 0xe? Add this number to the current interrupt calls per second. Sorry, I could not figure out any other way to do it. My tempos are based on a system of 128/Tempo for finer control of other things, so this value would be added to that number instead of 32/x. So again, solve the proportion. Fine Tempo dn 0xd? Same as above, but subtract from tempo Fine Tempo cnl 0xe? or Cancel fine tempo; revert ints/sec to normal value 0xd? for current tempo Port to Note 0x3? Slide from current pitch to the pitch specified on the line where the command is issued. The parameter tells in how many rows the pitch should have gotten to the destination. You can use this equation to figure a standard increment: P ---------- intSpeed*? Where P is the pitch, intSpeed is the interrupt speed, and ? is the effect parameter. Of course an integer is not enough precision to store the increment most of the time. Retrigger 0x4? Repeat the current note ? times in this bar. If a drum is issued as the note, and the parameter is 0x42 then the drum should be played 2 times that bar, in evenly spaced intervals. Set VibDepth 0x5? Set vibrato depth. Actually, in Farandole this value is used to generate a new sin table; perhaps not the most efficient way to do it, but what the hell. The table is generated using this equation: f(x)=sin(2*pi*f*t)*a ..where a is the value for the effect and f=1. Vibrato note 0x6? Vibrato this note. Although it goes away if you stop using it, this effect when used repedeatly actually just tells FAR to continue the previous vibrato, which may span several notes depending on how large it is. Vibrato Sust 0x9? Is the same as above, but it doesn't stop until you reach a 0x90 command VolSld Up 0x7? Pushes the volume up one notch (0-F) VolSld Dn 0x8? Same as above, but it goes down Port To Vol 0xA? This uses the same method as the Port-To-Note command, but it acts on volume Note Offset 0xC? Pretend that you're doing an F-Retrigger command (0x4F). What you do is blank out all the notes in the retrig except the one specified here.