mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-14 02:54:37 -04:00
refactor(vm): rename Commands/Values to Opcodes/Operands
The commands and values were not very good names to what the byte sequences actually are: opcodes and their operands. In many other places, we were already calling the byte in the Command stream as Opcode, so a logical name for a sequence of these is Opcodes. Values is such a generic name that it's not immediately clear that this sequence is related to the opcodes. Operands is not perfect but clearly suggests that this sequence is related to the Opcodes.
This commit is contained in:
parent
87604dd92e
commit
01bf409929
@ -7,21 +7,21 @@
|
||||
void SU_CALLCONV su_render_song(float *buffer)
|
||||
{
|
||||
Synth *synth;
|
||||
const unsigned char commands[] = {SU_ENVELOPE_ID, // MONO
|
||||
SU_ENVELOPE_ID, // MONO
|
||||
SU_OUT_ID + 1, // STEREO
|
||||
SU_ADVANCE_ID}; // MONO
|
||||
const unsigned char values[] = {64, 64, 64, 80, 128, // envelope 1
|
||||
95, 64, 64, 80, 128, // envelope 2
|
||||
128};
|
||||
const unsigned char opcodes[] = {SU_ENVELOPE_ID, // MONO
|
||||
SU_ENVELOPE_ID, // MONO
|
||||
SU_OUT_ID + 1, // STEREO
|
||||
SU_ADVANCE_ID}; // MONO
|
||||
const unsigned char operands[] = {64, 64, 64, 80, 128, // envelope 1
|
||||
95, 64, 64, 80, 128, // envelope 2
|
||||
128};
|
||||
int retval;
|
||||
int samples;
|
||||
int time;
|
||||
// initialize Synth
|
||||
synth = (Synth *)malloc(sizeof(Synth));
|
||||
memset(synth, 0, sizeof(Synth));
|
||||
memcpy(synth->Commands, commands, sizeof(commands));
|
||||
memcpy(synth->Values, values, sizeof(values));
|
||||
memcpy(synth->Opcodes, opcodes, sizeof(opcodes));
|
||||
memcpy(synth->Operands, operands, sizeof(operands));
|
||||
synth->NumVoices = 1;
|
||||
synth->Polyphony = 0;
|
||||
synth->RandSeed = 1;
|
||||
|
@ -14,13 +14,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Synth *synth;
|
||||
float *buffer;
|
||||
const unsigned char commands[] = {SU_ENVELOPE_ID, // MONO
|
||||
SU_ENVELOPE_ID, // MONO
|
||||
SU_OUT_ID + 1, // STEREO
|
||||
SU_ADVANCE_ID}; // MONO
|
||||
const unsigned char values[] = {64, 64, 64, 80, 128, // envelope 1
|
||||
95, 64, 64, 80, 128, // envelope 2
|
||||
128};
|
||||
const unsigned char opcodes[] = {SU_ENVELOPE_ID, // MONO
|
||||
SU_ENVELOPE_ID, // MONO
|
||||
SU_OUT_ID + 1, // STEREO
|
||||
SU_ADVANCE_ID}; // MONO
|
||||
const unsigned char operands[] = {64, 64, 64, 80, 128, // envelope 1
|
||||
95, 64, 64, 80, 128, // envelope 2
|
||||
128};
|
||||
int errcode;
|
||||
int time;
|
||||
int samples;
|
||||
@ -29,8 +29,8 @@ int main(int argc, char *argv[])
|
||||
// initialize Synth
|
||||
synth = (Synth *)malloc(sizeof(Synth));
|
||||
memset(synth, 0, sizeof(Synth));
|
||||
memcpy(synth->Commands, commands, sizeof(commands));
|
||||
memcpy(synth->Values, values, sizeof(values));
|
||||
memcpy(synth->Opcodes, opcodes, sizeof(opcodes));
|
||||
memcpy(synth->Operands, operands, sizeof(operands));
|
||||
synth->NumVoices = 1;
|
||||
synth->Polyphony = 0;
|
||||
synth->RandSeed = 1;
|
||||
|
Reference in New Issue
Block a user