aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRichard Knight <q@1bpm.net>2024-04-09 22:58:44 +0100
committerRichard Knight <q@1bpm.net>2024-04-09 22:58:44 +0100
commitd4701791a2d04ff52bea456ebb34f4d79819f97e (patch)
treec582c6b10b271c550c9618cb0d818c5b27a98620 /README.md
downloadcsound-curl-master.tar.gz
csound-curl-master.tar.bz2
csound-curl-master.zip
initialHEADmaster
Diffstat (limited to 'README.md')
-rw-r--r--README.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0645267
--- /dev/null
+++ b/README.md
@@ -0,0 +1,85 @@
+# csound-curl : simple HTTP GET and POST requests from Csound
+
+## Overview
+csound-curl provides opcodes to perform basic HTTP GET and POST requests at init time and k-rate. SSL hosts are supported. It can be used with the csound-json plugin opcodes in order to effectively communicate with web services and such.
+
+## Requirements
+* Cmake >= 2.8.12
+* Csound with development headers >= 6.14.0
+* libCURL >= 7.26.0
+
+
+
+## Installation
+Create a build directory at the top of the source tree, execute *cmake ..*, *make* and optionally *make install* as root. If the latter is not used/possible then the resulting library can be used with the *--opcode-lib* flag in Csound.
+eg:
+
+ mkdir build && cd build
+ cmake ..
+ make && sudo make install
+
+Cmake should find Csound and any other required libraries using the modules in the cmake/Modules directory and installation should be as simple as above.
+
+## Examples
+Some examples are provided in the examples directory.
+
+
+## Opcode reference
+Due to possible delays incurred by network processes, the init-time opcodes may interrupt any current activity in Csound. For example, audio may be subject to dropouts. As a result it may be ideal only to use the init time opcodes at performance initialisation, and use the k-rate opcodes if requests are required during performance.
+
+
+### ires, Sres curlget Surl
+Perform a GET request at init time.
+
+* ires : HTTP response code
+* Sres : response body
+
+* Surl : URL to request
+
+
+### ires, Sres curlpost Surl, SpostData
+Perform a POST request at init time.
+
+* ires : HTTP response code
+* Sres : response body
+
+* Surl : URL to request
+* SpostData : data to post, should be URL encoded if required
+
+
+### kdone, kres, Sres curlgetk Surl
+Perform a GET request at k-rate.
+
+* kdone : trigger to specify if the request has completed (1 if so, 0 at all other times)
+* kres : HTTP response code
+* Sres : response body
+
+* Surl : URL to request
+
+
+### kdone, kres, Sres curlpostk Surl, SpostData
+Perform a POST request at k-rate.
+
+* kdone : trigger to specify if the request has completed (1 if so, 0 at all other times)
+* kres : HTTP response code
+* Sres : response body
+
+* Surl : URL to request
+* SpostData : data to post, should be URL encoded if required
+
+
+### Sencoded curlurlencode Sinput
+URL encode a string at init time.
+
+* Sinput : the string to be encoded
+
+* Sencoded : the encoded string
+
+
+### Sencoded curlurlencodek Sinput, ktrigger
+URL encode a string at k-rate upon receipt of a trigger.
+
+* Sinput : the string to be encoded
+* ktrigger : encode the string when this is set to 1
+
+* Sencoded : the encoded string \ No newline at end of file