-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Audio 6/?] Build Soundfonts and the Soundfont Table (#1675)
* [Audio 6/?] Build Soundfonts and the Soundfont Table * Fix bss * Maybe fix warnings * Improve lots of error messages * Suggested changes from OoT PR * Suggested changes * Make soundfont_table.h generation depend on the samplebank xmls since they are read, report from which soundfont the invalid pointer indirect warning originates from
- Loading branch information
Showing
28 changed files
with
2,776 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef SOUNDFONT_FILE_H | ||
#define SOUNDFONT_FILE_H | ||
|
||
#include "libc/stdbool.h" | ||
#include "alignment.h" | ||
#include "attributes.h" | ||
#include "effects.h" | ||
#include "load.h" | ||
#include "soundfont.h" | ||
|
||
// Envelope definitions | ||
|
||
#define ENVELOPE_POINT(delay, target) { (delay), (target) } | ||
#define ENVELOPE_DISABLE() { ADSR_DISABLE, 0 } | ||
#define ENVELOPE_HANG() { ADSR_HANG, 0 } | ||
#define ENVELOPE_GOTO(index) { ADSR_GOTO, (index) } | ||
#define ENVELOPE_RESTART() { ADSR_RESTART, 0 } | ||
|
||
// Instrument definitions | ||
|
||
#define INSTR_SAMPLE_NONE { NULL, 0.0f } | ||
#define INSTR_SAMPLE_LO_NONE 0 | ||
#define INSTR_SAMPLE_HI_NONE 127 | ||
|
||
// Explicit padding is sometimes required where soundfont data was padded to 0x10 bytes (possibly due to source file | ||
// splits in the original soundfonts?) | ||
// It's less convenient for us to emit multiple files per soundfont, so instead we fill in the padding manually. | ||
|
||
#ifndef GLUE | ||
#define GLUE(a,b) a##b | ||
#endif | ||
#ifndef GLUE2 | ||
#define GLUE2(a,b) GLUE(a,b) | ||
#endif | ||
|
||
#ifdef __sgi | ||
// For IDO, we have to add explicit padding arrays | ||
#define SF_PAD4() static u8 GLUE2(_pad, __LINE__) [] = { 0,0,0,0 } | ||
#define SF_PAD8() static u8 GLUE2(_pad, __LINE__) [] = { 0,0,0,0,0,0,0,0 } | ||
#define SF_PADC() static u8 GLUE2(_pad, __LINE__) [] = { 0,0,0,0,0,0,0,0,0,0,0,0 } | ||
#else | ||
// For other compilers, the soundfont compiler (sfc) emits alignment attributes that handle this automatically | ||
#define SF_PAD4() | ||
#define SF_PAD8() | ||
#define SF_PADC() | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
OUTPUT_ARCH (mips) | ||
|
||
/* Soundfont Linker Script, maps data into rodata and adds a file length symbol */ | ||
|
||
SECTIONS { | ||
|
||
.rodata : | ||
{ | ||
*(.data*) | ||
*(.rodata*) | ||
. = ALIGN(16); | ||
__LEN__ = . - ADDR(.rodata); | ||
} | ||
|
||
/DISCARD/ : | ||
{ | ||
*(*); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.