Showing the changes to src/core/ulib_std.cpp (1 of 16 files). Show all
Unified · Split
| @@ -166,146 +166,145 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 165 unmodified lines | ||
| 166 | 166 | |
| 167 | 167 | // begin class |
| 168 | 168 | QUERY->begin_class( QUERY, "Std", "Object" ); |
| 169 | − QUERY->doc_class( QUERY, "Std is a standard library in ChucK, which includes utility functions for random number generation, unit conversions, and absolute value." ); | |
| 169 | + QUERY->doc_class( QUERY, "a standard library in ChucK, which includes utility functions for random number generation, unit conversions, and absolute value." ); | |
| 170 | 170 | |
| 171 | 171 | // add abs |
| 172 | 172 | QUERY->add_sfun( QUERY, abs_impl, "int", "abs" ); |
| 173 | 173 | QUERY->add_arg( QUERY, "int", "value" ); |
| 174 | − QUERY->doc_func( QUERY, "Return absolute value of integer. " ); | |
| 174 | + QUERY->doc_func( QUERY, "compute the absolute value of an integer." ); | |
| 175 | 175 | |
| 176 | 176 | // add fabs |
| 177 | 177 | QUERY->add_sfun( QUERY, fabs_impl, "float", "fabs" ); |
| 178 | 178 | QUERY->add_arg( QUERY, "float", "value" ); |
| 179 | − QUERY->doc_func( QUERY, "Return absolute value of float. " ); | |
| 179 | + QUERY->doc_func( QUERY, "compute the absolute value of a float." ); | |
| 180 | 180 | |
| 181 | 181 | // add rand |
| 182 | 182 | QUERY->add_sfun( QUERY, rand_impl, "int", "rand"); //! return int between 0 and RAND_MAX |
| 183 | − QUERY->doc_func( QUERY, "Generates random integer between 0 and Std.RAND_MAX. (NOTE: soon-to-be-deprecated; use Math.random2())." ); | |
| 183 | + QUERY->doc_func( QUERY, "generate a random integer between 0 and Std.RAND_MAX. (NOTE: this is deprecated; use Math.random())." ); | |
| 184 | 184 | |
| 185 | 185 | // add rand2 |
| 186 | 186 | QUERY->add_sfun( QUERY, rand2_impl, "int", "rand2" ); //! integer between [min,max] |
| 187 | 187 | QUERY->add_arg( QUERY, "int", "min" ); |
| 188 | 188 | QUERY->add_arg( QUERY, "int", "max" ); |
| 189 | − QUERY->doc_func( QUERY, "Generates random integer in range [min, max]. (NOTE: soon-to-be-deprecated; use Math.random2())." ); | |
| 189 | + QUERY->doc_func( QUERY, "generate a random integer in range [min, max]. (NOTE: this is deprecated; use Math.random2())." ); | |
| 190 | 190 | |
| 191 | 191 | // add rand |
| 192 | 192 | QUERY->add_sfun( QUERY, randf_impl, "float", "randf" ); //! rand between -1.0,1.0 |
| 193 | − QUERY->doc_func( QUERY, "Generates random floating point number in the range [-1, 1]. (Note: soon-to-be-deprecated; use Math.randomf())" ); | |
| 193 | + QUERY->doc_func( QUERY, "generates a random floating point number in the range [-1, 1]. (Note: this is deprecated; use Math.randomf())" ); | |
| 194 | 194 | |
| 195 | 195 | // add rand2 |
| 196 | 196 | QUERY->add_sfun( QUERY, rand2f_impl, "float", "rand2f" ); //! rand between min and max |
| 197 | 197 | QUERY->add_arg( QUERY, "float", "min" ); |
| 198 | 198 | QUERY->add_arg( QUERY, "float", "max" ); |
| 199 | − QUERY->doc_func( QUERY, "Generates random floating point number in the range [min, max]. (NOTE: soon-to-be-deprecated; use Math.random2f())" ); | |
| 199 | + QUERY->doc_func( QUERY, "generate random floating point number in the range [min, max]. (NOTE: this is deprecated; use Math.random2f())" ); | |
| 200 | 200 | |
| 201 | 201 | // add srand |
| 202 | 202 | QUERY->add_sfun( QUERY, srand_impl, "void", "srand" ); |
| 203 | 203 | QUERY->add_arg( QUERY, "int", "seed" ); |
| 204 | − QUERY->doc_func( QUERY, "Provide a seed to the random function. Different seeds will generate very different sequences of random numbers even if the seeds are close together. " | |
| 205 | − "Alternatively, a sequence of random numbers can be repeated by setting the same seed. " ); | |
| 204 | + QUERY->doc_func( QUERY, "seed the random number generator. Different seeds will likely generate different sequences of random numbers even if the seeds are close together; alternatively, a sequence of random numbers can be repeated by setting the same seed." ); | |
| 206 | 205 | |
| 207 | 206 | // add sgn |
| 208 | 207 | QUERY->add_sfun( QUERY, sgn_impl, "float", "sgn" ); //! return sign of value (-1, 0, 1) |
| 209 | 208 | QUERY->add_arg( QUERY, "float", "value" ); |
| 210 | − QUERY->doc_func( QUERY, "Computes the sign of the input as -1.0 (negative), 0 (zero), or 1.0 (positive)." ); | |
| 209 | + QUERY->doc_func( QUERY, "compute the sign of the input as -1.0 (negative), 0 (zero), or 1.0 (positive)." ); | |
| 211 | 210 | |
| 212 | 211 | // add system |
| 213 | 212 | //! see \example std.ck |
| 214 | 213 | QUERY->add_sfun( QUERY, system_impl, "int", "system" ); //! issue system command |
| 215 | 214 | QUERY->add_arg( QUERY, "string", "cmd" ); |
| 216 | − QUERY->doc_func( QUERY, "Pass a command to be executed in the shell (requires --caution-to-the-wind command-line flag)." ); | |
| 215 | + QUERY->doc_func( QUERY, "pass a command to be executed in the shell (requires --caution-to-the-wind flag to be set)." ); | |
| 217 | 216 | |
| 218 | 217 | // add atoi |
| 219 | 218 | QUERY->add_sfun( QUERY, atoi_impl, "int", "atoi" ); //! string to integer |
| 220 | 219 | QUERY->add_arg( QUERY, "string", "value" ); |
| 221 | − QUERY->doc_func( QUERY, "Converts ascii (string) to integer (int)." ); | |
| 220 | + QUERY->doc_func( QUERY, "convert ascii (string) to integer (int)." ); | |
| 222 | 221 | |
| 223 | 222 | // add atof |
| 224 | 223 | QUERY->add_sfun( QUERY, atof_impl, "float", "atof" ); //! string to float |
| 225 | 224 | QUERY->add_arg( QUERY, "string", "value" ); |
| 226 | − QUERY->doc_func( QUERY, "Converts ascii (string) to floating point value (float)." ); | |
| 225 | + QUERY->doc_func( QUERY, "converts ascii (string) to floating point value (float)." ); | |
| 227 | 226 | |
| 228 | 227 | // add itoa |
| 229 | 228 | QUERY->add_sfun( QUERY, itoa_impl, "string", "itoa" ); //! int to string |
| 230 | 229 | QUERY->add_arg( QUERY, "int", "i" ); |
| 231 | − QUERY->doc_func( QUERY, "Converts integer (int) to ascii (string)." ); | |
| 230 | + QUERY->doc_func( QUERY, "converts integer (int) to ascii (string)." ); | |
| 232 | 231 | |
| 233 | 232 | // add ftoa |
| 234 | 233 | QUERY->add_sfun( QUERY, ftoa_impl, "string", "ftoa" ); //! float to string |
| 235 | 234 | QUERY->add_arg( QUERY, "float", "f" ); |
| 236 | 235 | QUERY->add_arg( QUERY, "int", "precision" ); |
| 237 | − QUERY->doc_func( QUERY, "Converts floating point value (float) to ascii (string) with specified precision (number of decimal digits)." ); | |
| 236 | + QUERY->doc_func( QUERY, "converts floating point value (float) to ascii (string) with specified precision (number of decimal digits)." ); | |
| 238 | 237 | |
| 239 | 238 | // add ftoi |
| 240 | 239 | QUERY->add_sfun( QUERY, ftoi_impl, "int", "ftoi" ); //! float to int |
| 241 | 240 | QUERY->add_arg( QUERY, "float", "f" ); |
| 242 | − QUERY->doc_func( QUERY, "Convert float to int. " ); | |
| 241 | + QUERY->doc_func( QUERY, "convert float to integer. " ); | |
| 243 | 242 | |
| 244 | 243 | // add getenv |
| 245 | 244 | QUERY->add_sfun( QUERY, getenv_impl, "string", "getenv" ); //! fetch environment variable |
| 246 | 245 | QUERY->add_arg( QUERY, "string", "value" ); |
| 247 | − QUERY->doc_func( QUERY, "Returns the value of an environment variable, such as of PATH." ); | |
| 246 | + QUERY->doc_func( QUERY, "get the value of an environment variable (e.g., PATH)." ); | |
| 248 | 247 | |
| 249 | 248 | // add setenv |
| 250 | 249 | QUERY->add_sfun( QUERY, setenv_impl, "int", "setenv" ); //! set environment variable |
| 251 | 250 | QUERY->add_arg( QUERY, "string", "key" ); |
| 252 | 251 | QUERY->add_arg( QUERY, "string", "value" ); |
| 253 | − QUERY->doc_func( QUERY, "Set value of environment variable named key to value." ); | |
| 252 | + QUERY->doc_func( QUERY, "set the value of environment variable named 'key'" ); | |
| 254 | 253 | |
| 255 | 254 | // add mtof |
| 256 | 255 | //! see \example mand-o-matic.ck |
| 257 | 256 | QUERY->add_sfun( QUERY, mtof_impl, "float", "mtof" ); //! midi note to frequency |
| 258 | 257 | QUERY->add_arg( QUERY, "float", "value" ); |
| 259 | − QUERY->doc_func( QUERY, "Converts a MIDI note number to frequency (Hz). Note the input value is of type float (supports fractional note number)." ); | |
| 258 | + QUERY->doc_func( QUERY, "convert a MIDI note number to frequency (Hz). MIDI note 60 is Middle C; each whole number is one semitone; the input type is float and supports fractional note numbers." ); | |
| 260 | 259 | |
| 261 | 260 | // add ftom |
| 262 | 261 | QUERY->add_sfun( QUERY, ftom_impl, "float", "ftom" ); //! frequency to midi note |
| 263 | 262 | QUERY->add_arg( QUERY, "float", "value" ); |
| 264 | − QUERY->doc_func( QUERY, "Converts frequency (Hz) to MIDI note number space." ); | |
| 263 | + QUERY->doc_func( QUERY, "convert frequency (Hz) to corresponding MIDI note number." ); | |
| 265 | 264 | |
| 266 | 265 | // add powtodb |
| 267 | 266 | QUERY->add_sfun( QUERY, powtodb_impl, "float", "powtodb" ); //! linear power to decibel |
| 268 | 267 | QUERY->add_arg( QUERY, "float", "value" ); |
| 269 | − QUERY->doc_func( QUERY, "Converts signal power ratio to decibels (dB)." ); | |
| 268 | + QUERY->doc_func( QUERY, "convert signal power ratio to decibels (dB)." ); | |
| 270 | 269 | |
| 271 | 270 | // add rmstodb |
| 272 | 271 | QUERY->add_sfun( QUERY, rmstodb_impl, "float", "rmstodb" ); //! rms to decibel |
| 273 | 272 | QUERY->add_arg( QUERY, "float", "value" ); |
| 274 | − QUERY->doc_func( QUERY, "Converts rms to decibels (dB)." ); | |
| 273 | + QUERY->doc_func( QUERY, "converts rms to decibels (dB)." ); | |
| 275 | 274 | |
| 276 | 275 | // add dbtopow |
| 277 | 276 | QUERY->add_sfun( QUERY, dbtopow_impl, "float", "dbtopow" ); //! decibel to linear |
| 278 | 277 | QUERY->add_arg( QUERY, "float", "value" ); |
| 279 | − QUERY->doc_func( QUERY, "Converts decibels (dB) to signal power ratio." ); | |
| 278 | + QUERY->doc_func( QUERY, "converts decibels (dB) to signal power ratio." ); | |
| 280 | 279 | |
| 281 | 280 | // add dbtorms |
| 282 | 281 | QUERY->add_sfun( QUERY, dbtorms_impl, "float", "dbtorms" ); //! decibel to rms |
| 283 | 282 | QUERY->add_arg( QUERY, "float", "value" ); |
| 284 | − QUERY->doc_func( QUERY, "Convert " ); | |
| 283 | + QUERY->doc_func( QUERY, "convert decibles (dB) to RMS." ); | |
| 285 | 284 | |
| 286 | 285 | // add dbtolin |
| 287 | 286 | QUERY->add_sfun( QUERY, dbtolin_impl, "float", "dbtolin" ); //! decibel to linear |
| 288 | 287 | QUERY->add_arg( QUERY, "float", "value" ); |
| 289 | − QUERY->doc_func( QUERY, "" ); | |
| 288 | + QUERY->doc_func( QUERY, "convert decibels (dB) to linear." ); | |
| 290 | 289 | |
| 291 | 290 | // add lintodb |
| 292 | 291 | QUERY->add_sfun( QUERY, lintodb_impl, "float", "lintodb" ); //! linear to decibel |
| 293 | 292 | QUERY->add_arg( QUERY, "float", "value" ); |
| 294 | − QUERY->doc_func( QUERY, "" ); | |
| 293 | + QUERY->doc_func( QUERY, "convert linear to decibels (dB)." ); | |
| 295 | 294 | |
| 296 | 295 | // add clamp |
| 297 | 296 | QUERY->add_sfun( QUERY, clamp_impl, "int", "clamp" ); //! clamp to range (int) |
| 298 | 297 | QUERY->add_arg( QUERY, "int", "value" ); |
| 299 | 298 | QUERY->add_arg( QUERY, "int", "min" ); |
| 300 | 299 | QUERY->add_arg( QUERY, "int", "max" ); |
| 301 | − QUERY->doc_func( QUERY, "" ); | |
| 300 | + QUERY->doc_func( QUERY, "clamp an integer to range [min,max]." ); | |
| 302 | 301 | |
| 303 | 302 | // add clampf |
| 304 | 303 | QUERY->add_sfun( QUERY, clampf_impl, "float", "clampf" ); //! clamp to range (float) |
| 305 | 304 | QUERY->add_arg( QUERY, "float", "value" ); |
| 306 | 305 | QUERY->add_arg( QUERY, "float", "min" ); |
| 307 | 306 | QUERY->add_arg( QUERY, "float", "max" ); |
| 308 | − QUERY->doc_func( QUERY, "" ); | |
| 307 | + QUERY->doc_func( QUERY, "clamp a float to range [min,max]." ); | |
| 309 | 308 | |
| 310 | 309 | // add scalef |
| 311 | 310 | QUERY->add_sfun( QUERY, scalef_impl, "float", "scalef" ); //! scale from source range to dest range (float) |
| @@ -314,7 +313,7 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 2 unmodified lines | ||
| 314 | 313 | QUERY->add_arg( QUERY, "float", "srcmax" ); |
| 315 | 314 | QUERY->add_arg( QUERY, "float", "dstmin" ); |
| 316 | 315 | QUERY->add_arg( QUERY, "float", "dstmax" ); |
| 317 | − QUERY->doc_func( QUERY, "" ); | |
| 316 | + QUERY->doc_func( QUERY, "scale from a source range to a destination range." ); | |
| 318 | 317 | |
| 319 | 318 | // finish class |
| 320 | 319 | QUERY->end_class( QUERY ); |