id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
148,800 | scgolang/sc | ugen.go | Cos | func (u *Ugen) Cos() Input {
return unaryOpCos(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Cos() Input {
return unaryOpCos(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Cos",
"(",
")",
"Input",
"{",
"return",
"unaryOpCos",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Cos returns the cosine of a ugen. | [
"Cos",
"returns",
"the",
"cosine",
"of",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L144-L146 |
148,801 | scgolang/sc | ugen.go | Cosh | func (u *Ugen) Cosh() Input {
return unaryOpCosh(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Cosh() Input {
return unaryOpCosh(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Cosh",
"(",
")",
"Input",
"{",
"return",
"unaryOpCosh",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Cosh returns the hyperbolic cosine of a ugen. | [
"Cosh",
"returns",
"the",
"hyperbolic",
"cosine",
"of",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L149-L151 |
148,802 | scgolang/sc | ugen.go | DbAmp | func (u *Ugen) DbAmp() Input {
return unaryOpDbAmp(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) DbAmp() Input {
return unaryOpDbAmp(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"DbAmp",
"(",
")",
"Input",
"{",
"return",
"unaryOpDbAmp",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // DbAmp converts linear amplitude to decibels. | [
"DbAmp",
"converts",
"linear",
"amplitude",
"to",
"decibels",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L169-L171 |
148,803 | scgolang/sc | ugen.go | Expon | func (u *Ugen) Expon(val Input) Input {
return binOpExpon(u.Rate, u, val, u.NumOutputs)
} | go | func (u *Ugen) Expon(val Input) Input {
return binOpExpon(u.Rate, u, val, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Expon",
"(",
"val",
"Input",
")",
"Input",
"{",
"return",
"binOpExpon",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"val",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Expon raises this input to the power of another. | [
"Expon",
"raises",
"this",
"input",
"to",
"the",
"power",
"of",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L199-L201 |
148,804 | scgolang/sc | ugen.go | Frac | func (u *Ugen) Frac() Input {
return unaryOpFrac(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Frac() Input {
return unaryOpFrac(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Frac",
"(",
")",
"Input",
"{",
"return",
"unaryOpFrac",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Frac computes the fractional part of a signal. | [
"Frac",
"computes",
"the",
"fractional",
"part",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L214-L216 |
148,805 | scgolang/sc | ugen.go | LCM | func (u *Ugen) LCM(val Input) Input {
return binOpLCM(u.Rate, u, val, u.NumOutputs)
} | go | func (u *Ugen) LCM(val Input) Input {
return binOpLCM(u.Rate, u, val, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"LCM",
"(",
"val",
"Input",
")",
"Input",
"{",
"return",
"binOpLCM",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"val",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // LCM computes the lcm of one Input and another. | [
"LCM",
"computes",
"the",
"lcm",
"of",
"one",
"Input",
"and",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L245-L247 |
148,806 | scgolang/sc | ugen.go | Max | func (u *Ugen) Max(other Input) Input {
return binOpMax(u.Rate, u, other, u.NumOutputs)
} | go | func (u *Ugen) Max(other Input) Input {
return binOpMax(u.Rate, u, other, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Max",
"(",
"other",
"Input",
")",
"Input",
"{",
"return",
"binOpMax",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"other",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Max computes the maximum of one Input and another. | [
"Max",
"computes",
"the",
"maximum",
"of",
"one",
"Input",
"and",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L280-L282 |
148,807 | scgolang/sc | ugen.go | Midicps | func (u *Ugen) Midicps() Input {
return unaryOpMidicps(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Midicps() Input {
return unaryOpMidicps(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Midicps",
"(",
")",
"Input",
"{",
"return",
"unaryOpMidicps",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Midicps converts MIDI note number to cycles per second. | [
"Midicps",
"converts",
"MIDI",
"note",
"number",
"to",
"cycles",
"per",
"second",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L285-L287 |
148,808 | scgolang/sc | ugen.go | Mul | func (u *Ugen) Mul(val Input) Input {
return binOpMul(u.Rate, u, val, u.NumOutputs)
} | go | func (u *Ugen) Mul(val Input) Input {
return binOpMul(u.Rate, u, val, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Mul",
"(",
"val",
"Input",
")",
"Input",
"{",
"return",
"binOpMul",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"val",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Mul multiplies the ugen node by an input. | [
"Mul",
"multiplies",
"the",
"ugen",
"node",
"by",
"an",
"input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L310-L312 |
148,809 | scgolang/sc | ugen.go | MulAdd | func (u *Ugen) MulAdd(mul, add Input) Input {
return mulAdd(u.Rate, u, mul, add, u.NumOutputs)
} | go | func (u *Ugen) MulAdd(mul, add Input) Input {
return mulAdd(u.Rate, u, mul, add, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"MulAdd",
"(",
"mul",
",",
"add",
"Input",
")",
"Input",
"{",
"return",
"mulAdd",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"mul",
",",
"add",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // MulAdd multiplies and adds inputs to a ugen node. | [
"MulAdd",
"multiplies",
"and",
"adds",
"inputs",
"to",
"a",
"ugen",
"node",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L315-L317 |
148,810 | scgolang/sc | ugen.go | Pow | func (u *Ugen) Pow(val Input) Input {
return binOpPow(u.Rate, u, val, u.NumOutputs)
} | go | func (u *Ugen) Pow(val Input) Input {
return binOpPow(u.Rate, u, val, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Pow",
"(",
"val",
"Input",
")",
"Input",
"{",
"return",
"binOpPow",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"val",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Pow raises this input to the power of another. | [
"Pow",
"raises",
"this",
"input",
"to",
"the",
"power",
"of",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L330-L332 |
148,811 | scgolang/sc | ugen.go | Sign | func (u *Ugen) Sign() Input {
return unaryOpSign(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Sign() Input {
return unaryOpSign(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Sign",
"(",
")",
"Input",
"{",
"return",
"unaryOpSign",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Sign computes the sign of a signal. | [
"Sign",
"computes",
"the",
"sign",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L385-L387 |
148,812 | scgolang/sc | ugen.go | Sin | func (u *Ugen) Sin() Input {
return unaryOpSin(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Sin() Input {
return unaryOpSin(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Sin",
"(",
")",
"Input",
"{",
"return",
"unaryOpSin",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Sin returns the sine of a ugen. | [
"Sin",
"returns",
"the",
"sine",
"of",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L390-L392 |
148,813 | scgolang/sc | ugen.go | Sinh | func (u *Ugen) Sinh() Input {
return unaryOpSinh(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Sinh() Input {
return unaryOpSinh(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Sinh",
"(",
")",
"Input",
"{",
"return",
"unaryOpSinh",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Sinh returns the hyperbolic sine of a ugen. | [
"Sinh",
"returns",
"the",
"hyperbolic",
"sine",
"of",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L395-L397 |
148,814 | scgolang/sc | ugen.go | SoftClip | func (u *Ugen) SoftClip() Input {
return unaryOpSoftClip(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) SoftClip() Input {
return unaryOpSoftClip(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"SoftClip",
"(",
")",
"Input",
"{",
"return",
"unaryOpSoftClip",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // SoftClip adds distortion to a ugen. | [
"SoftClip",
"adds",
"distortion",
"to",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L400-L402 |
148,815 | scgolang/sc | ugen.go | Sqrt | func (u *Ugen) Sqrt() Input {
return unaryOpSqrt(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Sqrt() Input {
return unaryOpSqrt(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Sqrt",
"(",
")",
"Input",
"{",
"return",
"unaryOpSqrt",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Sqrt computes the square root of a signal. | [
"Sqrt",
"computes",
"the",
"square",
"root",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L415-L417 |
148,816 | scgolang/sc | ugen.go | Tan | func (u *Ugen) Tan() Input {
return unaryOpTan(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Tan() Input {
return unaryOpTan(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Tan",
"(",
")",
"Input",
"{",
"return",
"unaryOpTan",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Tan returns the tangent of a ugen. | [
"Tan",
"returns",
"the",
"tangent",
"of",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L435-L437 |
148,817 | scgolang/sc | ugen.go | Tanh | func (u *Ugen) Tanh() Input {
return unaryOpTanh(u.Rate, u, u.NumOutputs)
} | go | func (u *Ugen) Tanh() Input {
return unaryOpTanh(u.Rate, u, u.NumOutputs)
} | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Tanh",
"(",
")",
"Input",
"{",
"return",
"unaryOpTanh",
"(",
"u",
".",
"Rate",
",",
"u",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"}"
] | // Tanh returns the hyperbolic tangent of a ugen. | [
"Tanh",
"returns",
"the",
"hyperbolic",
"tangent",
"of",
"a",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L440-L442 |
148,818 | scgolang/sc | ugen.go | Write | func (u *Ugen) Write(w io.Writer) error {
// write the synthdef name
if err := newPstring(u.Name).Write(w); err != nil {
return err
}
// write rate
if err := binary.Write(w, byteOrder, u.Rate); err != nil {
return err
}
// write inputs
numInputs := int32(len(u.Inputs))
if err := binary.Write(w, byteOrder, ... | go | func (u *Ugen) Write(w io.Writer) error {
// write the synthdef name
if err := newPstring(u.Name).Write(w); err != nil {
return err
}
// write rate
if err := binary.Write(w, byteOrder, u.Rate); err != nil {
return err
}
// write inputs
numInputs := int32(len(u.Inputs))
if err := binary.Write(w, byteOrder, ... | [
"func",
"(",
"u",
"*",
"Ugen",
")",
"Write",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"// write the synthdef name",
"if",
"err",
":=",
"newPstring",
"(",
"u",
".",
"Name",
")",
".",
"Write",
"(",
"w",
")",
";",
"err",
"!=",
"nil",
"{",
"... | // Write writes a Ugen | [
"Write",
"writes",
"a",
"Ugen"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L460-L496 |
148,819 | scgolang/sc | ugen.go | readUgen | func readUgen(r io.Reader) (*Ugen, error) {
var (
numInputs int32
numOutputs int32
specialIndex int16
rate int8
)
// read name
name, err := readPstring(r)
if err != nil {
return nil, err
}
// read calculation rate
if err := binary.Read(r, byteOrder, &rate); err != nil {
return nil, err
... | go | func readUgen(r io.Reader) (*Ugen, error) {
var (
numInputs int32
numOutputs int32
specialIndex int16
rate int8
)
// read name
name, err := readPstring(r)
if err != nil {
return nil, err
}
// read calculation rate
if err := binary.Read(r, byteOrder, &rate); err != nil {
return nil, err
... | [
"func",
"readUgen",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"*",
"Ugen",
",",
"error",
")",
"{",
"var",
"(",
"numInputs",
"int32",
"\n",
"numOutputs",
"int32",
"\n",
"specialIndex",
"int16",
"\n",
"rate",
"int8",
"\n",
")",
"\n",
"// read name",
"name... | // readUgen reads a ugen from an io.Reader | [
"readUgen",
"reads",
"a",
"ugen",
"from",
"an",
"io",
".",
"Reader"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L511-L567 |
148,820 | scgolang/sc | ugen.go | asOutput | func asOutput(u *Ugen) *Ugen {
if u.Outputs == nil {
u.Outputs = make([]Output, u.NumOutputs)
for i := range u.Outputs {
u.Outputs[i] = Output(u.Rate)
}
}
return u
} | go | func asOutput(u *Ugen) *Ugen {
if u.Outputs == nil {
u.Outputs = make([]Output, u.NumOutputs)
for i := range u.Outputs {
u.Outputs[i] = Output(u.Rate)
}
}
return u
} | [
"func",
"asOutput",
"(",
"u",
"*",
"Ugen",
")",
"*",
"Ugen",
"{",
"if",
"u",
".",
"Outputs",
"==",
"nil",
"{",
"u",
".",
"Outputs",
"=",
"make",
"(",
"[",
"]",
"Output",
",",
"u",
".",
"NumOutputs",
")",
"\n",
"for",
"i",
":=",
"range",
"u",
... | // asOutput initializes the outputs array of the ugen node. | [
"asOutput",
"initializes",
"the",
"outputs",
"array",
"of",
"the",
"ugen",
"node",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugen.go#L570-L578 |
148,821 | scgolang/sc | buffer.go | Gen | func (buffer *Buffer) Gen(routine string, flags int, args ...float32) error {
if err := checkBufferRoutine(routine); err != nil {
return err
}
if err := checkBufferGenFlags(flags); err != nil {
return err
}
if err := buffer.sendGenMsg(routine, flags, args...); err != nil {
return err
}
if err := buffer.awa... | go | func (buffer *Buffer) Gen(routine string, flags int, args ...float32) error {
if err := checkBufferRoutine(routine); err != nil {
return err
}
if err := checkBufferGenFlags(flags); err != nil {
return err
}
if err := buffer.sendGenMsg(routine, flags, args...); err != nil {
return err
}
if err := buffer.awa... | [
"func",
"(",
"buffer",
"*",
"Buffer",
")",
"Gen",
"(",
"routine",
"string",
",",
"flags",
"int",
",",
"args",
"...",
"float32",
")",
"error",
"{",
"if",
"err",
":=",
"checkBufferRoutine",
"(",
"routine",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"... | // Gen generates a buffer using a routine.
// A runtime panic will occur if routine is not one of the
// BufferRoutine constants. | [
"Gen",
"generates",
"a",
"buffer",
"using",
"a",
"routine",
".",
"A",
"runtime",
"panic",
"will",
"occur",
"if",
"routine",
"is",
"not",
"one",
"of",
"the",
"BufferRoutine",
"constants",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/buffer.go#L58-L72 |
148,822 | scgolang/sc | buffer.go | checkBufferRoutine | func checkBufferRoutine(routine string) error {
if routine != BufferRoutineSine1 &&
routine != BufferRoutineSine2 &&
routine != BufferRoutineSine3 &&
routine != BufferRoutineCheby {
return fmt.Errorf("unsupported buffer routine %s", routine)
}
return nil
} | go | func checkBufferRoutine(routine string) error {
if routine != BufferRoutineSine1 &&
routine != BufferRoutineSine2 &&
routine != BufferRoutineSine3 &&
routine != BufferRoutineCheby {
return fmt.Errorf("unsupported buffer routine %s", routine)
}
return nil
} | [
"func",
"checkBufferRoutine",
"(",
"routine",
"string",
")",
"error",
"{",
"if",
"routine",
"!=",
"BufferRoutineSine1",
"&&",
"routine",
"!=",
"BufferRoutineSine2",
"&&",
"routine",
"!=",
"BufferRoutineSine3",
"&&",
"routine",
"!=",
"BufferRoutineCheby",
"{",
"retur... | // checkBufferRoutine panics if routine is not one of the
// supported BufferRoutine constants | [
"checkBufferRoutine",
"panics",
"if",
"routine",
"is",
"not",
"one",
"of",
"the",
"supported",
"BufferRoutine",
"constants"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/buffer.go#L128-L136 |
148,823 | scgolang/sc | buffer.go | checkBufferGenFlags | func checkBufferGenFlags(flags int) error {
if flags < 0 && flags > 4 {
return fmt.Errorf("unsupported buffer flags %d", flags)
}
return nil
} | go | func checkBufferGenFlags(flags int) error {
if flags < 0 && flags > 4 {
return fmt.Errorf("unsupported buffer flags %d", flags)
}
return nil
} | [
"func",
"checkBufferGenFlags",
"(",
"flags",
"int",
")",
"error",
"{",
"if",
"flags",
"<",
"0",
"&&",
"flags",
">",
"4",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"flags",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // checkBufferGenFlags panics if not 0 <= flags <= 4 | [
"checkBufferGenFlags",
"panics",
"if",
"not",
"0",
"<",
"=",
"flags",
"<",
"=",
"4"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/buffer.go#L139-L144 |
148,824 | scgolang/sc | c.go | Add | func (c C) Add(val Input) Input {
if v, ok := val.(C); ok {
return C(float32(v) + float32(c))
}
return val.Add(c)
} | go | func (c C) Add(val Input) Input {
if v, ok := val.(C); ok {
return C(float32(v) + float32(c))
}
return val.Add(c)
} | [
"func",
"(",
"c",
"C",
")",
"Add",
"(",
"val",
"Input",
")",
"Input",
"{",
"if",
"v",
",",
"ok",
":=",
"val",
".",
"(",
"C",
")",
";",
"ok",
"{",
"return",
"C",
"(",
"float32",
"(",
"v",
")",
"+",
"float32",
"(",
"c",
")",
")",
"\n",
"}",... | // Add adds another input to the constant. | [
"Add",
"adds",
"another",
"input",
"to",
"the",
"constant",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L30-L35 |
148,825 | scgolang/sc | c.go | Cos | func (c C) Cos() Input {
return C(float32(math.Cos(float64(c))))
} | go | func (c C) Cos() Input {
return C(float32(math.Cos(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Cos",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Cos",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Cos computes the cosine of an Input. | [
"Cos",
"computes",
"the",
"cosine",
"of",
"an",
"Input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L89-L91 |
148,826 | scgolang/sc | c.go | Cosh | func (c C) Cosh() Input {
return C(float32(math.Cosh(float64(c))))
} | go | func (c C) Cosh() Input {
return C(float32(math.Cosh(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Cosh",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Cosh",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Cosh computes the hyperboliccosine of an Input. | [
"Cosh",
"computes",
"the",
"hyperboliccosine",
"of",
"an",
"Input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L94-L96 |
148,827 | scgolang/sc | c.go | DbAmp | func (c C) DbAmp() Input {
return C(float32(math.Pow(10, float64(c)/20)))
} | go | func (c C) DbAmp() Input {
return C(float32(math.Pow(10, float64(c)/20)))
} | [
"func",
"(",
"c",
"C",
")",
"DbAmp",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Pow",
"(",
"10",
",",
"float64",
"(",
"c",
")",
"/",
"20",
")",
")",
")",
"\n",
"}"
] | // DbAmp converts decibels to linear amplitude. | [
"DbAmp",
"converts",
"decibels",
"to",
"linear",
"amplitude",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L114-L116 |
148,828 | scgolang/sc | c.go | Floor | func (c C) Floor() Input {
return C(float32(math.Floor(float64(c))))
} | go | func (c C) Floor() Input {
return C(float32(math.Floor(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Floor",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Floor",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Floor computes the floor of a constant. | [
"Floor",
"computes",
"the",
"floor",
"of",
"a",
"constant",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L158-L160 |
148,829 | scgolang/sc | c.go | Frac | func (c C) Frac() Input {
return C(float32(float64(c) - math.Trunc(float64(c))))
} | go | func (c C) Frac() Input {
return C(float32(float64(c) - math.Trunc(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Frac",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"float64",
"(",
"c",
")",
"-",
"math",
".",
"Trunc",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Frac returns the fractional part of a constant. | [
"Frac",
"returns",
"the",
"fractional",
"part",
"of",
"a",
"constant",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L171-L173 |
148,830 | scgolang/sc | c.go | Modulo | func (c C) Modulo(val Input) Input {
if v, ok := val.(C); ok {
return C(float32(int(c) % int(v)))
}
return c
} | go | func (c C) Modulo(val Input) Input {
if v, ok := val.(C); ok {
return C(float32(int(c) % int(v)))
}
return c
} | [
"func",
"(",
"c",
"C",
")",
"Modulo",
"(",
"val",
"Input",
")",
"Input",
"{",
"if",
"v",
",",
"ok",
":=",
"val",
".",
"(",
"C",
")",
";",
"ok",
"{",
"return",
"C",
"(",
"float32",
"(",
"int",
"(",
"c",
")",
"%",
"int",
"(",
"v",
")",
")",... | // Modulo computes the modulo of one signal and another.
// If val is not a C, then this method just returns the receiver.
// I'm not sure what a constant modulo a ugen should be.
// Note that Go only supports integers for the modulo operator. | [
"Modulo",
"computes",
"the",
"modulo",
"of",
"one",
"signal",
"and",
"another",
".",
"If",
"val",
"is",
"not",
"a",
"C",
"then",
"this",
"method",
"just",
"returns",
"the",
"receiver",
".",
"I",
"m",
"not",
"sure",
"what",
"a",
"constant",
"modulo",
"a... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L317-L322 |
148,831 | scgolang/sc | c.go | Mul | func (c C) Mul(val Input) Input {
if v, ok := val.(C); ok {
return C(float32(v) * float32(c))
}
return val.Mul(c)
} | go | func (c C) Mul(val Input) Input {
if v, ok := val.(C); ok {
return C(float32(v) * float32(c))
}
return val.Mul(c)
} | [
"func",
"(",
"c",
"C",
")",
"Mul",
"(",
"val",
"Input",
")",
"Input",
"{",
"if",
"v",
",",
"ok",
":=",
"val",
".",
"(",
"C",
")",
";",
"ok",
"{",
"return",
"C",
"(",
"float32",
"(",
"v",
")",
"*",
"float32",
"(",
"c",
")",
")",
"\n",
"}",... | // Mul multiplies the constant by another input. | [
"Mul",
"multiplies",
"the",
"constant",
"by",
"another",
"input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L325-L330 |
148,832 | scgolang/sc | c.go | MulAdd | func (c C) MulAdd(mul, add Input) Input {
if m, mok := mul.(C); mok {
if a, aok := add.(C); aok {
return C((float32(m) * float32(c)) + float32(a))
}
return add.MulAdd(c, mul)
}
return mul.MulAdd(c, add)
} | go | func (c C) MulAdd(mul, add Input) Input {
if m, mok := mul.(C); mok {
if a, aok := add.(C); aok {
return C((float32(m) * float32(c)) + float32(a))
}
return add.MulAdd(c, mul)
}
return mul.MulAdd(c, add)
} | [
"func",
"(",
"c",
"C",
")",
"MulAdd",
"(",
"mul",
",",
"add",
"Input",
")",
"Input",
"{",
"if",
"m",
",",
"mok",
":=",
"mul",
".",
"(",
"C",
")",
";",
"mok",
"{",
"if",
"a",
",",
"aok",
":=",
"add",
".",
"(",
"C",
")",
";",
"aok",
"{",
... | // MulAdd multiplies and adds at the same time. | [
"MulAdd",
"multiplies",
"and",
"adds",
"at",
"the",
"same",
"time",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L333-L341 |
148,833 | scgolang/sc | c.go | Sin | func (c C) Sin() Input {
return C(float32(math.Sin(float64(c))))
} | go | func (c C) Sin() Input {
return C(float32(math.Sin(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Sin",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Sin",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Sin computes the sine of an Input. | [
"Sin",
"computes",
"the",
"sine",
"of",
"an",
"Input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L443-L445 |
148,834 | scgolang/sc | c.go | Sinh | func (c C) Sinh() Input {
return C(float32(math.Sinh(float64(c))))
} | go | func (c C) Sinh() Input {
return C(float32(math.Sinh(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Sinh",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Sinh",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Sinh computes the hyperbolic sine of an Input. | [
"Sinh",
"computes",
"the",
"hyperbolic",
"sine",
"of",
"an",
"Input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L448-L450 |
148,835 | scgolang/sc | c.go | Tan | func (c C) Tan() Input {
return C(float32(math.Tan(float64(c))))
} | go | func (c C) Tan() Input {
return C(float32(math.Tan(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Tan",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Tan",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Tan computes the tangent of an Input. | [
"Tan",
"computes",
"the",
"tangent",
"of",
"an",
"Input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L493-L495 |
148,836 | scgolang/sc | c.go | Tanh | func (c C) Tanh() Input {
return C(float32(math.Tanh(float64(c))))
} | go | func (c C) Tanh() Input {
return C(float32(math.Tanh(float64(c))))
} | [
"func",
"(",
"c",
"C",
")",
"Tanh",
"(",
")",
"Input",
"{",
"return",
"C",
"(",
"float32",
"(",
"math",
".",
"Tanh",
"(",
"float64",
"(",
"c",
")",
")",
")",
")",
"\n",
"}"
] | // Tanh computes the hyperbolic tangent of an Input. | [
"Tanh",
"computes",
"the",
"hyperbolic",
"tangent",
"of",
"an",
"Input",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L498-L500 |
148,837 | scgolang/sc | c.go | Thresh | func (c C) Thresh(val Input) Input {
if v, ok := val.(C); ok {
if c < v {
return C(0)
}
return c
}
return val.GTE(c).Mul(c)
} | go | func (c C) Thresh(val Input) Input {
if v, ok := val.(C); ok {
if c < v {
return C(0)
}
return c
}
return val.GTE(c).Mul(c)
} | [
"func",
"(",
"c",
"C",
")",
"Thresh",
"(",
"val",
"Input",
")",
"Input",
"{",
"if",
"v",
",",
"ok",
":=",
"val",
".",
"(",
"C",
")",
";",
"ok",
"{",
"if",
"c",
"<",
"v",
"{",
"return",
"C",
"(",
"0",
")",
"\n",
"}",
"\n",
"return",
"c",
... | // Thresh returns 0 when c < val, otherwise c. | [
"Thresh",
"returns",
"0",
"when",
"c",
"<",
"val",
"otherwise",
"c",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L503-L511 |
148,838 | scgolang/sc | c.go | Trunc | func (c C) Trunc(val Input) Input {
if v, ok := val.(C); ok {
return C(Truncf(float32(c), float32(v)))
}
return c
} | go | func (c C) Trunc(val Input) Input {
if v, ok := val.(C); ok {
return C(Truncf(float32(c), float32(v)))
}
return c
} | [
"func",
"(",
"c",
"C",
")",
"Trunc",
"(",
"val",
"Input",
")",
"Input",
"{",
"if",
"v",
",",
"ok",
":=",
"val",
".",
"(",
"C",
")",
";",
"ok",
"{",
"return",
"C",
"(",
"Truncf",
"(",
"float32",
"(",
"c",
")",
",",
"float32",
"(",
"v",
")",
... | // Trunc performs quantization by truncation. Truncate c to a multiple of val.
// If val is not a constant, c is returned. | [
"Trunc",
"performs",
"quantization",
"by",
"truncation",
".",
"Truncate",
"c",
"to",
"a",
"multiple",
"of",
"val",
".",
"If",
"val",
"is",
"not",
"a",
"constant",
"c",
"is",
"returned",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L515-L520 |
148,839 | scgolang/sc | c.go | Roundf | func Roundf(a, b float32) float32 {
if b == 0 {
return 0
}
var m, v float32
for {
if b*m <= a {
if b*(m+1) > a {
if math.Abs(float64(a-b*m)) < math.Abs(float64(a-b*(m+1))) {
v = b * m
} else {
v = b * (m + 1)
}
break
}
m++
continue
}
m--
if b*m <= a {
if math.Abs(... | go | func Roundf(a, b float32) float32 {
if b == 0 {
return 0
}
var m, v float32
for {
if b*m <= a {
if b*(m+1) > a {
if math.Abs(float64(a-b*m)) < math.Abs(float64(a-b*(m+1))) {
v = b * m
} else {
v = b * (m + 1)
}
break
}
m++
continue
}
m--
if b*m <= a {
if math.Abs(... | [
"func",
"Roundf",
"(",
"a",
",",
"b",
"float32",
")",
"float32",
"{",
"if",
"b",
"==",
"0",
"{",
"return",
"0",
"\n",
"}",
"\n",
"var",
"m",
",",
"v",
"float32",
"\n\n",
"for",
"{",
"if",
"b",
"*",
"m",
"<=",
"a",
"{",
"if",
"b",
"*",
"(",
... | // Roundf rounds a to the nearest multiple of b. | [
"Roundf",
"rounds",
"a",
"to",
"the",
"nearest",
"multiple",
"of",
"b",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L531-L561 |
148,840 | scgolang/sc | c.go | Truncf | func Truncf(a, b float32) float32 {
if b == 0 {
return 0
}
var m, v float32
for {
if b*m <= a {
if b*(m+1) > a {
v = b * m
break
}
m++
continue
}
m--
if b*m <= a {
v = b * m
break
}
}
return v
} | go | func Truncf(a, b float32) float32 {
if b == 0 {
return 0
}
var m, v float32
for {
if b*m <= a {
if b*(m+1) > a {
v = b * m
break
}
m++
continue
}
m--
if b*m <= a {
v = b * m
break
}
}
return v
} | [
"func",
"Truncf",
"(",
"a",
",",
"b",
"float32",
")",
"float32",
"{",
"if",
"b",
"==",
"0",
"{",
"return",
"0",
"\n",
"}",
"\n",
"var",
"m",
",",
"v",
"float32",
"\n\n",
"for",
"{",
"if",
"b",
"*",
"m",
"<=",
"a",
"{",
"if",
"b",
"*",
"(",
... | // Truncf returns the next highest multiple of b that is < a. | [
"Truncf",
"returns",
"the",
"next",
"highest",
"multiple",
"of",
"b",
"that",
"is",
"<",
"a",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/c.go#L564-L586 |
148,841 | scgolang/sc | synthdef_write.go | writeHead | func (def *Synthdef) writeHead(w io.Writer) error {
written, err := w.Write(bytes.NewBufferString(synthdefStart).Bytes())
if err != nil {
return err
}
if written != len(synthdefStart) {
return fmt.Errorf("Could not write synthdef")
}
// write synthdef version
if err := binary.Write(w, byteOrder, int32(synthd... | go | func (def *Synthdef) writeHead(w io.Writer) error {
written, err := w.Write(bytes.NewBufferString(synthdefStart).Bytes())
if err != nil {
return err
}
if written != len(synthdefStart) {
return fmt.Errorf("Could not write synthdef")
}
// write synthdef version
if err := binary.Write(w, byteOrder, int32(synthd... | [
"func",
"(",
"def",
"*",
"Synthdef",
")",
"writeHead",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"written",
",",
"err",
":=",
"w",
".",
"Write",
"(",
"bytes",
".",
"NewBufferString",
"(",
"synthdefStart",
")",
".",
"Bytes",
"(",
")",
")",
"... | // writeHead writes everything leading up to the synthdef name
// to an io.Writer. | [
"writeHead",
"writes",
"everything",
"leading",
"up",
"to",
"the",
"synthdef",
"name",
"to",
"an",
"io",
".",
"Writer",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_write.go#L55-L72 |
148,842 | scgolang/sc | synthdef_write.go | writeConstants | func (def *Synthdef) writeConstants(w io.Writer) error {
// write number of constants
if err := binary.Write(w, byteOrder, int32(len(def.Constants))); err != nil {
return err
}
// write constant values
for _, constant := range def.Constants {
if err := binary.Write(w, byteOrder, constant); err != nil {
retu... | go | func (def *Synthdef) writeConstants(w io.Writer) error {
// write number of constants
if err := binary.Write(w, byteOrder, int32(len(def.Constants))); err != nil {
return err
}
// write constant values
for _, constant := range def.Constants {
if err := binary.Write(w, byteOrder, constant); err != nil {
retu... | [
"func",
"(",
"def",
"*",
"Synthdef",
")",
"writeConstants",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"// write number of constants",
"if",
"err",
":=",
"binary",
".",
"Write",
"(",
"w",
",",
"byteOrder",
",",
"int32",
"(",
"len",
"(",
"def",
"... | // writeConstants writes the number of constants and the values
// to an io.Writer. | [
"writeConstants",
"writes",
"the",
"number",
"of",
"constants",
"and",
"the",
"values",
"to",
"an",
"io",
".",
"Writer",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_write.go#L76-L88 |
148,843 | scgolang/sc | synthdef_write.go | writeParams | func (def *Synthdef) writeParams(w io.Writer) error {
// write number of params
if err := binary.Write(w, byteOrder, int32(len(def.ParamNames))); err != nil {
return err
}
// write initial param values
for _, val := range def.InitialParamValues {
if err := binary.Write(w, byteOrder, val); err != nil {
retur... | go | func (def *Synthdef) writeParams(w io.Writer) error {
// write number of params
if err := binary.Write(w, byteOrder, int32(len(def.ParamNames))); err != nil {
return err
}
// write initial param values
for _, val := range def.InitialParamValues {
if err := binary.Write(w, byteOrder, val); err != nil {
retur... | [
"func",
"(",
"def",
"*",
"Synthdef",
")",
"writeParams",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"// write number of params",
"if",
"err",
":=",
"binary",
".",
"Write",
"(",
"w",
",",
"byteOrder",
",",
"int32",
"(",
"len",
"(",
"def",
".",
... | // writeParams writes the number of synthdef params,
// the initial param values, and the param names
// to an io.Writer. | [
"writeParams",
"writes",
"the",
"number",
"of",
"synthdef",
"params",
"the",
"initial",
"param",
"values",
"and",
"the",
"param",
"names",
"to",
"an",
"io",
".",
"Writer",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_write.go#L93-L115 |
148,844 | scgolang/sc | synthdef_write.go | WriteJSON | func (def *Synthdef) WriteJSON(w io.Writer) error {
enc := json.NewEncoder(w)
return enc.Encode(def)
} | go | func (def *Synthdef) WriteJSON(w io.Writer) error {
enc := json.NewEncoder(w)
return enc.Encode(def)
} | [
"func",
"(",
"def",
"*",
"Synthdef",
")",
"WriteJSON",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"enc",
":=",
"json",
".",
"NewEncoder",
"(",
"w",
")",
"\n",
"return",
"enc",
".",
"Encode",
"(",
"def",
")",
"\n",
"}"
] | // WriteJSON writes a json-formatted representation of a
// synthdef to an io.Writer. | [
"WriteJSON",
"writes",
"a",
"json",
"-",
"formatted",
"representation",
"of",
"a",
"synthdef",
"to",
"an",
"io",
".",
"Writer",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_write.go#L119-L122 |
148,845 | scgolang/sc | synthdef_write.go | WriteXML | func (def *Synthdef) WriteXML(w io.Writer) error {
enc := xml.NewEncoder(w)
return enc.Encode(def)
} | go | func (def *Synthdef) WriteXML(w io.Writer) error {
enc := xml.NewEncoder(w)
return enc.Encode(def)
} | [
"func",
"(",
"def",
"*",
"Synthdef",
")",
"WriteXML",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"enc",
":=",
"xml",
".",
"NewEncoder",
"(",
"w",
")",
"\n",
"return",
"enc",
".",
"Encode",
"(",
"def",
")",
"\n",
"}"
] | // WriteXML writes an xml-formatted representation of a synthdef
// to an io.Writer. | [
"WriteXML",
"writes",
"an",
"xml",
"-",
"formatted",
"representation",
"of",
"a",
"synthdef",
"to",
"an",
"io",
".",
"Writer",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_write.go#L126-L129 |
148,846 | scgolang/sc | ballpass.go | Rate | func (b BAllPass) Rate(rate int8) Input {
CheckRate(rate)
if b.In == nil {
panic("BAllpass expects In to not be nil")
}
(&b).defaults()
return NewInput("BAllPass", rate, 0, 1, b.In, b.Freq, b.RQ)
} | go | func (b BAllPass) Rate(rate int8) Input {
CheckRate(rate)
if b.In == nil {
panic("BAllpass expects In to not be nil")
}
(&b).defaults()
return NewInput("BAllPass", rate, 0, 1, b.In, b.Freq, b.RQ)
} | [
"func",
"(",
"b",
"BAllPass",
")",
"Rate",
"(",
"rate",
"int8",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n\n",
"if",
"b",
".",
"In",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"(",
"&",
"b",
")",
".",
"defaul... | // Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
// This method will also panic if In is nil. | [
"Rate",
"creates",
"a",
"new",
"ugen",
"at",
"a",
"specific",
"rate",
".",
"If",
"rate",
"is",
"an",
"unsupported",
"value",
"this",
"method",
"will",
"cause",
"a",
"runtime",
"panic",
".",
"This",
"method",
"will",
"also",
"panic",
"if",
"In",
"is",
"... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ballpass.go#L34-L44 |
148,847 | scgolang/sc | allpass.go | Rate | func (apc Allpass) Rate(rate int8) Input {
if apc.In == nil {
panic("Allpass expects In to not be nil")
}
CheckRate(rate)
(&apc).defaults()
switch apc.Interpolation {
case InterpolationNone:
return NewInput("AllpassN", rate, 0, 1, apc.In, apc.MaxDelayTime, apc.DelayTime, apc.DecayTime)
case InterpolationLi... | go | func (apc Allpass) Rate(rate int8) Input {
if apc.In == nil {
panic("Allpass expects In to not be nil")
}
CheckRate(rate)
(&apc).defaults()
switch apc.Interpolation {
case InterpolationNone:
return NewInput("AllpassN", rate, 0, 1, apc.In, apc.MaxDelayTime, apc.DelayTime, apc.DecayTime)
case InterpolationLi... | [
"func",
"(",
"apc",
"Allpass",
")",
"Rate",
"(",
"rate",
"int8",
")",
"Input",
"{",
"if",
"apc",
".",
"In",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"CheckRate",
"(",
"rate",
")",
"\n\n",
"(",
"&",
"apc",
")",
".",
"d... | // Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
// If an In signal is not provided this method will panic.
// If Interpolation is set to an unsupported value this method will panic. | [
"Rate",
"creates",
"a",
"new",
"ugen",
"at",
"a",
"specific",
"rate",
".",
"If",
"rate",
"is",
"an",
"unsupported",
"value",
"this",
"method",
"will",
"cause",
"a",
"runtime",
"panic",
".",
"If",
"an",
"In",
"signal",
"is",
"not",
"provided",
"this",
"... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/allpass.go#L43-L61 |
148,848 | scgolang/sc | synth.go | Set | func (s *Synth) Set(ctls map[string]float32) error {
msg := osc.Message{
Address: setSynthNodeAddress,
Arguments: osc.Arguments{
osc.Int(s.ID),
},
}
for name, value := range ctls {
msg.Arguments = append(msg.Arguments, osc.String(name))
msg.Arguments = append(msg.Arguments, osc.Float(value))
}
return ... | go | func (s *Synth) Set(ctls map[string]float32) error {
msg := osc.Message{
Address: setSynthNodeAddress,
Arguments: osc.Arguments{
osc.Int(s.ID),
},
}
for name, value := range ctls {
msg.Arguments = append(msg.Arguments, osc.String(name))
msg.Arguments = append(msg.Arguments, osc.Float(value))
}
return ... | [
"func",
"(",
"s",
"*",
"Synth",
")",
"Set",
"(",
"ctls",
"map",
"[",
"string",
"]",
"float32",
")",
"error",
"{",
"msg",
":=",
"osc",
".",
"Message",
"{",
"Address",
":",
"setSynthNodeAddress",
",",
"Arguments",
":",
"osc",
".",
"Arguments",
"{",
"os... | // Set the value of a synth control. | [
"Set",
"the",
"value",
"of",
"a",
"synth",
"control",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synth.go#L32-L44 |
148,849 | scgolang/sc | synth.go | newSynth | func newSynth(client *Client, defName string, id int32) *Synth {
return &Synth{
DefName: defName,
ID: id,
client: client,
}
} | go | func newSynth(client *Client, defName string, id int32) *Synth {
return &Synth{
DefName: defName,
ID: id,
client: client,
}
} | [
"func",
"newSynth",
"(",
"client",
"*",
"Client",
",",
"defName",
"string",
",",
"id",
"int32",
")",
"*",
"Synth",
"{",
"return",
"&",
"Synth",
"{",
"DefName",
":",
"defName",
",",
"ID",
":",
"id",
",",
"client",
":",
"client",
",",
"}",
"\n",
"}"
... | // newSynth creates a new synth structure. | [
"newSynth",
"creates",
"a",
"new",
"synth",
"structure",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synth.go#L47-L53 |
148,850 | scgolang/sc | comb.go | Rate | func (comb Comb) Rate(rate int8) Input {
CheckRate(rate)
if comb.In == nil {
panic("Comb expects In to not be nil")
}
if comb.MaxDelayTime == nil {
comb.MaxDelayTime = C(0.2)
}
if comb.DelayTime == nil {
comb.DelayTime = C(0.2)
}
if comb.DecayTime == nil {
comb.DecayTime = C(1)
}
switch comb.Interpola... | go | func (comb Comb) Rate(rate int8) Input {
CheckRate(rate)
if comb.In == nil {
panic("Comb expects In to not be nil")
}
if comb.MaxDelayTime == nil {
comb.MaxDelayTime = C(0.2)
}
if comb.DelayTime == nil {
comb.DelayTime = C(0.2)
}
if comb.DecayTime == nil {
comb.DecayTime = C(1)
}
switch comb.Interpola... | [
"func",
"(",
"comb",
"Comb",
")",
"Rate",
"(",
"rate",
"int8",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"if",
"comb",
".",
"In",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"comb",
".",
"MaxDelayTime",
... | // Rate creates a new ugen at a specific rate.
// If an In signal is not provided this method will
// trigger a runtime panic.
// If Interpolation is an unsupported value, then
// this method will trigger a runtime panic. | [
"Rate",
"creates",
"a",
"new",
"ugen",
"at",
"a",
"specific",
"rate",
".",
"If",
"an",
"In",
"signal",
"is",
"not",
"provided",
"this",
"method",
"will",
"trigger",
"a",
"runtime",
"panic",
".",
"If",
"Interpolation",
"is",
"an",
"unsupported",
"value",
... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/comb.go#L27-L51 |
148,851 | scgolang/sc | fft.go | Rate | func (fft FFT) Rate(rate int8) Input {
CheckRate(rate)
if fft.Buffer == nil {
panic("FFT expects Buffer to not be nil")
}
if fft.In == nil {
panic("FFT expects In to not be nil")
}
(&fft).defaults()
return NewInput("FFT", rate, 0, 1, fft.Buffer, fft.In, fft.Hop, fft.WinType, fft.Active, fft.WinSize)
} | go | func (fft FFT) Rate(rate int8) Input {
CheckRate(rate)
if fft.Buffer == nil {
panic("FFT expects Buffer to not be nil")
}
if fft.In == nil {
panic("FFT expects In to not be nil")
}
(&fft).defaults()
return NewInput("FFT", rate, 0, 1, fft.Buffer, fft.In, fft.Hop, fft.WinType, fft.Active, fft.WinSize)
} | [
"func",
"(",
"fft",
"FFT",
")",
"Rate",
"(",
"rate",
"int8",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"if",
"fft",
".",
"Buffer",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"fft",
".",
"In",
"==",
"... | // Rate creates a new ugen at a specific rate.
// If an In signal or Buffer is not provided this method will trigger a runtime panic. | [
"Rate",
"creates",
"a",
"new",
"ugen",
"at",
"a",
"specific",
"rate",
".",
"If",
"an",
"In",
"signal",
"or",
"Buffer",
"is",
"not",
"provided",
"this",
"method",
"will",
"trigger",
"a",
"runtime",
"panic",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/fft.go#L49-L59 |
148,852 | scgolang/sc | pv_brickwall.go | Rate | func (bw PVBrickWall) Rate(rate int8) Input {
CheckRate(rate)
if bw.Buffer == nil {
panic("PVBrickWall requires a Buffer parameter")
}
(&bw).defaults()
return NewInput("PV_BrickWall", rate, 0, 1, bw.Buffer, bw.Wipe)
} | go | func (bw PVBrickWall) Rate(rate int8) Input {
CheckRate(rate)
if bw.Buffer == nil {
panic("PVBrickWall requires a Buffer parameter")
}
(&bw).defaults()
return NewInput("PV_BrickWall", rate, 0, 1, bw.Buffer, bw.Wipe)
} | [
"func",
"(",
"bw",
"PVBrickWall",
")",
"Rate",
"(",
"rate",
"int8",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"if",
"bw",
".",
"Buffer",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"(",
"&",
"bw",
")",
".",
... | // Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
// If Buffer is nil this method will panic. | [
"Rate",
"creates",
"a",
"new",
"ugen",
"at",
"a",
"specific",
"rate",
".",
"If",
"rate",
"is",
"an",
"unsupported",
"value",
"this",
"method",
"will",
"cause",
"a",
"runtime",
"panic",
".",
"If",
"Buffer",
"is",
"nil",
"this",
"method",
"will",
"panic",
... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/pv_brickwall.go#L24-L31 |
148,853 | scgolang/sc | ugenInput.go | NewInput | func NewInput(name string, rate int8, specialIndex int16, numOutputs int, inputs ...Input) Input {
var (
expanded = expandInputs(inputs...)
l = len(expanded)
)
if l == 1 {
return NewUgen(name, rate, specialIndex, numOutputs, inputs...)
}
a := make([]Input, l)
for i := range a {
a[i] = NewUgen(name,... | go | func NewInput(name string, rate int8, specialIndex int16, numOutputs int, inputs ...Input) Input {
var (
expanded = expandInputs(inputs...)
l = len(expanded)
)
if l == 1 {
return NewUgen(name, rate, specialIndex, numOutputs, inputs...)
}
a := make([]Input, l)
for i := range a {
a[i] = NewUgen(name,... | [
"func",
"NewInput",
"(",
"name",
"string",
",",
"rate",
"int8",
",",
"specialIndex",
"int16",
",",
"numOutputs",
"int",
",",
"inputs",
"...",
"Input",
")",
"Input",
"{",
"var",
"(",
"expanded",
"=",
"expandInputs",
"(",
"inputs",
"...",
")",
"\n",
"l",
... | // NewInput creates a ugen suitable for use as an input to other ugens.
// It will return either a single-channel ugen or a multi-channel ugen. | [
"NewInput",
"creates",
"a",
"ugen",
"suitable",
"for",
"use",
"as",
"an",
"input",
"to",
"other",
"ugens",
".",
"It",
"will",
"return",
"either",
"a",
"single",
"-",
"channel",
"ugen",
"or",
"a",
"multi",
"-",
"channel",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugenInput.go#L10-L23 |
148,854 | scgolang/sc | ugenInput.go | expandInputs | func expandInputs(inputs ...Input) [][]Input {
// first pass to determine how large each array needs to be
// this could probably be more efficient
sz := 0
for _, in := range inputs {
if multi, isMulti := in.(MultiInput); isMulti {
ins := multi.InputArray()
l := len(ins)
if l > sz {
sz = l
}
}
... | go | func expandInputs(inputs ...Input) [][]Input {
// first pass to determine how large each array needs to be
// this could probably be more efficient
sz := 0
for _, in := range inputs {
if multi, isMulti := in.(MultiInput); isMulti {
ins := multi.InputArray()
l := len(ins)
if l > sz {
sz = l
}
}
... | [
"func",
"expandInputs",
"(",
"inputs",
"...",
"Input",
")",
"[",
"]",
"[",
"]",
"Input",
"{",
"// first pass to determine how large each array needs to be",
"// this could probably be more efficient",
"sz",
":=",
"0",
"\n",
"for",
"_",
",",
"in",
":=",
"range",
"inp... | // expandInputs turns an array of inputs into a 2-dimensional array
// of inputs where the 1st dimension is the channel and
// the second is the array of inputs for each channel. | [
"expandInputs",
"turns",
"an",
"array",
"of",
"inputs",
"into",
"a",
"2",
"-",
"dimensional",
"array",
"of",
"inputs",
"where",
"the",
"1st",
"dimension",
"is",
"the",
"channel",
"and",
"the",
"second",
"is",
"the",
"array",
"of",
"inputs",
"for",
"each",
... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugenInput.go#L28-L65 |
148,855 | scgolang/sc | ugenInput.go | Write | func (ui UgenInput) Write(w io.Writer) error {
if we := binary.Write(w, byteOrder, ui.UgenIndex); we != nil {
return we
}
return binary.Write(w, byteOrder, ui.OutputIndex)
} | go | func (ui UgenInput) Write(w io.Writer) error {
if we := binary.Write(w, byteOrder, ui.UgenIndex); we != nil {
return we
}
return binary.Write(w, byteOrder, ui.OutputIndex)
} | [
"func",
"(",
"ui",
"UgenInput",
")",
"Write",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"if",
"we",
":=",
"binary",
".",
"Write",
"(",
"w",
",",
"byteOrder",
",",
"ui",
".",
"UgenIndex",
")",
";",
"we",
"!=",
"nil",
"{",
"return",
"we",
... | // Write writes an input to an io.Writer | [
"Write",
"writes",
"an",
"input",
"to",
"an",
"io",
".",
"Writer"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/ugenInput.go#L79-L84 |
148,856 | scgolang/sc | group.go | Synth | func (g *GroupNode) Synth(defName string, id, action int32, ctls map[string]float32) (*Synth, error) {
return g.client.Synth(defName, id, action, g.id, ctls)
} | go | func (g *GroupNode) Synth(defName string, id, action int32, ctls map[string]float32) (*Synth, error) {
return g.client.Synth(defName, id, action, g.id, ctls)
} | [
"func",
"(",
"g",
"*",
"GroupNode",
")",
"Synth",
"(",
"defName",
"string",
",",
"id",
",",
"action",
"int32",
",",
"ctls",
"map",
"[",
"string",
"]",
"float32",
")",
"(",
"*",
"Synth",
",",
"error",
")",
"{",
"return",
"g",
".",
"client",
".",
"... | // Synth adds a synth to a group | [
"Synth",
"adds",
"a",
"synth",
"to",
"a",
"group"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/group.go#L68-L70 |
148,857 | scgolang/sc | group.go | newGroup | func newGroup(client *Client, id int32) *GroupNode {
return &GroupNode{
client: client,
id: id,
}
} | go | func newGroup(client *Client, id int32) *GroupNode {
return &GroupNode{
client: client,
id: id,
}
} | [
"func",
"newGroup",
"(",
"client",
"*",
"Client",
",",
"id",
"int32",
")",
"*",
"GroupNode",
"{",
"return",
"&",
"GroupNode",
"{",
"client",
":",
"client",
",",
"id",
":",
"id",
",",
"}",
"\n",
"}"
] | // newGroup creates a new Group structure | [
"newGroup",
"creates",
"a",
"new",
"Group",
"structure"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/group.go#L81-L86 |
148,858 | scgolang/sc | synthdef_read.go | ReadSynthdef | func ReadSynthdef(r io.Reader) (*Synthdef, error) {
// read the type
if err := readSynthdefType(r); err != nil {
return nil, err
}
// read version
if err := readSynthdefVersion(r); err != nil {
return nil, err
}
// read number of synth defs
if err := readNumberOfSynthdefs(r); err != nil {
return nil, err
... | go | func ReadSynthdef(r io.Reader) (*Synthdef, error) {
// read the type
if err := readSynthdefType(r); err != nil {
return nil, err
}
// read version
if err := readSynthdefVersion(r); err != nil {
return nil, err
}
// read number of synth defs
if err := readNumberOfSynthdefs(r); err != nil {
return nil, err
... | [
"func",
"ReadSynthdef",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"*",
"Synthdef",
",",
"error",
")",
"{",
"// read the type",
"if",
"err",
":=",
"readSynthdefType",
"(",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
... | // ReadSynthdef reads a synthdef from an io.Reader | [
"ReadSynthdef",
"reads",
"a",
"synthdef",
"from",
"an",
"io",
".",
"Reader"
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L11-L57 |
148,859 | scgolang/sc | synthdef_read.go | readSynthdefType | func readSynthdefType(r io.Reader) error {
startLen := len(synthdefStart)
start := make([]byte, startLen)
read, err := r.Read(start)
if err != nil {
return err
}
if read != startLen {
return fmt.Errorf("Only read %d bytes of synthdef file", read)
}
if actual := bytes.NewBuffer(start).String(); actual != syn... | go | func readSynthdefType(r io.Reader) error {
startLen := len(synthdefStart)
start := make([]byte, startLen)
read, err := r.Read(start)
if err != nil {
return err
}
if read != startLen {
return fmt.Errorf("Only read %d bytes of synthdef file", read)
}
if actual := bytes.NewBuffer(start).String(); actual != syn... | [
"func",
"readSynthdefType",
"(",
"r",
"io",
".",
"Reader",
")",
"error",
"{",
"startLen",
":=",
"len",
"(",
"synthdefStart",
")",
"\n",
"start",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"startLen",
")",
"\n",
"read",
",",
"err",
":=",
"r",
".",
"R... | // readSynthdefType reads the first 4 bytes of a synthdef file
// and returns an error if it isn't a supported type.
// Otherwise it returns nil. | [
"readSynthdefType",
"reads",
"the",
"first",
"4",
"bytes",
"of",
"a",
"synthdef",
"file",
"and",
"returns",
"an",
"error",
"if",
"it",
"isn",
"t",
"a",
"supported",
"type",
".",
"Otherwise",
"it",
"returns",
"nil",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L62-L76 |
148,860 | scgolang/sc | synthdef_read.go | readSynthdefVersion | func readSynthdefVersion(r io.Reader) error {
var version int32
if err := binary.Read(r, byteOrder, &version); err != nil {
return err
}
if version != synthdefVersion {
return fmt.Errorf("bad synthdef version %d", version)
}
return nil
} | go | func readSynthdefVersion(r io.Reader) error {
var version int32
if err := binary.Read(r, byteOrder, &version); err != nil {
return err
}
if version != synthdefVersion {
return fmt.Errorf("bad synthdef version %d", version)
}
return nil
} | [
"func",
"readSynthdefVersion",
"(",
"r",
"io",
".",
"Reader",
")",
"error",
"{",
"var",
"version",
"int32",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"r",
",",
"byteOrder",
",",
"&",
"version",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
... | // readSynthdefVersion reads the version of a synthdef file
// and returns an error if it is an unsupported version.
// Otherwise it returns nil. | [
"readSynthdefVersion",
"reads",
"the",
"version",
"of",
"a",
"synthdef",
"file",
"and",
"returns",
"an",
"error",
"if",
"it",
"is",
"an",
"unsupported",
"version",
".",
"Otherwise",
"it",
"returns",
"nil",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L81-L90 |
148,861 | scgolang/sc | synthdef_read.go | readNumberOfSynthdefs | func readNumberOfSynthdefs(r io.Reader) error {
var numDefs int16
if err := binary.Read(r, byteOrder, &numDefs); err != nil {
return err
}
if numDefs != 1 {
return fmt.Errorf("multiple synthdefs not supported")
}
return nil
} | go | func readNumberOfSynthdefs(r io.Reader) error {
var numDefs int16
if err := binary.Read(r, byteOrder, &numDefs); err != nil {
return err
}
if numDefs != 1 {
return fmt.Errorf("multiple synthdefs not supported")
}
return nil
} | [
"func",
"readNumberOfSynthdefs",
"(",
"r",
"io",
".",
"Reader",
")",
"error",
"{",
"var",
"numDefs",
"int16",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"r",
",",
"byteOrder",
",",
"&",
"numDefs",
")",
";",
"err",
"!=",
"nil",
"{",
"return"... | // readNumberOfSynthdefs reads the number of synthdefs in
// a particular synthdef file.
// We only support 1 synthdef per file, so if this number is not 1
// this func will return an error. | [
"readNumberOfSynthdefs",
"reads",
"the",
"number",
"of",
"synthdefs",
"in",
"a",
"particular",
"synthdef",
"file",
".",
"We",
"only",
"support",
"1",
"synthdef",
"per",
"file",
"so",
"if",
"this",
"number",
"is",
"not",
"1",
"this",
"func",
"will",
"return",... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L96-L105 |
148,862 | scgolang/sc | synthdef_read.go | readSynthdefConstants | func readSynthdefConstants(r io.Reader) ([]float32, error) {
// read number of constants
var numConstants int32
if err := binary.Read(r, byteOrder, &numConstants); err != nil {
return nil, err
}
// read constants
constants := make([]float32, numConstants)
for i := 0; i < int(numConstants); i++ {
if err := bi... | go | func readSynthdefConstants(r io.Reader) ([]float32, error) {
// read number of constants
var numConstants int32
if err := binary.Read(r, byteOrder, &numConstants); err != nil {
return nil, err
}
// read constants
constants := make([]float32, numConstants)
for i := 0; i < int(numConstants); i++ {
if err := bi... | [
"func",
"readSynthdefConstants",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"[",
"]",
"float32",
",",
"error",
")",
"{",
"// read number of constants",
"var",
"numConstants",
"int32",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"r",
",",
"byteOrder"... | // readSynthdefConstants reads the constants of a synthdef. | [
"readSynthdefConstants",
"reads",
"the",
"constants",
"of",
"a",
"synthdef",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L108-L122 |
148,863 | scgolang/sc | synthdef_read.go | readSynthdefParams | func readSynthdefParams(r io.Reader) ([]float32, []ParamName, error) {
// read number of parameters
var numParams int32
if err := binary.Read(r, byteOrder, &numParams); err != nil {
return nil, nil, err
}
// read initial parameter values
initialValues := make([]float32, numParams)
for i := 0; i < int(numParams... | go | func readSynthdefParams(r io.Reader) ([]float32, []ParamName, error) {
// read number of parameters
var numParams int32
if err := binary.Read(r, byteOrder, &numParams); err != nil {
return nil, nil, err
}
// read initial parameter values
initialValues := make([]float32, numParams)
for i := 0; i < int(numParams... | [
"func",
"readSynthdefParams",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"[",
"]",
"float32",
",",
"[",
"]",
"ParamName",
",",
"error",
")",
"{",
"// read number of parameters",
"var",
"numParams",
"int32",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"... | // readSynthdefParams reads the initial param values and param names
// of a synthdef. | [
"readSynthdefParams",
"reads",
"the",
"initial",
"param",
"values",
"and",
"param",
"names",
"of",
"a",
"synthdef",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L126-L154 |
148,864 | scgolang/sc | synthdef_read.go | readSynthdefUgens | func readSynthdefUgens(r io.Reader) ([]*Ugen, error) {
// read number of ugens
var numUgens int32
if err := binary.Read(r, byteOrder, &numUgens); err != nil {
return nil, err
}
// read ugens
ugens := make([]*Ugen, numUgens)
for i := 0; int32(i) < numUgens; i++ {
ugen, err := readUgen(r)
if err != nil {
... | go | func readSynthdefUgens(r io.Reader) ([]*Ugen, error) {
// read number of ugens
var numUgens int32
if err := binary.Read(r, byteOrder, &numUgens); err != nil {
return nil, err
}
// read ugens
ugens := make([]*Ugen, numUgens)
for i := 0; int32(i) < numUgens; i++ {
ugen, err := readUgen(r)
if err != nil {
... | [
"func",
"readSynthdefUgens",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"[",
"]",
"*",
"Ugen",
",",
"error",
")",
"{",
"// read number of ugens",
"var",
"numUgens",
"int32",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"r",
",",
"byteOrder",
",",... | // readSynthdefUgens reads the ugens of a synthdef. | [
"readSynthdefUgens",
"reads",
"the",
"ugens",
"of",
"a",
"synthdef",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L157-L173 |
148,865 | scgolang/sc | synthdef_read.go | readSynthdefVariants | func readSynthdefVariants(r io.Reader, numParams int) ([]*Variant, error) {
// read number of variants
var numVariants int16
if err := binary.Read(r, byteOrder, &numVariants); err != nil {
return nil, err
}
// read variants
variants := make([]*Variant, numVariants)
for i := 0; int16(i) < numVariants; i++ {
v... | go | func readSynthdefVariants(r io.Reader, numParams int) ([]*Variant, error) {
// read number of variants
var numVariants int16
if err := binary.Read(r, byteOrder, &numVariants); err != nil {
return nil, err
}
// read variants
variants := make([]*Variant, numVariants)
for i := 0; int16(i) < numVariants; i++ {
v... | [
"func",
"readSynthdefVariants",
"(",
"r",
"io",
".",
"Reader",
",",
"numParams",
"int",
")",
"(",
"[",
"]",
"*",
"Variant",
",",
"error",
")",
"{",
"// read number of variants",
"var",
"numVariants",
"int16",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",... | // readSynthdefVariants reads the variants of a synthdef. | [
"readSynthdefVariants",
"reads",
"the",
"variants",
"of",
"a",
"synthdef",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/synthdef_read.go#L176-L192 |
148,866 | scgolang/sc | rate.go | CheckRate | func CheckRate(rate int8) {
if rate != IR && rate != KR && rate != AR {
panic(fmt.Errorf("Unsupported rate %d", rate))
}
} | go | func CheckRate(rate int8) {
if rate != IR && rate != KR && rate != AR {
panic(fmt.Errorf("Unsupported rate %d", rate))
}
} | [
"func",
"CheckRate",
"(",
"rate",
"int8",
")",
"{",
"if",
"rate",
"!=",
"IR",
"&&",
"rate",
"!=",
"KR",
"&&",
"rate",
"!=",
"AR",
"{",
"panic",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"rate",
")",
")",
"\n",
"}",
"\n",
"}"
] | // CheckRate causes a panic if rate is not IR, KR, or AR. | [
"CheckRate",
"causes",
"a",
"panic",
"if",
"rate",
"is",
"not",
"IR",
"KR",
"or",
"AR",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/rate.go#L17-L21 |
148,867 | scgolang/sc | hasher.go | Rate | func (hasher Hasher) Rate(rate int8) Input {
CheckRate(rate)
if hasher.In == nil {
panic("Hasher requires an input signal")
}
return NewInput("Hasher", rate, 0, 1, hasher.In)
} | go | func (hasher Hasher) Rate(rate int8) Input {
CheckRate(rate)
if hasher.In == nil {
panic("Hasher requires an input signal")
}
return NewInput("Hasher", rate, 0, 1, hasher.In)
} | [
"func",
"(",
"hasher",
"Hasher",
")",
"Rate",
"(",
"rate",
"int8",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"if",
"hasher",
".",
"In",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"NewInput",
"(",
"\"... | // Rate creates a new ugen at a specific rate.
// If rate is an unsupported value this method will cause a runtime panic.
// If the input signal is nil then this method will cause a runtime panic. | [
"Rate",
"creates",
"a",
"new",
"ugen",
"at",
"a",
"specific",
"rate",
".",
"If",
"rate",
"is",
"an",
"unsupported",
"value",
"this",
"method",
"will",
"cause",
"a",
"runtime",
"panic",
".",
"If",
"the",
"input",
"signal",
"is",
"nil",
"then",
"this",
"... | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/hasher.go#L14-L20 |
148,868 | scgolang/sc | operators.go | binOpAbsdif | func binOpAbsdif(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpAbsdif, numOutputs, x, y)
} | go | func binOpAbsdif(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpAbsdif, numOutputs, x, y)
} | [
"func",
"binOpAbsdif",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpAbsdif",
",",
"numOutputs",
","... | // binOpAbsdif returns the absolute value of the difference of two inputs. | [
"binOpAbsdif",
"returns",
"the",
"absolute",
"value",
"of",
"the",
"difference",
"of",
"two",
"inputs",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L89-L92 |
148,869 | scgolang/sc | operators.go | binOpAdd | func binOpAdd(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpAdd, numOutputs, x, y)
} | go | func binOpAdd(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpAdd, numOutputs, x, y)
} | [
"func",
"binOpAdd",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpAdd",
",",
"numOutputs",
",",
"x... | // binOpAdd creates a BinaryOpUGen that represents addition. | [
"binOpAdd",
"creates",
"a",
"BinaryOpUGen",
"that",
"represents",
"addition",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L95-L98 |
148,870 | scgolang/sc | operators.go | binOpDifsqr | func binOpDifsqr(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpDifsqr, numOutputs, x, y)
} | go | func binOpDifsqr(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpDifsqr, numOutputs, x, y)
} | [
"func",
"binOpDifsqr",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpDifsqr",
",",
"numOutputs",
","... | // binOpDifsqr computes a difference of squares. | [
"binOpDifsqr",
"computes",
"a",
"difference",
"of",
"squares",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L119-L122 |
148,871 | scgolang/sc | operators.go | binOpDiv | func binOpDiv(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpDiv, numOutputs, x, y)
} | go | func binOpDiv(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpDiv, numOutputs, x, y)
} | [
"func",
"binOpDiv",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpDiv",
",",
"numOutputs",
",",
"x... | // binOpDiv divides one input by another. | [
"binOpDiv",
"divides",
"one",
"input",
"by",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L125-L128 |
148,872 | scgolang/sc | operators.go | binOpExpon | func binOpExpon(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpExpon, numOutputs, x, y)
} | go | func binOpExpon(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpExpon, numOutputs, x, y)
} | [
"func",
"binOpExpon",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpExpon",
",",
"numOutputs",
",",
... | // binOpExpon creates a BinaryOpUgen that raises one Input to the power of another. | [
"binOpExpon",
"creates",
"a",
"BinaryOpUgen",
"that",
"raises",
"one",
"Input",
"to",
"the",
"power",
"of",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L137-L140 |
148,873 | scgolang/sc | operators.go | binOpGCD | func binOpGCD(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpGCD, numOutputs, x, y)
} | go | func binOpGCD(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpGCD, numOutputs, x, y)
} | [
"func",
"binOpGCD",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpGCD",
",",
"numOutputs",
",",
"x... | // binOpGCD computes the gcd of one Input and another. | [
"binOpGCD",
"computes",
"the",
"gcd",
"of",
"one",
"Input",
"and",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L149-L152 |
148,874 | scgolang/sc | operators.go | binOpGT | func binOpGT(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpGT, numOutputs, x, y)
} | go | func binOpGT(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpGT, numOutputs, x, y)
} | [
"func",
"binOpGT",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpGT",
",",
"numOutputs",
",",
"x",... | // binOpGT computes x > y. | [
"binOpGT",
"computes",
"x",
">",
"y",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L155-L158 |
148,875 | scgolang/sc | operators.go | binOpGTE | func binOpGTE(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpGTE, numOutputs, x, y)
} | go | func binOpGTE(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpGTE, numOutputs, x, y)
} | [
"func",
"binOpGTE",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpGTE",
",",
"numOutputs",
",",
"x... | // binOpGTE computes x >= y. | [
"binOpGTE",
"computes",
"x",
">",
"=",
"y",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L161-L164 |
148,876 | scgolang/sc | operators.go | binOpHypotApx | func binOpHypotApx(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpHypotApx, numOutputs, x, y)
} | go | func binOpHypotApx(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpHypotApx, numOutputs, x, y)
} | [
"func",
"binOpHypotApx",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpHypotApx",
",",
"numOutputs",
... | // binOpHypotApx returns an approximation of the square root of the sum of the squares of x and y. | [
"binOpHypotApx",
"returns",
"an",
"approximation",
"of",
"the",
"square",
"root",
"of",
"the",
"sum",
"of",
"the",
"squares",
"of",
"x",
"and",
"y",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L174-L177 |
148,877 | scgolang/sc | operators.go | binOpLCM | func binOpLCM(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpLCM, numOutputs, x, y)
} | go | func binOpLCM(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpLCM, numOutputs, x, y)
} | [
"func",
"binOpLCM",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpLCM",
",",
"numOutputs",
",",
"x... | // binOpLCM computes the lcm of one Input and another. | [
"binOpLCM",
"computes",
"the",
"lcm",
"of",
"one",
"Input",
"and",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L180-L183 |
148,878 | scgolang/sc | operators.go | binOpLT | func binOpLT(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpLT, numOutputs, x, y)
} | go | func binOpLT(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpLT, numOutputs, x, y)
} | [
"func",
"binOpLT",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpLT",
",",
"numOutputs",
",",
"x",... | // binOpLT computes x < y. | [
"binOpLT",
"computes",
"x",
"<",
"y",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L186-L189 |
148,879 | scgolang/sc | operators.go | binOpLTE | func binOpLTE(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpLTE, numOutputs, x, y)
} | go | func binOpLTE(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpLTE, numOutputs, x, y)
} | [
"func",
"binOpLTE",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpLTE",
",",
"numOutputs",
",",
"x... | // binOpLTE computes x <= y. | [
"binOpLTE",
"computes",
"x",
"<",
"=",
"y",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L192-L195 |
148,880 | scgolang/sc | operators.go | binOpMax | func binOpMax(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpMax, numOutputs, x, y)
} | go | func binOpMax(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpMax, numOutputs, x, y)
} | [
"func",
"binOpMax",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpMax",
",",
"numOutputs",
",",
"x... | // binOpMax creates a BinaryOpUgen that represents the maximum of two signals. | [
"binOpMax",
"creates",
"a",
"BinaryOpUgen",
"that",
"represents",
"the",
"maximum",
"of",
"two",
"signals",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L198-L201 |
148,881 | scgolang/sc | operators.go | binOpMin | func binOpMin(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpMin, numOutputs, x, y)
} | go | func binOpMin(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpMin, numOutputs, x, y)
} | [
"func",
"binOpMin",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpMin",
",",
"numOutputs",
",",
"x... | // binOpMin creates a BinaryOpUgen that represents the minimum of two signals. | [
"binOpMin",
"creates",
"a",
"BinaryOpUgen",
"that",
"represents",
"the",
"minimum",
"of",
"two",
"signals",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L204-L207 |
148,882 | scgolang/sc | operators.go | binOpModulo | func binOpModulo(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpModulo, numOutputs, x, y)
} | go | func binOpModulo(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpModulo, numOutputs, x, y)
} | [
"func",
"binOpModulo",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpModulo",
",",
"numOutputs",
","... | // binOpModulo computes the modulo of one Input and another. | [
"binOpModulo",
"computes",
"the",
"modulo",
"of",
"one",
"Input",
"and",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L210-L213 |
148,883 | scgolang/sc | operators.go | binOpMul | func binOpMul(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpMul, numOutputs, x, y)
} | go | func binOpMul(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpMul, numOutputs, x, y)
} | [
"func",
"binOpMul",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpMul",
",",
"numOutputs",
",",
"x... | // binOpMul creates a BinaryOpUGen that represents multiplication. | [
"binOpMul",
"creates",
"a",
"BinaryOpUGen",
"that",
"represents",
"multiplication",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L216-L219 |
148,884 | scgolang/sc | operators.go | binOpPow | func binOpPow(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpPow, numOutputs, x, y)
} | go | func binOpPow(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpPow, numOutputs, x, y)
} | [
"func",
"binOpPow",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpPow",
",",
"numOutputs",
",",
"x... | // binOpPow creates a BinaryOpUgen that raises one Input to the power of another. | [
"binOpPow",
"creates",
"a",
"BinaryOpUgen",
"that",
"raises",
"one",
"Input",
"to",
"the",
"power",
"of",
"another",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L222-L225 |
148,885 | scgolang/sc | operators.go | binOpRing1 | func binOpRing1(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpRing1, numOutputs, x, y)
} | go | func binOpRing1(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpRing1, numOutputs, x, y)
} | [
"func",
"binOpRing1",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpRing1",
",",
"numOutputs",
",",
... | // binOpRing1 creates a BinaryOpUgen that is ring modulation plus first source. | [
"binOpRing1",
"creates",
"a",
"BinaryOpUgen",
"that",
"is",
"ring",
"modulation",
"plus",
"first",
"source",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L228-L231 |
148,886 | scgolang/sc | operators.go | binOpRing2 | func binOpRing2(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpRing2, numOutputs, x, y)
} | go | func binOpRing2(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpRing2, numOutputs, x, y)
} | [
"func",
"binOpRing2",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpRing2",
",",
"numOutputs",
",",
... | // binOpRing2 creates a BinaryOpUgen that is ring modulation plus both sources. | [
"binOpRing2",
"creates",
"a",
"BinaryOpUgen",
"that",
"is",
"ring",
"modulation",
"plus",
"both",
"sources",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L234-L237 |
148,887 | scgolang/sc | operators.go | binOpRound | func binOpRound(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpRound, numOutputs, x, y)
} | go | func binOpRound(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpRound, numOutputs, x, y)
} | [
"func",
"binOpRound",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpRound",
",",
"numOutputs",
",",
... | // binOpRound performs quantization by rounding. Rounds a to the nearest multiple of b. | [
"binOpRound",
"performs",
"quantization",
"by",
"rounding",
".",
"Rounds",
"a",
"to",
"the",
"nearest",
"multiple",
"of",
"b",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L252-L255 |
148,888 | scgolang/sc | operators.go | binOpSqrdif | func binOpSqrdif(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpSqrdif, numOutputs, x, y)
} | go | func binOpSqrdif(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpSqrdif, numOutputs, x, y)
} | [
"func",
"binOpSqrdif",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpSqrdif",
",",
"numOutputs",
","... | // binOpSqrdif computes the square of the difference of two inputs. | [
"binOpSqrdif",
"computes",
"the",
"square",
"of",
"the",
"difference",
"of",
"two",
"inputs",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L264-L267 |
148,889 | scgolang/sc | operators.go | binOpSqrsum | func binOpSqrsum(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpSqrsum, numOutputs, x, y)
} | go | func binOpSqrsum(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpSqrsum, numOutputs, x, y)
} | [
"func",
"binOpSqrsum",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpSqrsum",
",",
"numOutputs",
","... | // binOpSqrsum computes the square of the sum of two inputs. | [
"binOpSqrsum",
"computes",
"the",
"square",
"of",
"the",
"sum",
"of",
"two",
"inputs",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L270-L273 |
148,890 | scgolang/sc | operators.go | binOpSumsqr | func binOpSumsqr(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpSumsqr, numOutputs, x, y)
} | go | func binOpSumsqr(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpSumsqr, numOutputs, x, y)
} | [
"func",
"binOpSumsqr",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpSumsqr",
",",
"numOutputs",
","... | // binOpSumsqr computes a sum of squares. | [
"binOpSumsqr",
"computes",
"a",
"sum",
"of",
"squares",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L276-L279 |
148,891 | scgolang/sc | operators.go | binOpThresh | func binOpThresh(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpThresh, numOutputs, x, y)
} | go | func binOpThresh(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpThresh, numOutputs, x, y)
} | [
"func",
"binOpThresh",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpThresh",
",",
"numOutputs",
","... | // binOpThresh performs thresholding. This returns 0 when x < y, otherwise x. | [
"binOpThresh",
"performs",
"thresholding",
".",
"This",
"returns",
"0",
"when",
"x",
"<",
"y",
"otherwise",
"x",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L282-L285 |
148,892 | scgolang/sc | operators.go | binOpTrunc | func binOpTrunc(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpTrunc, numOutputs, x, y)
} | go | func binOpTrunc(rate int8, x, y Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(BinOpUgenName, rate, BinOpTrunc, numOutputs, x, y)
} | [
"func",
"binOpTrunc",
"(",
"rate",
"int8",
",",
"x",
",",
"y",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"BinOpUgenName",
",",
"rate",
",",
"BinOpTrunc",
",",
"numOutputs",
",",
... | // binOpTrunc performs quantization by truncation. Truncate a to a multiple of b. | [
"binOpTrunc",
"performs",
"quantization",
"by",
"truncation",
".",
"Truncate",
"a",
"to",
"a",
"multiple",
"of",
"b",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L288-L291 |
148,893 | scgolang/sc | operators.go | mulAdd | func mulAdd(rate int8, in, mul, add Input, numOutputs int) Input {
CheckRate(rate)
return NewInput("MulAdd", rate, 0, numOutputs, in, mul, add)
} | go | func mulAdd(rate int8, in, mul, add Input, numOutputs int) Input {
CheckRate(rate)
return NewInput("MulAdd", rate, 0, numOutputs, in, mul, add)
} | [
"func",
"mulAdd",
"(",
"rate",
"int8",
",",
"in",
",",
"mul",
",",
"add",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"\"",
"\"",
",",
"rate",
",",
"0",
",",
"numOutputs",
",... | // mulAdd creates a MulAdd ugen. | [
"mulAdd",
"creates",
"a",
"MulAdd",
"ugen",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L300-L303 |
148,894 | scgolang/sc | operators.go | unaryOpAbs | func unaryOpAbs(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAbs, numOutputs, in)
} | go | func unaryOpAbs(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAbs, numOutputs, in)
} | [
"func",
"unaryOpAbs",
"(",
"rate",
"int8",
",",
"in",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"UnaryOpUgenName",
",",
"rate",
",",
"UnaryOpAbs",
",",
"numOutputs",
",",
"in",
"... | // unaryOpAbs computes the absolute value of a signal. | [
"unaryOpAbs",
"computes",
"the",
"absolute",
"value",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L306-L309 |
148,895 | scgolang/sc | operators.go | unaryOpAcos | func unaryOpAcos(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAcos, numOutputs, in)
} | go | func unaryOpAcos(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAcos, numOutputs, in)
} | [
"func",
"unaryOpAcos",
"(",
"rate",
"int8",
",",
"in",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"UnaryOpUgenName",
",",
"rate",
",",
"UnaryOpAcos",
",",
"numOutputs",
",",
"in",
... | // unaryOpAcos computes the arccosine of a signal. | [
"unaryOpAcos",
"computes",
"the",
"arccosine",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L312-L315 |
148,896 | scgolang/sc | operators.go | unaryOpAmpDb | func unaryOpAmpDb(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAmpDb, numOutputs, in)
} | go | func unaryOpAmpDb(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAmpDb, numOutputs, in)
} | [
"func",
"unaryOpAmpDb",
"(",
"rate",
"int8",
",",
"in",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"UnaryOpUgenName",
",",
"rate",
",",
"UnaryOpAmpDb",
",",
"numOutputs",
",",
"in",... | // unaryOpAmpDb converts linear amplitude to decibels. | [
"unaryOpAmpDb",
"converts",
"linear",
"amplitude",
"to",
"decibels",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L318-L321 |
148,897 | scgolang/sc | operators.go | unaryOpAsin | func unaryOpAsin(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAsin, numOutputs, in)
} | go | func unaryOpAsin(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAsin, numOutputs, in)
} | [
"func",
"unaryOpAsin",
"(",
"rate",
"int8",
",",
"in",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"UnaryOpUgenName",
",",
"rate",
",",
"UnaryOpAsin",
",",
"numOutputs",
",",
"in",
... | // unaryOpAsin computes the arcsine of a signal. | [
"unaryOpAsin",
"computes",
"the",
"arcsine",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L324-L327 |
148,898 | scgolang/sc | operators.go | unaryOpAtan | func unaryOpAtan(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAtan, numOutputs, in)
} | go | func unaryOpAtan(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpAtan, numOutputs, in)
} | [
"func",
"unaryOpAtan",
"(",
"rate",
"int8",
",",
"in",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"UnaryOpUgenName",
",",
"rate",
",",
"UnaryOpAtan",
",",
"numOutputs",
",",
"in",
... | // unaryOpAtan computes the arctangent of a signal. | [
"unaryOpAtan",
"computes",
"the",
"arctangent",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L330-L333 |
148,899 | scgolang/sc | operators.go | unaryOpCeil | func unaryOpCeil(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpCeil, numOutputs, in)
} | go | func unaryOpCeil(rate int8, in Input, numOutputs int) Input {
CheckRate(rate)
return NewInput(UnaryOpUgenName, rate, UnaryOpCeil, numOutputs, in)
} | [
"func",
"unaryOpCeil",
"(",
"rate",
"int8",
",",
"in",
"Input",
",",
"numOutputs",
"int",
")",
"Input",
"{",
"CheckRate",
"(",
"rate",
")",
"\n",
"return",
"NewInput",
"(",
"UnaryOpUgenName",
",",
"rate",
",",
"UnaryOpCeil",
",",
"numOutputs",
",",
"in",
... | // unaryOpCeil computes the ceiling of a signal. | [
"unaryOpCeil",
"computes",
"the",
"ceiling",
"of",
"a",
"signal",
"."
] | 2b87756659e2b72d97cec43b6896ed01c0365097 | https://github.com/scgolang/sc/blob/2b87756659e2b72d97cec43b6896ed01c0365097/operators.go#L342-L345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.