From 425c881b86435d756f09f82dd5c3ba48fe64cf66 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 3 Mar 2021 01:00:03 +0000 Subject: initial --- examples/example.csd | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 examples/example.csd (limited to 'examples/example.csd') diff --git a/examples/example.csd b/examples/example.csd new file mode 100644 index 0000000..9c51083 --- /dev/null +++ b/examples/example.csd @@ -0,0 +1,69 @@ + + +-n ; no audio + + +/* + Demonstration of nstrexists. + Check through a range of instrument numbers and report if they are + known to the Csound engine. + +*/ +sr = 44100 +ksmps = 1 +nchnls = 2 +0dbfs = 1 + +/* + Empty instruments to test for existence +*/ +instr 92 +endin + +instr 93 +endin + +instr 95 +endin + +instr testinstr1 +endin + +instr testinstr3 +endin + +instr testinstr4 +endin + + +/* + Go through instrument numbers 1 to 10 and check for existence +*/ +instr 98 + + ; test the numeric i-rate opcode: look for instruments numbered between 91 and 98 + inum = 91 +loop: + prints(sprintf("(i-rate) Instr %d : %d\n", inum, nstrexists(inum))) + loop_lt inum, 1, 99, loop + turnoff +endin + + +instr 99 + + ; test the numeric k-rate opcode: look for instruments numbered between 91 and 98 + knum = 91 +loop: + printks2(sprintfk("(k-rate) Instr %d: %d\n", knum, nstrexists(knum)), knum) + loop_lt knum, 1, 99, loop + turnoff +endin + + + +i98 0 1 +i99 1 1 + + + -- cgit v1.2.3