csound-expression-opcodes-0.0.0: opcodes for the library csound-expression

Safe HaskellNone

Csound.Typed.Opcode.Strings

Contents

Synopsis

Definition.

strget :: D -> StrSource

Set string variable to value from strset table or string p-field

strget sets a string variable at initialization time to the value stored in strset table at the specified index, or a string p-field from the score. If there is no string defined for the index, the variable is set to an empty string.

 Sdst  strget  indx

csound doc: http://www.csounds.com/manual/html/strget.html

strset :: D -> D -> SE ()Source

Allows a string to be linked with a numeric value.

  strset  iarg, istring

csound doc: http://www.csounds.com/manual/html/strset.html

Manipulation.

puts :: Str -> Sig -> SE ()Source

Print a string constant or variable

puts prints a string with an optional newline at the end whenever the trigger signal is positive and changes.

  puts  Sstr, ktrig[, inonl]

csound doc: http://www.csounds.com/manual/html/puts.html

sprintf :: Str -> Sig -> StrSource

printf-style formatted output to a string variable.

sprintf write printf-style formatted output to a string variable, similarly to the C function sprintf(). sprintf runs at i-time only.

 Sdst  sprintf  Sfmt, xarg1[, xarg2[, ... ]]

csound doc: http://www.csounds.com/manual/html/sprintf.html

sprintfk :: Str -> Sig -> StrSource

printf-style formatted output to a string variable at k-rate.

sprintfk writes printf-style formatted output to a string variable, similarly to the C function sprintf(). sprintfk runs both at initialization and performance time.

 Sdst  sprintfk  Sfmt, xarg1[, xarg2[, ... ]]

csound doc: http://www.csounds.com/manual/html/sprintfk.html

strcat :: Str -> Str -> StrSource

Concatenate strings

Concatenate two strings and store the result in a variable. strcat runs at i-time only. It is allowed for any of the input arguments to be the same as the output variable.

 Sdst  strcat  Ssrc1, Ssrc2

csound doc: http://www.csounds.com/manual/html/strcat.html

strcatk :: Str -> Str -> StrSource

Concatenate strings (k-rate)

Concatenate two strings and store the result in a variable. strcatk does the concatenation both at initialization and performance time. It is allowed for any of the input arguments to be the same as the output variable.

 Sdst  strcatk  Ssrc1, Ssrc2

csound doc: http://www.csounds.com/manual/html/strcatk.html

strcmp :: Str -> Str -> DSource

Compare strings

Compare strings and set the result to -1, 0, or 1 if the first string is less than, equal to, or greater than the second, respectively. strcmp compares at i-time only.

 ires  strcmp  S1, S2

csound doc: http://www.csounds.com/manual/html/strcmp.html

strcmpk :: Str -> Str -> SigSource

Compare strings

Compare strings and set the result to -1, 0, or 1 if the first string is less than, equal to, or greater than the second, respectively. strcmpk does the comparison both at initialization and performance time.

 kres  strcmpk  S1, S2

csound doc: http://www.csounds.com/manual/html/strcmpk.html

strcpy :: Str -> StrSource

Assign value to a string variable

Assign to a string variable by copying the source which may be a constant or another string variable. strcpy and = copy the string at i-time only.

 Sdst  strcpy  Ssrc

csound doc: http://www.csounds.com/manual/html/strcpy.html

strcpyk :: Str -> StrSource

Assign value to a string variable (k-rate)

Assign to a string variable by copying the source which may be a constant or another string variable. strcpyk does the assignment both at initialization and performance time.

 Sdst  strcpyk  Ssrc

csound doc: http://www.csounds.com/manual/html/strcpyk.html

strindex :: Str -> Str -> DSource

Return the position of the first occurence of a string in another string

Return the position of the first occurence of S2 in S1, or -1 if not found. If S2 is empty, 0 is returned. strindex runs at init time only.

 ipos  strindex  S1, S2

csound doc: http://www.csounds.com/manual/html/strindex.html

strindexk :: Str -> Str -> SigSource

Return the position of the first occurence of a string in another string

Return the position of the first occurence of S2 in S1, or -1 if not found. If S2 is empty, 0 is returned. strindexk runs both at init and performance time.

 kpos  strindexk  S1, S2

csound doc: http://www.csounds.com/manual/html/strindexk.html

strlen :: Str -> DSource

Return the length of a string

Return the length of a string, or zero if it is empty. strlen runs at init time only.

 ilen  strlen  Sstr

csound doc: http://www.csounds.com/manual/html/strlen.html

strlenk :: Str -> SigSource

Return the length of a string

Return the length of a string, or zero if it is empty. strlenk runs both at init and performance time.

 klen  strlenk  Sstr

csound doc: http://www.csounds.com/manual/html/strlenk.html

strrindex :: Str -> Str -> DSource

Return the position of the last occurence of a string in another string

Return the position of the last occurence of S2 in S1, or -1 if not found. If S2 is empty, the length of S1 is returned. strrindex runs at init time only.

 ipos  strrindex  S1, S2

csound doc: http://www.csounds.com/manual/html/strrindex.html

strrindexk :: Str -> Str -> SigSource

Return the position of the last occurence of a string in another string

Return the position of the last occurence of S2 in S1, or -1 if not found. If S2 is empty, the length of S1 is returned. strrindexk runs both at init and performance time.

 kpos  strrindexk  S1, S2

csound doc: http://www.csounds.com/manual/html/strrindexk.html

strsub :: Str -> StrSource

Extract a substring

Return a substring of the source string. strsub runs at init time only.

 Sdst  strsub  Ssrc[, istart[, iend]]

csound doc: http://www.csounds.com/manual/html/strsub.html

strsubk :: Str -> Sig -> Sig -> StrSource

Extract a substring

Return a substring of the source string. strsubk runs both at init and performance time.

 Sdst  strsubk  Ssrc, kstart, kend

csound doc: http://www.csounds.com/manual/html/strsubk.html

Conversion.

strchar :: Str -> DSource

Return the ASCII code of a character in a string

Return the ASCII code of the character in Sstr at ipos (defaults to zero which means the first character), or zero if ipos is out of range. strchar runs at init time only.

 ichr  strchar  Sstr[, ipos]

csound doc: http://www.csounds.com/manual/html/strchar.html

strchark :: Str -> SigSource

Return the ASCII code of a character in a string

Return the ASCII code of the character in Sstr at kpos (defaults to zero which means the first character), or zero if kpos is out of range. strchark runs both at init and performance time.

 kchr  strchark  Sstr[, kpos]

csound doc: http://www.csounds.com/manual/html/strchark.html

strlower :: Str -> StrSource

Convert a string to lower case

Convert Ssrc to lower case, and write the result to Sdst. strlower runs at init time only.

 Sdst  strlower  Ssrc

csound doc: http://www.csounds.com/manual/html/strlower.html

strlowerk :: Str -> StrSource

Convert a string to lower case

Convert Ssrc to lower case, and write the result to Sdst. strlowerk runs both at init and performance time.

 Sdst  strlowerk  Ssrc

csound doc: http://www.csounds.com/manual/html/strlowerk.html

strtod :: Str -> DSource

Converts a string to a float (i-rate).

Convert a string to a floating point value. It is also possible to pass an strset index or a string p-field from the score instead of a string argument. If the string cannot be parsed as a floating point or integer number, an init or perf error occurs and the instrument is deactivated.

 ir  strtod  Sstr
 ir  strtod  indx

csound doc: http://www.csounds.com/manual/html/strtod.html

strtodk :: Str -> SigSource

Converts a string to a float (k-rate).

Convert a string to a floating point value at i- or k-rate. It is also possible to pass an strset index or a string p-field from the score instead of a string argument. If the string cannot be parsed as a floating point or integer number, an init or perf error occurs and the instrument is deactivated.

 kr  strtodk  Sstr
 kr  strtodk  kndx

csound doc: http://www.csounds.com/manual/html/strtodk.html

strtol :: Str -> DSource

Converts a string to a signed integer (i-rate).

Convert a string to a signed integer value. It is also possible to pass an strset index or a string p-field from the score instead of a string argument. If the string cannot be parsed as an integer number, an init error occurs and the instrument is deactivated.

 ir  strtol  Sstr
 ir  strtol  indx

csound doc: http://www.csounds.com/manual/html/strtol.html

strtolk :: Str -> SigSource

Converts a string to a signed integer (k-rate).

Convert a string to a signed integer value at i- or k-rate. It is also possible to pass an strset index or a string p-field from the score instead of a string argument. If the string cannot be parsed as an integer number, an init or perf error occurs and the instrument is deactivated.

 kr  strtolk  Sstr
 kr  strtolk  kndx

csound doc: http://www.csounds.com/manual/html/strtolk.html

strupper :: Str -> StrSource

Convert a string to upper case

Convert Ssrc to upper case, and write the result to Sdst. strupper runs at init time only.

 Sdst  strupper  Ssrc

csound doc: http://www.csounds.com/manual/html/strupper.html

strupperk :: Str -> StrSource

Convert a string to upper case

Convert Ssrc to upper case, and write the result to Sdst. strupperk runs both at init and performance time.

 Sdst  strupperk  Ssrc

csound doc: http://www.csounds.com/manual/html/strupperk.html