Skip to content

Commit

Permalink
Minor fixes in define and include opcode pages
Browse files Browse the repository at this point in the history
  • Loading branch information
redtide committed Mar 1, 2024
1 parent 0ec6e91 commit 6e981b6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
23 changes: 16 additions & 7 deletions docs/opcodes/define.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,22 @@ change key maps, MIDI CC assignments, pitch bend ranges etc. which can then be
used repeatedly in the SFZ file, but can be easily changed just by editing their
`#define` value in one place.

Using #define as a constant with a single value thorughout an instrument works
easily. Defining the same variable to have multiple values at different points in the
same instrument, however, requires care. Using #define to set the same variable to
different values at one point in the same SFZ file does not work well at least in
ARIA/Sforzando when loading an instrument. However, a workaround there is to
use [#include] to put each set of #define statements with different
values in a separate file. In simple tests, that has been successful.
Using `#define` as a constant with a single value thorughout an instrument works
easily. Defining the same variable to have multiple values at different points
in the same instrument, however, requires care.

The following does not work well in ARIA/Sforzando, assuming that B.sfz uses `MYVAR`:

```sfz
#define MYVAR cc12
#include B.sfz
#define MYVAR cc13
#include B.sfz
```

However, a workaround there is to use [#include] to put each set of `#define`
statement with different values in a separate file.
In simple tests, that has been successful.


[#include]: include.md
20 changes: 15 additions & 5 deletions docs/opcodes/include.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,22 @@ tune_cc55=-250
#include "mappings/bobobo_tenor_l_2.sfz"
```

Using #include with [#define] in the same instrument requires care,
Using `#include` with [#define] in the same instrument requires care,
especially if the same value has to be #defined to have different settings at
different points in an instrument. Using #define to set the same variable to different
values at one point in the same SFZ file does not work well at least in ARIA/Sforzando
when loading an instrument. However, a workaround there is to use #include to put each
#define statement in a separate file. In simple tests, that has been successful.
different points in an instrument.

The following does not work well in ARIA/Sforzando, assuming that B.sfz uses `MYVAR`:

```sfz
#define MYVAR cc12
#include B.sfz
#define MYVAR cc13
#include B.sfz
```

However, a workaround there is to use `#include` to put each `#define` statement
in a separate file.
In simple tests, that has been successful.


[#define]: define.md
Expand Down

0 comments on commit 6e981b6

Please sign in to comment.