16 #define NUM_NOTES 100 // # notes to play
24 int main(
int argc,
char ** Argv) {
28 lo_address ad = lo_address_new(NULL, pNam);
30 logMsg(
"Sending OSC note cmds");
35 logMsg(
"Sending OSC quit");
37 if (lo_send(ad,
"/q", NULL) == -1) {
38 logMsg(
kLogError,
"OSC error3 %d: %s\n", lo_address_errno(ad), lo_address_errstr(ad));
45 int steps[5] = { 0, 2, 5, 7, 9 };
47 for (
unsigned i = 0; i <
NUM_NOTES; i++) {
48 sprintf(pNam,
"/i%d/pn", (i % 16) + 1);
49 float dur =
fRandM(0.15f, 1.5f);
50 float ampl =
fRandM(0.1, 0.6);
52 int step = steps[
iRandV(5)];
53 int key = (octave * 12) + step;
57 if (lo_send(ad, pNam,
"ffff", dur, ampl, freq, pos) == -1)
58 logMsg(
kLogError,
"OSC error2 %d: %s\n", lo_address_errno(ad), lo_address_errstr(ad));
void logMsg(const char *format,...)
These are the public logging messages.
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
float keyToFreq(unsigned midiKey)
MIDI Conversions.
float fRandM(float minV, float maxV)
min - max (min/max)
int iRandV(int val)
Integer rands.
int iRandM(int minV, int maxV)
min - max (min/max)
#define CSL_WORD_LEN
default short string length
void noteLoop(lo_address &ad)
static unsigned outPort()
the default RemoteIO output port
float fRand1(void)
-1 - 1 (one)
int main(int argc, char **Argv)