ff3:ff3us:tutorial:music:brr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ff3:ff3us:tutorial:music:brr [2018/10/20 06:28]
madsiur
ff3:ff3us:tutorial:music:brr [2019/02/12 11:26] (current)
Line 13: Line 13:
 ==== 3. Changing the Code ==== ==== 3. Changing the Code ====
  
-Since each sample has data attached to it, we need to move this data first to make some room for the new sample data. What need to be moved is loop start positions, instrument pitch  multipliers and ADSR data. The pointers to the BRR data do not need to be relocated, for the simple reason that we will free the space right after them, thus leaving room to add more.+Since each sample has data attached to it, we need to move this data first to make some room for the new sample data. What need to be moved is loop start positions, pitch  multipliers and ADSR data. The pointers to the BRR data do not need to be relocated, for the simple reason that we will free the space right after them, thus leaving room to add more.
  
 {{ff3:ff3us:tutorial:music:brr:1.png}} {{ff3:ff3us:tutorial:music:brr:1.png}}
  
-We will put the loop starting positions at $F20000, the pitch mutipliers at $F20200 and finally the ADSR data at $F40000. This leave enough room for the maximum of 256 samples. +We will put the loop starting positions at $F20000, the pitch mutipliers at $F20200 and finally the ADSR data at $F20400. This leave enough room for the maximum of 256 samples. 
  
-There are 3 ASM instruction to modify, more precisely the offset of these instruction carry. Below is the original and modified code. Open HxD and press Ctrl+G, that will open a window. Type 05041C and press "//Ok//". You are not at $C5041C. You need to enter 0000F2 ($F20000 inverted). We do not touch the 1st byte of the instruction, only bytes 2,3,4. Repeat a similar process for $C5049C and $C504DE.+There are 3 ASM instruction to modify, more precisely the offset that these instruction carry. Below is the original and modified code. Open HxD and press Ctrl+G, that will open a window. Type 05041C and press "//Ok//". You are not at $C5041C. You need to enter 0000F2 ($F20000 inverted). We do not touch the 1st byte of the instruction, only bytes 2,3,4. Repeat a similar process for $C5049C and $C504DE.
  
 **Original code**\\ **Original code**\\
Line 27: Line 27:
 {{ff3:ff3us:tutorial:music:brr:3.png}} {{ff3:ff3us:tutorial:music:brr:3.png}}
  
-==== 3. Moving the Data ====+==== 4. Moving the Data ====
  
 Let's move first the loop starting positions. Select the data from $C53D1C to $C53D99 as shown on the left below and press Ctrl+C. Press Ctrl+G and enter 320000 ($F20000 in HiROM offset).  Right click and press "//paste write//". The result should be like the right screenshot: Let's move first the loop starting positions. Select the data from $C53D1C to $C53D99 as shown on the left below and press Ctrl+C. Press Ctrl+G and enter 320000 ($F20000 in HiROM offset).  Right click and press "//paste write//". The result should be like the right screenshot:
Line 42: Line 42:
  
  
-==== 4. Adding the new sample data ====+==== 5. Adding the new sample data ====
  
 Now we will add the data for the new sample. For more info on these 3 sample data, refer to the last 3 sections of this tutorial. Open the FF5.txt file in the sample archive and look at the 1st line. You'll see the three values that we need to add. Simply append 8C0A to the loop starting positions, append C000 to the pitch multipliers and append FFE0 to the ADSR data. The 3 following screenshots show this: Now we will add the data for the new sample. For more info on these 3 sample data, refer to the last 3 sections of this tutorial. Open the FF5.txt file in the sample archive and look at the 1st line. You'll see the three values that we need to add. Simply append 8C0A to the loop starting positions, append C000 to the pitch multipliers and append FFE0 to the ADSR data. The 3 following screenshots show this:
Line 56: Line 56:
  
  
-==== 5. Importing the Sample ====+==== 6. Importing the Sample ====
  
 We need after this to import the actual sample. Open //01_bass_drum.brr// with HxD, select all (Ctrl+A), copy (Ctrl+C) then "//paste write//" at $F20600. The two screenshots below show the beginning and the end of the sample: We need after this to import the actual sample. Open //01_bass_drum.brr// with HxD, select all (Ctrl+A), copy (Ctrl+C) then "//paste write//" at $F20600. The two screenshots below show the beginning and the end of the sample:
Line 66: Line 66:
 {{ff3:ff3us:tutorial:music:brr:16.png}} {{ff3:ff3us:tutorial:music:brr:16.png}}
  
-Finally we will add our new BRR pointer. Go at $C53D1C and add 00 06 F2. Note that in the screenshot below I replaced all the (now) useless sample data with FF. You can now use your new sample ($30) in the instrument data of a song (32 bytes each starting at $C53F95).+Finally we will add our new BRR pointer. Go at $C53D1C and add 00 06 F2 ($F20600 inverted). Note that in the screenshot below I replaced all the (now) useless sample data with FF. You can now use your new sample ($40) in the instrument data of a song (32 bytes each starting at $C53F95).
  
 {{ff3:ff3us:tutorial:music:brr:17.png}} {{ff3:ff3us:tutorial:music:brr:17.png}}
  
-This cover the mechanical part of the import. Further down will be detailed how to change ADSR data, loop starting positions and pitch multipliers. Not all samples in the [link|BRR Database] are "plug and play" like the FF5 samples. Some require data modifications.+This cover the mechanical part of the import. Further down will be detailed how to change ADSR data, loop starting positions and pitch multipliers. Not all samples in the [[ff3:ff3us:music:brrsamples|BRR Sample Database]] are "plug and play" like the FF5 samples. Some require data modifications.
  
  
Line 84: Line 84:
 {{ff3:ff3us:tutorial:music:brr:adsr.png}} {{ff3:ff3us:tutorial:music:brr:adsr.png}}
  
 +Note that the ADSR settings on SNES are a bit different than the usual ADSR. A quick overview:
 +<WRAP 600px>
 +| A | Attack Rate | 0 to 15 | higher is shorter | maximum 4100ms (at 0) |
 +| D | Decay Rate | 0 to 7 | higher is shorter | maximum 1200ms (at 0) |
 +| S | Sustain Level | 0 to 7 | higher is louder | 0% to 100% of initial sound |
 +| R | Sustain Rate | 0 to 31 | higher is shorter | maximum 38,000ms (at 1); 0 is infinite |
 +</WRAP>
 ==== C. Pitch Mutiplier ==== ==== C. Pitch Mutiplier ====
  
  • ff3/ff3us/tutorial/music/brr.1540016921.txt.gz
  • Last modified: 5 years ago
  • (external edit)