aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard <q@1bpm.net>2022-09-14 22:21:05 +0100
committerRichard <q@1bpm.net>2022-09-14 22:21:05 +0100
commit05a9a94ba5af5f7efa1fbc7acc2f4045ad13f5f6 (patch)
tree1456c50e5c242f686a50eb0852780dfa0dd9841d
parent6d01af96149b6a56c353e7876748b2ee9bcd6762 (diff)
downloadcsound-json-5f04bf0b3bc998427170ffd99c81f13649e7eefa.tar.gz
csound-json-5f04bf0b3bc998427170ffd99c81f13649e7eefa.tar.bz2
csound-json-5f04bf0b3bc998427170ffd99c81f13649e7eefa.zip
corrected jsongetval to jsonget to match docs, updated examplev1.1
-rw-r--r--examples/example2.csd8
-rw-r--r--src/opcodes.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/examples/example2.csd b/examples/example2.csd
index fd03ec3..5fe23bd 100644
--- a/examples/example2.csd
+++ b/examples/example2.csd
@@ -50,8 +50,8 @@ instr boot
iJsupplement jsonload "supplement.json"
; get the instruments objects and merge them
- iJinstrs1 jsongetval iJbase, "instruments"
- iJinstrs2 jsongetval iJsupplement, "instruments"
+ iJinstrs1 jsonget iJbase, "instruments"
+ iJinstrs2 jsonget iJsupplement, "instruments"
jsonmerge iJinstrs1, iJinstrs2, 1
; get keys of the resulting instruments
@@ -63,7 +63,7 @@ instr boot
Sinstrument = Skeys[indexi]
; get the relevant instrument object
- iJscore jsongetval iJinstrs1, Sinstrument
+ iJscore jsonget iJinstrs1, Sinstrument
; score items are retrieved as handles to JSON arrays, in a Csound array
iJscorelines[] jsonarr iJscore
@@ -117,4 +117,4 @@ f3 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111 ; Square
f0 15
i"boot" 0 1
</CsScore>
-</CsoundSynthesizer> \ No newline at end of file
+</CsoundSynthesizer>
diff --git a/src/opcodes.cpp b/src/opcodes.cpp
index 26a835f..f3eccd6 100644
--- a/src/opcodes.cpp
+++ b/src/opcodes.cpp
@@ -538,7 +538,7 @@ struct jsonsizeK : jsonsizeBase {
/*
Get object from an object by key name
*/
-struct jsongetvalString : plugin<1, 2> {
+struct jsongetString : plugin<1, 2> {
PLUGINIT("i", "iS", true)
void irun() {
STRINGDAT &input = inargs.str_data(1);
@@ -554,7 +554,7 @@ struct jsongetvalString : plugin<1, 2> {
/*
Get object from an array by index
*/
-struct jsongetvalNumeric : plugin<1, 2> {
+struct jsongetNumeric : plugin<1, 2> {
PLUGINIT("i", "ii", true)
void irun() {
jsoncons::json selected = jsonSession->data[(int) inargs[1]];
@@ -955,8 +955,8 @@ void csnd::on_load(csnd::Csound *csound) {
csnd::plugin<jsontypeString>(csound, "jsontype.S", csnd::thread::i);
csnd::plugin<jsonkeys>(csound, "jsonkeys", csnd::thread::i);
csnd::plugin<jsonkeysK>(csound, "jsonkeysk", csnd::thread::ik);
- csnd::plugin<jsongetvalString>(csound, "jsongetval.S", csnd::thread::i);
- csnd::plugin<jsongetvalNumeric>(csound, "jsongetval.i", csnd::thread::i);
+ csnd::plugin<jsongetString>(csound, "jsonget.S", csnd::thread::i);
+ csnd::plugin<jsongetNumeric>(csound, "jsonget.i", csnd::thread::i);
csnd::plugin<jsonsize>(csound, "jsonsize", csnd::thread::i);
csnd::plugin<jsonsizeK>(csound, "jsonsizek", csnd::thread::ik);