1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535
|
"""
Copyright 2009-2019 Olivier Belanger
This file is part of pyo, a python module to help digital signal
processing script creation.
pyo is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
pyo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with pyo. If not, see <http://www.gnu.org/licenses/>.
"""
import os
import sys
if sys.platform.startswith("linux") and os.path.isdir("{}{}".format(os.path.dirname(__file__), ".libs")):
from . import _linux_wheel_fix_symlinks
from .lib._maps import *
from .lib import analysis as analysis
from .lib.analysis import *
from .lib import controls as controls
from .lib.controls import *
from .lib import dynamics as dynamics
from .lib.dynamics import *
from .lib import effects as effects
from .lib.effects import *
from .lib import filters as filters
from .lib.filters import *
from .lib import generators as generators
from .lib.generators import *
from .lib import arithmetic as arithmetic
from .lib.arithmetic import *
from .lib import midi as midi
from .lib.midi import *
from .lib import opensndctrl as opensndctrl
from .lib.opensndctrl import *
from .lib import pan as pan
from .lib.pan import *
from .lib import pattern as pattern
from .lib.pattern import *
from .lib import randoms as randoms
from .lib.randoms import *
from .lib.server import *
from .lib.listener import *
from .lib import players as players
from .lib.players import *
from .lib import tableprocess as tableprocess
from .lib.tableprocess import *
from .lib import matrixprocess as matrixprocess
from .lib.matrixprocess import *
from .lib.tables import *
from .lib.matrix import *
from .lib import triggers as triggers
from .lib.triggers import *
from .lib import utils as utils
from .lib.utils import *
from .lib import expression as expression
from .lib.expression import *
from .lib import fourier as fourier
from .lib.fourier import *
from .lib import phasevoc as phasevoc
from .lib.phasevoc import *
from .lib._core import *
from .lib.wxgui import *
from .lib import wxgui as wxgui
from .lib.hrtf import *
from .lib import hrtf as hrtf
from .lib.events import *
from .lib import events as events
from .lib.mmlmusic import *
from .lib import mmlmusic as mmlmusic
if WITH_EXTERNALS:
from .lib import external as external
from .lib.external import *
OBJECTS_TREE = {
"functions": sorted(
[
"pa_count_devices",
"pa_get_default_input",
"pa_get_default_output",
"pm_get_input_devices",
"pa_list_devices",
"pa_count_host_apis",
"pa_list_host_apis",
"pa_get_default_host_api",
"pa_get_default_devices_from_host",
"pm_count_devices",
"pm_list_devices",
"sndinfo",
"savefile",
"pa_get_output_devices",
"pa_get_input_devices",
"midiToHz",
"hzToMidi",
"sampsToSec",
"secToSamps",
"example",
"class_args",
"pm_get_default_input",
"pm_get_output_devices",
"pm_get_default_output",
"midiToTranspo",
"getVersion",
"reducePoints",
"serverCreated",
"serverBooted",
"distanceToSegment",
"rescale",
"upsamp",
"downsamp",
"linToCosCurve",
"convertStringToSysEncoding",
"savefileFromTable",
"pa_get_input_max_channels",
"pa_get_output_max_channels",
"pa_get_devices_infos",
"pa_get_version",
"pa_get_version_text",
"floatmap",
"getPrecision",
"beatToDur",
]
),
"PyoObjectBase": {
"PyoMatrixObject": sorted(["NewMatrix"]),
"PyoTableObject": sorted(
[
"LinTable",
"NewTable",
"SndTable",
"HannTable",
"HarmTable",
"SawTable",
"ParaTable",
"LogTable",
"CosLogTable",
"SquareTable",
"TriangleTable",
"ChebyTable",
"CosTable",
"CurveTable",
"ExpTable",
"DataTable",
"WinTable",
"SincTable",
"PartialTable",
"AtanTable",
"PadSynthTable",
"SharedTable",
]
),
"PyoPVObject": sorted(
[
"PVAnal",
"PVSynth",
"PVTranspose",
"PVVerb",
"PVGate",
"PVAddSynth",
"PVCross",
"PVMult",
"PVMorph",
"PVFilter",
"PVDelay",
"PVBuffer",
"PVShift",
"PVAmpMod",
"PVFreqMod",
"PVBufLoops",
"PVBufTabLoops",
"PVMix",
]
),
"PyoObject": {
"analysis": sorted(
[
"Follower",
"Follower2",
"ZCross",
"Yin",
"Centroid",
"AttackDetector",
"Scope",
"Spectrum",
"PeakAmp",
"RMS",
]
),
"arithmetic": sorted(
[
"Sin",
"Cos",
"Tan",
"Abs",
"Sqrt",
"Log",
"Log2",
"Log10",
"Pow",
"Atan2",
"Floor",
"Round",
"Ceil",
"Tanh",
"Exp",
"Div",
"Sub",
]
),
"controls": sorted(["Fader", "Sig", "SigTo", "Adsr", "Linseg", "Expseg"]),
"dynamics": sorted(
["Clip", "Compress", "Degrade", "Mirror", "Wrap", "Gate", "Balance", "Min", "Max", "Expand",]
),
"effects": sorted(
[
"Delay",
"SDelay",
"Disto",
"Freeverb",
"Waveguide",
"Convolve",
"WGVerb",
"SmoothDelay",
"Harmonizer",
"Chorus",
"AllpassWG",
"FreqShift",
"Vocoder",
"Delay1",
"STRev",
]
),
"filters": sorted(
[
"Biquad",
"BandSplit",
"Port",
"Hilbert",
"Tone",
"DCBlock",
"EQ",
"Allpass",
"Allpass2",
"Phaser",
"Biquadx",
"IRWinSinc",
"IRAverage",
"IRPulse",
"IRFM",
"FourBand",
"Biquada",
"Atone",
"SVF",
"SVF2",
"Average",
"Reson",
"Resonx",
"ButLP",
"ButHP",
"ButBP",
"ButBR",
"ComplexRes",
"MoogLP",
"MultiBand",
]
),
"generators": sorted(
[
"Noise",
"Phasor",
"Sine",
"Input",
"CrossFM",
"SineLoop",
"Blit",
"PinkNoise",
"FM",
"LFO",
"BrownNoise",
"Rossler",
"Lorenz",
"ChenLee",
"SumOsc",
"SuperSaw",
"RCOsc",
"FastSine",
]
),
"internals": sorted(["Dummy", "InputFader", "Mix", "VarPort"]),
"midi": sorted(
[
"Midictl",
"CtlScan",
"CtlScan2",
"Notein",
"MidiAdsr",
"MidiDelAdsr",
"Bendin",
"Touchin",
"Programin",
"RawMidi",
"MidiLinseg",
]
),
"opensndctrl": sorted(["OscReceive", "OscSend", "OscDataSend", "OscDataReceive", "OscListReceive",]),
"pan": sorted(["Pan", "SPan", "Switch", "Selector", "Mixer", "VoiceManager", "HRTF", "Binaural",]),
"pattern": sorted(["Pattern", "Score", "CallAfter"]),
"randoms": sorted(
[
"Randi",
"Randh",
"Choice",
"RandInt",
"Xnoise",
"XnoiseMidi",
"RandDur",
"XnoiseDur",
"Urn",
"LogiMap",
]
),
"players": sorted(["SfMarkerShuffler", "SfPlayer", "SfMarkerLooper"]),
"tableprocess": sorted(
[
"TableRec",
"Osc",
"Pointer",
"Pointer2",
"Lookup",
"Granulator",
"Pulsar",
"OscLoop",
"Granule",
"TableRead",
"TableMorph",
"Looper",
"TableIndex",
"OscBank",
"OscTrig",
"TablePut",
"TableScale",
"Particle",
"Particle2",
"TableWrite",
"TableFill",
"TableScan",
]
),
"matrixprocess": sorted(["MatrixRec", "MatrixPointer", "MatrixMorph", "MatrixRecLoop"]),
"triggers": sorted(
[
"Metro",
"Beat",
"TrigEnv",
"TrigRand",
"Trig",
"TrigRandInt",
"Select",
"Counter",
"TrigChoice",
"TrigFunc",
"Thresh",
"Cloud",
"TrigXnoise",
"TrigXnoiseMidi",
"Timer",
"Count",
"Change",
"TrigLinseg",
"TrigExpseg",
"Percent",
"Seq",
"TrigTableRec",
"Iter",
"NextTrig",
"TrigVal",
"Euclide",
"TrigBurst",
]
),
"utils": sorted(
[
"Clean_objects",
"Print",
"Snap",
"Interp",
"SampHold",
"Compare",
"Record",
"DBToA",
"AToDB",
"Between",
"Denorm",
"ControlRec",
"ControlRead",
"NoteinRec",
"NoteinRead",
"Scale",
"TrackHold",
"CentsToTranspo",
"TranspoToCents",
"MToF",
"FToM",
"MToT",
"Resample",
]
),
"expression": sorted(["Expr"]),
"mmlmusic": sorted(["MML"]),
"fourier": sorted(
["FFT", "IFFT", "CarToPol", "PolToCar", "IFFTMatrix", "FrameDelta", "FrameAccum", "Vectral", "CvlVerb",]
),
"events": sorted(
[
"EventInstrument",
"DefaultInstrument",
"EventScale",
"EventGenerator",
"EventDummy",
"EventFilter",
"EventKey",
"EventSeq",
"EventSlide",
"EventIndex",
"EventMarkov",
"EventChoice",
"EventDrunk",
"EventNoise",
"EventCall",
"EventConditional",
"Events",
]
),
},
},
"Map": {"SLMap": sorted(["SLMapFreq", "SLMapMul", "SLMapPhase", "SLMapQ", "SLMapDur", "SLMapPan"])},
"Server": [],
"MidiListener": [],
"MidiDispatcher": [],
"OscListener": [],
"Stream": [],
"TableStream": [],
"PyoGui": [
"PyoGuiControlSlider",
"PyoGuiVuMeter",
"PyoGuiGrapher",
"PyoGuiMultiSlider",
"PyoGuiSpectrum",
"PyoGuiScope",
"PyoGuiSndView",
"PyoGuiKeyboard",
],
}
DOC_KEYWORDS = [
"Attributes",
"Examples",
"Parameters",
"Methods",
"Notes",
"Methods details",
"See also",
"Parentclass",
]
def getPyoKeywords():
"""
Returns a list of every keywords (classes and functions) of pyo.
>>> keywords = getPyoKeywords()
"""
tree = OBJECTS_TREE
_list = []
for k1 in tree.keys():
if type(tree[k1]) == type({}):
for k2 in tree[k1].keys():
if type(tree[k1][k2]) == type({}):
for k3 in tree[k1][k2].keys():
for val in tree[k1][k2][k3]:
_list.append(val)
else:
for val in tree[k1][k2]:
_list.append(val)
else:
for val in tree[k1]:
_list.append(val)
_list.extend(
["PyoObjectBase", "PyoObject", "PyoTableObject", "PyoMatrixObject", "PyoPVObject",]
)
_list.extend(
["Server", "Map", "SLMap", "MidiListener", "MidiDispatcher", "OscListener", "Stream", "TableStream",]
)
return _list
def getPyoExamples(fullpath=False):
"""
Returns a listing of the examples, as a dictionary, installed with pyo.
:Args:
fullpath: boolean
If True, the full path of each file is returned. Otherwise, only the
filenames are listed.
>>> examples = getPyoExamples()
"""
folder = "examples"
filedir = os.path.dirname(os.path.abspath(__file__))
subfolders = [f for f in os.listdir(os.path.join(filedir, folder)) if not f.startswith("__") and not f == "snds"]
examples = {}
for subfolder in sorted(subfolders):
path = os.path.join(filedir, folder, subfolder)
if fullpath:
files = [os.path.join(path, f) for f in os.listdir(path) if not f.startswith("__")]
else:
files = [f for f in os.listdir(path) if not f.startswith("__")]
examples[subfolder] = files
return examples
OBJECTS_TREE["functions"] = sorted(OBJECTS_TREE["functions"] + ["getPyoKeywords", "getPyoExamples"])
|