Sound Sample Tuning (N64 Sound Tool)
Users browsing this thread: 1 Guest(s)

In SM64, each sound has some parameters attached to it.
Some of these parameters are labelled "ADSR" under the sound tool.
More information on ADSR parameters are discussed in this thread.
Furthermore, there are parameters for base keys and instrument looping. Here, I'll discuss everything I know about the subject.
In most games, base key is given by a byte (0-127 or 0x00-0x7F) with a de-tune byte alongside.
In SM64, the base key is given by a float, in which one can assign a fractional key without using de-tune.
The following formula converts key to float:
Code:
​Float = 2^((60-key)/12)
Here is a graph of the function:
[Image: SM64KeyToFloat.png]
And here is an entire table of floats for each key:
Code:

Key: Float
0: 32
1: 30.20398
2: 28.50876
3: 26.90869
4: 25.39842
5: 23.97291
6: 22.62742
7: 21.35744
8: 20.15874
9: 19.02731
10: 17.95939
11: 16.95141
12: 16
13: 15.10199
14: 14.25438
15: 13.45434
16: 12.69921
17: 11.98646
18: 11.31371
19: 10.67872
20: 10.07937
21: 9.513657
22: 8.979696
23: 8.475705
24: 8
25: 7.550994
26: 7.12719
27: 6.727171
28: 6.349604
29: 5.993228
30: 5.656854
31: 5.339359
32: 5.039684
33: 4.756828
34: 4.489848
35: 4.237853
36: 4
37: 3.775497
38: 3.563595
39: 3.363586
40: 3.174802
41: 2.996614
42: 2.828427
43: 2.66968
44: 2.519842
45: 2.378414
46: 2.244924
47: 2.118926
48: 2
49: 1.887749
50: 1.781797
51: 1.681793
52: 1.587401
53: 1.498307
54: 1.414214
55: 1.33484
56: 1.259921
57: 1.189207
58: 1.122462
59: 1.059463
60: 1
61: 0.9438743
62: 0.8908987
63: 0.8408964
64: 0.7937005
65: 0.7491536
66: 0.7071068
67: 0.6674199
68: 0.6299605
69: 0.5946035
70: 0.561231
71: 0.5297316
72: 0.5
73: 0.4719371
74: 0.4454494
75: 0.4204482
76: 0.3968503
77: 0.3745768
78: 0.3535534
79: 0.33371
80: 0.3149803
81: 0.2973018
82: 0.2806155
83: 0.2648658
84: 0.25
85: 0.2359686
86: 0.2227247
87: 0.2102241
88: 0.1984251
89: 0.1872884
90: 0.1767767
91: 0.166855
92: 0.1574901
93: 0.1486509
94: 0.1403078
95: 0.1324329
96: 0.125
97: 0.1179843
98: 0.1113623
99: 0.1051121
100: 0.09921256
101: 0.09364419
102: 0.08838835
103: 0.08342749
104: 0.07874507
105: 0.07432544
106: 0.07015388
107: 0.06621645
108: 0.0625
109: 0.05899214
110: 0.05568117
111: 0.05255603
112: 0.04960628
113: 0.0468221
114: 0.04419417
115: 0.04171374
116: 0.03937253
117: 0.03716272
118: 0.03507694
119: 0.03310822
120: 0.03125
121: 0.02949607
122: 0.02784058
123: 0.02627801
124: 0.02480314
125: 0.02341105
126: 0.02209709
127: 0.02085687


So, if you wanted a 72-and-a-half key (mid-semitone), you would use 2^((60-72.5)/12) = 0.485766.

Now, there are optional previous and secondary samples for instruments. Using the "splits/release" value in the sound tool, you can choose the ranges for the primary sample before it splits to the previous or secondary sample (min/max keys before switch).

The value goes something like:
Code:
​[00] [Min Key +- 0x15] [Max Key +- 0x15] [Release Time]

Where each value is a byte. I'm not sure why 0x15 is added or subtracted from each, but it's consistent, as in for 3 samples, it'll always be subtracted, and for previous-primary, it's always added. (More testing needed)

For instrument looping, having count set to 0x00000000 will DISABLE looping.
Having count set to 0xFFFFFFFF will ENABLE looping.
As for start and end, I haven't experimented enough with it, but the values seem time based.
So having a larger value for end will wait longer for the loop.
Let me know if you discover any more information on sound data!
(Credit to shygoo for figuring out the float from key formula given correlated data)
(This post was last modified: 16-01-2018, 04:40 PM by Trenavix.)

this is something greenthunder labbed:
adsr stands for Attack Decay Sustain Release
adsr 1 is for the fade in - if you put it at 002 or 001 then the sample doesn't fade in, it just starts as rapidly as the note starts, but if you put it to something like 4D then the sample fades in
adsr 2 is for how much impact the sample has - just leave it at 7FBC if you want your sample to have the impact it has in the original wav file
adsr 3 is how long it sustains
adsr 5 and 6 are for the release - its usually 7FBC or 72F6 so samples last as long as the note lasts
also loop works like you thought, start is the start time offset and end is the end time offset for the loop - im not sure how time is quantified in these samples though.
(This post was last modified: 16-01-2018, 05:03 PM by Kaze.)

Sound Sample Tuning (N64 Sound Tool)
Users browsing this thread: 1 Guest(s)


  EN ・日本語