diff --git a/public/reference/data.json b/public/reference/data.json index 3c74ca8c1b..22eaaffed7 100644 --- a/public/reference/data.json +++ b/public/reference/data.json @@ -1,31486 +1,28540 @@ { - "project": { - "name": "p5", - "description": "[![npm version](https://badge.fury.io/js/p5.svg)](https://www.npmjs.com/package/p5)", - "version": "1.11.5", - "url": "https://github.com/processing/p5.js#readme" - }, + "project": {}, "files": { - "src/accessibility/color_namer.js": { - "name": "src/accessibility/color_namer.js", + "src/Amplitude.js": { + "name": "src/Amplitude.js", "modules": { - "Environment": 1 + "p5.sound": 1 }, - "classes": {}, - "fors": { - "p5": 1 + "classes": { + "Amplitude": 1 }, - "namespaces": {} - }, - "src/accessibility/describe.js": { - "name": "src/accessibility/describe.js", - "modules": {}, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Amplitude": 1 }, "namespaces": {} }, - "src/accessibility/gridOutput.js": { - "name": "src/accessibility/gridOutput.js", + "src/AudioIn.js": { + "name": "src/AudioIn.js", "modules": {}, - "classes": {}, - "fors": { - "p5": 1 + "classes": { + "AudioIn": 1 }, - "namespaces": {} - }, - "src/accessibility/outputs.js": { - "name": "src/accessibility/outputs.js", - "modules": {}, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "AudioIn": 1 }, "namespaces": {} }, - "src/accessibility/textOutput.js": { - "name": "src/accessibility/textOutput.js", + "src/Biquad.js": { + "name": "src/Biquad.js", "modules": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/color/color_conversion.js": { - "name": "src/color/color_conversion.js", - "modules": { - "Color Conversion": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/color/creating_reading.js": { - "name": "src/color/creating_reading.js", - "modules": { - "Creating & Reading": 1 + "classes": { + "Biquad": 1, + "LowPass": 1, + "HighPass": 1, + "BandPass": 1 }, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Biquad": 1 }, "namespaces": {} }, - "src/color/p5.Color.js": { - "name": "src/color/p5.Color.js", + "src/Delay.js": { + "name": "src/Delay.js", "modules": {}, "classes": { - "p5.Color": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/color/setting.js": { - "name": "src/color/setting.js", - "modules": { - "Setting": 1 + "Delay": 1 }, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Delay": 1 }, "namespaces": {} }, - "src/core/friendly_errors/fes_core.js": { - "name": "src/core/friendly_errors/fes_core.js", + "src/Envelope.js": { + "name": "src/Envelope.js", "modules": {}, - "classes": {}, - "fors": { - "p5": 1 + "classes": { + "Envelope": 1 }, - "namespaces": {} - }, - "src/core/friendly_errors/file_errors.js": { - "name": "src/core/friendly_errors/file_errors.js", - "modules": {}, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Envelope": 1 }, "namespaces": {} }, - "src/core/friendly_errors/sketch_reader.js": { - "name": "src/core/friendly_errors/sketch_reader.js", + "src/FFT.js": { + "name": "src/FFT.js", "modules": {}, - "classes": {}, - "fors": { - "p5": 1 + "classes": { + "FFT": 1 }, - "namespaces": {} - }, - "src/core/friendly_errors/stacktrace.js": { - "name": "src/core/friendly_errors/stacktrace.js", - "modules": {}, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "FFT": 1 }, "namespaces": {} }, - "src/core/friendly_errors/validate_params.js": { - "name": "src/core/friendly_errors/validate_params.js", + "src/Gain.js": { + "name": "src/Gain.js", "modules": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/core/shape/2d_primitives.js": { - "name": "src/core/shape/2d_primitives.js", - "modules": { - "2D Primitives": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/core/shape/attributes.js": { - "name": "src/core/shape/attributes.js", - "modules": { - "Attributes": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/core/shape/curves.js": { - "name": "src/core/shape/curves.js", - "modules": { - "Curves": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/core/shape/vertex.js": { - "name": "src/core/shape/vertex.js", - "modules": { - "Vertex": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/core/constants.js": { - "name": "src/core/constants.js", - "modules": { - "Constants": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "classes": { + "Gain": 1 }, - "namespaces": {} - }, - "src/core/environment.js": { - "name": "src/core/environment.js", - "modules": {}, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Gain": 1 }, "namespaces": {} }, - "src/core/helpers.js": { - "name": "src/core/helpers.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/core/init.js": { - "name": "src/core/init.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/core/internationalization.js": { - "name": "src/core/internationalization.js", + "src/Noise.js": { + "name": "src/Noise.js", "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/core/legacy.js": { - "name": "src/core/legacy.js", - "modules": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/core/main.js": { - "name": "src/core/main.js", - "modules": { - "Structure": 1 - }, "classes": { - "p5": 1 + "Noise": 1 }, "fors": { - "p5": 1 + "p5.sound": 1, + "Noise": 1 }, "namespaces": {} }, - "src/core/p5.Element.js": { - "name": "src/core/p5.Element.js", - "modules": { - "DOM": 1 - }, + "src/Oscillator.js": { + "name": "src/Oscillator.js", + "modules": {}, "classes": { - "p5.Element": 1 + "Oscillator": 1, + "SawOsc": 1, + "SqrOsc": 1, + "TriOsc": 1, + "SinOsc": 1 }, "fors": { - "p5.Element": 1 + "p5.sound": 1, + "Oscillator": 1 }, "namespaces": {} }, - "src/core/p5.Graphics.js": { - "name": "src/core/p5.Graphics.js", + "src/Panner.js": { + "name": "src/Panner.js", "modules": {}, "classes": { - "p5.Graphics": 1 + "Panner": 1 }, "fors": { - "p5": 1 + "p5.sound": 1, + "Panner": 1 }, "namespaces": {} }, - "src/core/p5.Renderer.js": { - "name": "src/core/p5.Renderer.js", + "src/Panner3D.js": { + "name": "src/Panner3D.js", "modules": {}, "classes": { - "p5.Renderer": 1 + "Panner3D": 1 }, "fors": { - "p5": 1 + "p5.sound": 1, + "Panner3D": 1 }, "namespaces": {} }, - "src/core/p5.Renderer2D.js": { - "name": "src/core/p5.Renderer2D.js", + "src/PitchShifter.js": { + "name": "src/PitchShifter.js", "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/core/reference.js": { - "name": "src/core/reference.js", - "modules": { - "Foundation": 1 + "classes": { + "PitchShifter": 1 }, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "PitchShifter": 1 }, "namespaces": {} }, - "src/core/rendering.js": { - "name": "src/core/rendering.js", + "src/Reverb.js": { + "name": "src/Reverb.js", "modules": {}, - "classes": {}, - "fors": { - "p5": 1 + "classes": { + "Reverb": 1 }, - "namespaces": {} - }, - "src/core/structure.js": { - "name": "src/core/structure.js", - "modules": {}, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Reverb": 1 }, "namespaces": {} }, - "src/core/transform.js": { - "name": "src/core/transform.js", + "src/SoundFile.js": { + "name": "src/SoundFile.js", "modules": { - "Transform": 1 + "SoundFile": 1 + }, + "classes": { + "SoundFile": 1 }, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "sound": 1, + "SoundFile": 1 }, "namespaces": {} }, - "src/data/local_storage.js": { - "name": "src/data/local_storage.js", + "src/Utils.js": { + "name": "src/Utils.js", "modules": { - "LocalStorage": 1 + "Sound Utilities": 1 }, "classes": {}, "fors": { - "p5": 1 + "sound": 1 }, "namespaces": {} - }, - "src/data/p5.TypedDict.js": { - "name": "src/data/p5.TypedDict.js", - "modules": { - "Dictionary": 1 - }, - "classes": { - "p5.TypedDict": 1, - "p5.StringDict": 1, - "p5.NumberDict": 1 - }, - "fors": { - "p5.TypedDict": 1, - "p5": 1 + } + }, + "modules": { + "Environment": { + "name": "Environment", + "submodules": { + "Environment": 1 }, - "namespaces": {} + "classes": {} }, - "src/dom/dom.js": { - "name": "src/dom/dom.js", - "modules": {}, - "classes": { - "p5.MediaElement": 1, - "p5.File": 1 - }, - "fors": { - "p5": 1, - "p5.Element": 1 + "Color": { + "name": "Color", + "submodules": { + "Color Conversion": 1, + "Creating & Reading": 1, + "Setting": 1 }, - "namespaces": {} + "classes": {} }, - "src/events/acceleration.js": { - "name": "src/events/acceleration.js", - "modules": { - "Events": 1, - "Acceleration": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "Constants": { + "name": "Constants", + "submodules": { + "Constants": 1 }, - "namespaces": {} + "classes": {} }, - "src/events/keyboard.js": { - "name": "src/events/keyboard.js", - "modules": { - "Keyboard": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "Structure": { + "name": "Structure", + "submodules": { + "Structure": 1 }, - "namespaces": {} + "classes": {} }, - "src/events/mouse.js": { - "name": "src/events/mouse.js", - "modules": { - "Mouse": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "Rendering": { + "name": "Rendering", + "submodules": { + "Rendering": 1 }, - "namespaces": {} + "classes": {} }, - "src/events/touch.js": { - "name": "src/events/touch.js", - "modules": { - "Touch": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "Foundation": { + "name": "Foundation", + "submodules": { + "Foundation": 1 }, - "namespaces": {} + "classes": {} }, - "src/image/filters.js": { - "name": "src/image/filters.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/image/image.js": { - "name": "src/image/image.js", - "modules": { - "Image": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "Transform": { + "name": "Transform", + "submodules": { + "Transform": 1 }, - "namespaces": {} + "classes": {} }, - "src/image/loading_displaying.js": { - "name": "src/image/loading_displaying.js", - "modules": { - "Loading & Displaying": 1 + "Data": { + "name": "Data", + "submodules": { + "LocalStorage": 1, + "Conversion": 1, + "Utility Functions": 1 }, - "classes": {}, - "fors": { - "p5": 1 + "classes": {} + }, + "DOM": { + "name": "DOM", + "submodules": { + "DOM": 1 }, - "namespaces": {} + "classes": {} }, - "src/image/p5.Image.js": { - "name": "src/image/p5.Image.js", - "modules": {}, - "classes": { - "p5.Image": 1 + "Events": { + "name": "Events", + "submodules": { + "Acceleration": 1, + "Keyboard": 1, + "Pointer": 1 }, - "fors": {}, - "namespaces": {} + "classes": {} }, - "src/image/pixels.js": { - "name": "src/image/pixels.js", - "modules": { + "Image": { + "name": "Image", + "submodules": { + "Image": 1, + "Loading & Displaying": 1, "Pixels": 1 }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "classes": {} }, - "src/io/files.js": { - "name": "src/io/files.js", - "modules": { + "IO": { + "name": "IO", + "submodules": { "Input": 1, - "Output": 1 - }, - "classes": { - "p5.PrintWriter": 1 - }, - "fors": { - "p5": 1 + "Output": 1, + "Table": 1, + "Time & Date": 1 }, - "namespaces": {} + "classes": {} }, - "src/io/p5.Table.js": { - "name": "src/io/p5.Table.js", - "modules": { - "Table": 1 - }, - "classes": { - "p5.Table": 1 + "Math": { + "name": "Math", + "submodules": { + "Calculation": 1, + "Noise": 1, + "Random": 1, + "Trigonometry": 1, + "Quaternion": 1 }, - "fors": {}, - "namespaces": {} + "classes": {} }, - "src/io/p5.TableRow.js": { - "name": "src/io/p5.TableRow.js", - "modules": {}, - "classes": { - "p5.TableRow": 1 + "Shape": { + "name": "Shape", + "submodules": { + "2D Primitives": 1, + "Attributes": 1, + "Curves": 1, + "Custom Shapes": 1, + "3D Primitives": 1, + "3D Models": 1 }, - "fors": {}, - "namespaces": {} + "classes": {} }, - "src/io/p5.XML.js": { - "name": "src/io/p5.XML.js", - "modules": {}, - "classes": { - "p5.XML": 1 - }, - "fors": {}, - "namespaces": {} + "Typography": { + "name": "Typography", + "submodules": {}, + "classes": {} }, - "src/math/calculation.js": { - "name": "src/math/calculation.js", - "modules": { - "Calculation": 1 - }, - "classes": {}, - "fors": { - "p5": 1 + "3D": { + "name": "3D", + "submodules": { + "Interaction": 1, + "Lights": 1, + "Material": 1, + "Camera": 1, + "ShaderGenerator": 1 }, - "namespaces": {} + "classes": {} }, - "src/math/math.js": { - "name": "src/math/math.js", - "modules": { - "Vector": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Color Conversion": { + "name": "Color Conversion", + "module": "Color", + "is_submodule": 1 }, - "src/math/noise.js": { - "name": "src/math/noise.js", - "modules": { - "Noise": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Creating & Reading": { + "name": "Creating & Reading", + "module": "Color", + "is_submodule": 1 }, - "src/math/p5.Vector.js": { - "name": "src/math/p5.Vector.js", - "modules": {}, - "classes": { - "p5.Vector": 1 - }, - "fors": {}, - "namespaces": {} + "Setting": { + "name": "Setting", + "module": "Color", + "is_submodule": 1 }, - "src/math/random.js": { - "name": "src/math/random.js", - "modules": { - "Random": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "LocalStorage": { + "name": "LocalStorage", + "module": "Data", + "is_submodule": 1 }, - "src/math/trigonometry.js": { - "name": "src/math/trigonometry.js", - "modules": { - "Trigonometry": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Conversion": { + "name": "Conversion", + "module": "Data", + "is_submodule": 1 }, - "src/typography/attributes.js": { - "name": "src/typography/attributes.js", - "modules": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Utility Functions": { + "name": "Utility Functions", + "module": "Data", + "is_submodule": 1 }, - "src/typography/loading_displaying.js": { - "name": "src/typography/loading_displaying.js", - "modules": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Acceleration": { + "name": "Acceleration", + "module": "Events", + "is_submodule": 1 }, - "src/typography/p5.Font.js": { - "name": "src/typography/p5.Font.js", - "modules": {}, - "classes": { - "p5.Font": 1 - }, - "fors": {}, - "namespaces": {} + "Keyboard": { + "name": "Keyboard", + "module": "Events", + "is_submodule": 1 }, - "src/utilities/array_functions.js": { - "name": "src/utilities/array_functions.js", - "modules": { - "Array Functions": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Pointer": { + "name": "Pointer", + "module": "Events", + "is_submodule": 1 }, - "src/utilities/conversion.js": { - "name": "src/utilities/conversion.js", - "modules": { - "Conversion": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} + "Loading & Displaying": { + "name": "Loading & Displaying", + "module": "Image", + "is_submodule": 1 }, - "src/utilities/string_functions.js": { - "name": "src/utilities/string_functions.js", - "modules": { - "String Functions": 1 + "Pixels": { + "name": "Pixels", + "module": "Image", + "is_submodule": 1 + }, + "Input": { + "name": "Input", + "module": "IO", + "is_submodule": 1 + }, + "Output": { + "name": "Output", + "module": "IO", + "is_submodule": 1 + }, + "Table": { + "name": "Table", + "module": "IO", + "is_submodule": 1 + }, + "Time & Date": { + "name": "Time & Date", + "module": "IO", + "is_submodule": 1 + }, + "Calculation": { + "name": "Calculation", + "module": "Math", + "is_submodule": 1 + }, + "Noise": { + "name": "Noise", + "module": "Math", + "is_submodule": 1 + }, + "Random": { + "name": "Random", + "module": "Math", + "is_submodule": 1 + }, + "Trigonometry": { + "name": "Trigonometry", + "module": "Math", + "is_submodule": 1 + }, + "Quaternion": { + "name": "Quaternion", + "module": "Math", + "is_submodule": 1 + }, + "2D Primitives": { + "name": "2D Primitives", + "module": "Shape", + "is_submodule": 1 + }, + "Attributes": { + "name": "Attributes", + "module": "Shape", + "is_submodule": 1 + }, + "Curves": { + "name": "Curves", + "module": "Shape", + "is_submodule": 1 + }, + "Custom Shapes": { + "name": "Custom Shapes", + "module": "Shape", + "is_submodule": 1 + }, + "3D Primitives": { + "name": "3D Primitives", + "module": "Shape", + "is_submodule": 1 + }, + "3D Models": { + "name": "3D Models", + "module": "Shape", + "is_submodule": 1 + }, + "Interaction": { + "name": "Interaction", + "module": "3D", + "is_submodule": 1 + }, + "Lights": { + "name": "Lights", + "module": "3D", + "is_submodule": 1 + }, + "Material": { + "name": "Material", + "module": "3D", + "is_submodule": 1 + }, + "Camera": { + "name": "Camera", + "module": "3D", + "is_submodule": 1 + }, + "ShaderGenerator": { + "name": "ShaderGenerator", + "module": "3D", + "is_submodule": 1 + }, + "p5.sound": { + "name": "p5.sound", + "submodules": { + "SoundFile": 1 + }, + "elements": {}, + "classes": { + "p5.sound": 1, + "Amplitude": 1, + "AudioIn": 1, + "Biquad": 1, + "LowPass": 1, + "HighPass": 1, + "BandPass": 1, + "Delay": 1, + "Envelope": 1, + "FFT": 1, + "Gain": 1, + "Noise": 1, + "Oscillator": 1, + "SawOsc": 1, + "SqrOsc": 1, + "TriOsc": 1, + "SinOsc": 1, + "Panner": 1, + "Panner3D": 1, + "PitchShifter": 1, + "Reverb": 1, + "sound": 1, + "SoundFile": 1 }, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "Amplitude": 1, + "AudioIn": 1, + "Biquad": 1, + "Delay": 1, + "Envelope": 1, + "FFT": 1, + "Gain": 1, + "Noise": 1, + "Oscillator": 1, + "Panner": 1, + "Panner3D": 1, + "PitchShifter": 1, + "Reverb": 1, + "sound": 1, + "SoundFile": 1 }, - "namespaces": {} + "namespaces": {}, + "module": "p5.sound", + "file": "src/SoundFile.js", + "line": 74, + "description": "Get the current volume of a sound." }, - "src/utilities/time_date.js": { - "name": "src/utilities/time_date.js", - "modules": { - "Time & Date": 1 + "SoundFile": { + "name": "SoundFile", + "submodules": {}, + "elements": {}, + "classes": { + "sound": 1, + "SoundFile": 1 }, - "classes": {}, "fors": { - "p5": 1 + "p5.sound": 1, + "sound": 1, + "SoundFile": 1 }, - "namespaces": {} + "is_submodule": 1, + "namespaces": {}, + "module": "p5.sound", + "namespace": "", + "file": "src/SoundFile.js", + "line": 74, + "description": "p5.sound.js extends p5.js with Web Audio functionality including audio input, playback, analysis and synthesis." }, - "src/webgl/3d_primitives.js": { - "name": "src/webgl/3d_primitives.js", - "modules": { - "3D Primitives": 1 + "Sound": { + "name": "Sound", + "submodules": { + "Sound Utilities": 1 }, + "elements": {}, "classes": {}, "fors": { - "p5": 1 + "sound": 1 }, "namespaces": {} }, - "src/webgl/GeometryBuilder.js": { - "name": "src/webgl/GeometryBuilder.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/webgl/interaction.js": { - "name": "src/webgl/interaction.js", - "modules": { - "Interaction": 1 - }, + "Sound Utilities": { + "name": "Sound Utilities", + "submodules": {}, + "elements": {}, "classes": {}, "fors": { - "p5": 1 + "sound": 1 }, - "namespaces": {} - }, - "src/webgl/light.js": { - "name": "src/webgl/light.js", - "modules": { - "Lights": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/webgl/loading.js": { - "name": "src/webgl/loading.js", - "modules": { - "3D Models": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/webgl/material.js": { - "name": "src/webgl/material.js", - "modules": { - "Material": 1 - }, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/webgl/p5.Camera.js": { - "name": "src/webgl/p5.Camera.js", - "modules": { - "Camera": 1 - }, - "classes": { - "p5.Camera": 1 - }, - "fors": { - "p5": 1, - "p5.Camera": 1 + "is_submodule": 1, + "namespaces": {}, + "module": "Sound", + "namespace": "", + "file": "src/Utils.js", + "line": 1 + } + }, + "classes": { + "p5": { + "name": "p5", + "file": "src/scripts/parsers/in/p5.js/src/core/main.js", + "line": 32, + "description": "

This is the p5 instance constructor.

\n

A p5 instance holds all the properties and methods related to\na p5 sketch. It expects an incoming sketch closure and it can also\ntake an optional node parameter for attaching the generated p5 canvas\nto a node. The sketch closure takes the newly created p5 instance as\nits sole argument and may optionally set preload(),\nsetup(), and/or\ndraw() properties on it for running a sketch.

\n

A p5 sketch can run in \"global\" or \"instance\" mode:\n\"global\" - all properties and methods are attached to the window\n\"instance\" - all properties and methods are bound to this p5 object

\n", + "example": [], + "params": [ + { + "name": "sketch", + "description": "a closure that can set optional preload(),\nsetup(), and/or draw() properties on the\ngiven p5 instance", + "type": "function(p5)" + }, + { + "name": "node", + "description": "element to attach canvas to", + "optional": 1, + "type": "HTMLElement" + } + ], + "return": { + "description": "a p5 instance", + "type": "p5" }, - "namespaces": {} + "is_constructor": 1, + "module": "Structure", + "submodule": "Structure" }, - "src/webgl/p5.DataArray.js": { - "name": "src/webgl/p5.DataArray.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} + "p5.Color": { + "name": "p5.Color", + "file": "src/scripts/parsers/in/p5.js/src/color/p5.Color.js", + "line": 688, + "description": "

A class to describe a color.

\n

Each p5.Color object stores the color mode\nand level maxes that were active during its construction. These values are\nused to interpret the arguments passed to the object's constructor. They\nalso determine output formatting such as when\nsaturation() is called.

\n

Color is stored internally as an array of ideal RGBA values in floating\npoint form, normalized from 0 to 1. These values are used to calculate the\nclosest screen colors, which are RGBA levels from 0 to 255. Screen colors\nare sent to the renderer.

\n

When different color representations are calculated, the results are cached\nfor performance. These values are normalized, floating-point numbers.

\n

Note: color() is the recommended way to create an\ninstance of this class.

\n", + "example": [], + "params": [ + { + "name": "pInst", + "description": "pointer to p5 instance.", + "optional": 1, + "type": "p5" + }, + { + "name": "vals", + "description": "an array containing the color values\nfor red, green, blue and alpha channel\nor CSS color.", + "type": "Number[]|String" + } + ], + "is_constructor": 1, + "module": "Color", + "submodule": "Creating & Reading" }, - "src/webgl/p5.Framebuffer.js": { - "name": "src/webgl/p5.Framebuffer.js", - "modules": { - "Rendering": 1 - }, - "classes": { - "p5.FramebufferCamera": 1, - "p5.FramebufferTexture": 1, - "p5.Framebuffer": 1 - }, - "fors": { - "p5.Framebuffer": 1 - }, - "namespaces": {} + "p5.Graphics": { + "name": "p5.Graphics", + "file": "src/scripts/parsers/in/p5.js/src/core/p5.Graphics.js", + "line": 673, + "extends": "p5.Element", + "description": "

A class to describe a drawing surface that's separate from the main canvas.

\n

Each p5.Graphics object provides a dedicated drawing surface called a\ngraphics buffer. Graphics buffers are helpful when drawing should happen\noffscreen. For example, separate scenes can be drawn offscreen and\ndisplayed only when needed.

\n

p5.Graphics objects have nearly all the drawing features of the main\ncanvas. For example, calling the method myGraphics.circle(50, 50, 20)\ndraws to the graphics buffer. The resulting image can be displayed on the\nmain canvas by passing the p5.Graphics object to the\nimage() function, as in image(myGraphics, 0, 0).

\n

Note: createGraphics() is the recommended\nway to create an instance of this class.

\n", + "example": [ + "
\n\nlet pg;\n\nfunction setup() {\n createCanvas(100, 100);\n\n // Create a p5.Graphics object.\n pg = createGraphics(50, 50);\n\n // Draw to the p5.Graphics object.\n pg.background(100);\n pg.circle(25, 25, 20);\n\n describe('A dark gray square with a white circle at its center drawn on a gray background.');\n}\n\nfunction draw() {\n background(200);\n\n // Display the p5.Graphics object.\n image(pg, 25, 25);\n}\n\n
\n\n
\n\n// Click the canvas to display the graphics buffer.\n\nlet pg;\n\nfunction setup() {\n createCanvas(100, 100);\n\n // Create a p5.Graphics object.\n pg = createGraphics(50, 50);\n\n describe('A square appears on a gray background when the user presses the mouse. The square cycles between white and black.');\n}\n\nfunction draw() {\n background(200);\n\n // Calculate the background color.\n let bg = frameCount % 255;\n\n // Draw to the p5.Graphics object.\n pg.background(bg);\n\n // Display the p5.Graphics object while\n // the user presses the mouse.\n if (mouseIsPressed === true) {\n image(pg, 25, 25);\n }\n}\n\n
" + ], + "params": [ + { + "name": "w", + "description": "width width of the graphics buffer in pixels.", + "type": "Number" + }, + { + "name": "h", + "description": "height height of the graphics buffer in pixels.", + "type": "Number" + }, + { + "name": "renderer", + "description": "the renderer to use, either P2D or WEBGL.", + "type": "P2D|WEBGL|P2DHDR" + }, + { + "name": "pInst", + "description": "sketch instance.", + "optional": 1, + "type": "p5" + }, + { + "name": "canvas", + "description": "existing <canvas> element to use.", + "optional": 1, + "type": "HTMLCanvasElement" + } + ], + "is_constructor": 1, + "module": "Rendering", + "submodule": "Rendering" }, - "src/webgl/p5.Geometry.js": { - "name": "src/webgl/p5.Geometry.js", - "modules": {}, - "classes": { - "p5.Geometry": 1 - }, - "fors": { - "p5": 1, - "p5.Geometry": 1 - }, - "namespaces": {} + "p5.Element": { + "name": "p5.Element", + "file": "src/scripts/parsers/in/p5.js/src/dom/p5.Element.js", + "line": 2466, + "description": "

A class to describe an\nHTML element.

\n

Sketches can use many elements. Common elements include the drawing canvas,\nbuttons, sliders, webcam feeds, and so on.

\n

All elements share the methods of the p5.Element class. They're created\nwith functions such as createCanvas() and\ncreateButton().

\n", + "example": [ + "
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Create a button element and\n // place it beneath the canvas.\n let btn = createButton('change');\n btn.position(0, 100);\n\n // Call randomColor() when\n // the button is pressed.\n btn.mousePressed(randomColor);\n\n describe('A gray square with a button that says \"change\" beneath it. The square changes color when the user presses the button.');\n}\n\n// Paint the background either\n// red, yellow, blue, or green.\nfunction randomColor() {\n let c = random(['red', 'yellow', 'blue', 'green']);\n background(c);\n}\n\n
" + ], + "params": [ + { + "name": "elt", + "description": "wrapped DOM element.", + "type": "HTMLElement" + }, + { + "name": "pInst", + "description": "pointer to p5 instance.", + "optional": 1, + "type": "p5" + } + ], + "is_constructor": 1, + "module": "DOM", + "submodule": "DOM" }, - "src/webgl/p5.Matrix.js": { - "name": "src/webgl/p5.Matrix.js", - "modules": {}, - "classes": { - "p5.Matrix": 1 - }, - "fors": {}, - "namespaces": {} + "p5.File": { + "name": "p5.File", + "file": "src/scripts/parsers/in/p5.js/src/dom/p5.File.js", + "line": 150, + "description": "

A class to describe a file.

\n

p5.File objects are used by\nmyElement.drop() and\ncreated by\ncreateFileInput.

\n", + "example": [ + "
\n\n// Use the file input to load a\n// file and display its info.\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Create a file input and place it beneath the canvas.\n // Call displayInfo() when the file loads.\n let input = createFileInput(displayInfo);\n input.position(0, 100);\n\n describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.');\n}\n\n// Display the p5.File's info once it loads.\nfunction displayInfo(file) {\n background(200);\n\n // Display the p5.File's name.\n text(file.name, 10, 10, 80, 40);\n\n // Display the p5.File's type and subtype.\n text(`${file.type}/${file.subtype}`, 10, 70);\n\n // Display the p5.File's size in bytes.\n text(file.size, 10, 90);\n}\n\n
\n\n
\n\n// Use the file input to select an image to\n// load and display.\nlet img;\n\nfunction setup() {\n createCanvas(100, 100);\n\n // Create a file input and place it beneath the canvas.\n // Call handleImage() when the file image loads.\n let input = createFileInput(handleImage);\n input.position(0, 100);\n\n describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.');\n}\n\nfunction draw() {\n background(200);\n\n // Draw the image if it's ready.\n if (img) {\n image(img, 0, 0, width, height);\n }\n}\n\n// Use the p5.File's data once it loads.\nfunction handleImage(file) {\n // Check the p5.File's type.\n if (file.type === 'image') {\n // Create an image using using the p5.File's data.\n img = createImg(file.data, '');\n\n // Hide the image element so it doesn't appear twice.\n img.hide();\n } else {\n img = null;\n }\n}\n\n
" + ], + "params": [ + { + "name": "file", + "description": "wrapped file.", + "type": "File" + } + ], + "is_constructor": 1, + "module": "DOM", + "submodule": "DOM" }, - "src/webgl/p5.Quat.js": { - "name": "src/webgl/p5.Quat.js", - "modules": { - "Quaternion": 1 - }, - "classes": { - "p5.Quat": 1 - }, - "fors": {}, - "namespaces": {} + "p5.MediaElement": { + "name": "p5.MediaElement", + "file": "src/scripts/parsers/in/p5.js/src/dom/p5.MediaElement.js", + "line": 1782, + "extends": "p5.Element", + "description": "

A class to handle audio and video.

\n

p5.MediaElement extends p5.Element with\nmethods to handle audio and video. p5.MediaElement objects are created by\ncalling createVideo,\ncreateAudio, and\ncreateCapture.

\n", + "example": [ + "
\n\nlet capture;\n\nfunction setup() {\n createCanvas(100, 100);\n\n // Create a p5.MediaElement using createCapture().\n capture = createCapture(VIDEO);\n capture.hide();\n\n describe('A webcam feed with inverted colors.');\n}\n\nfunction draw() {\n // Display the video stream and invert the colors.\n image(capture, 0, 0, width, width * capture.height / capture.width);\n filter(INVERT);\n}\n\n
" + ], + "params": [ + { + "name": "elt", + "description": "DOM node that is wrapped", + "type": "String" + } + ], + "is_constructor": 1, + "module": "DOM", + "submodule": "DOM" }, - "src/webgl/p5.RenderBuffer.js": { - "name": "src/webgl/p5.RenderBuffer.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} + "p5.Image": { + "name": "p5.Image", + "file": "src/scripts/parsers/in/p5.js/src/image/p5.Image.js", + "line": 2243, + "description": "

A class to describe an image.

\n

Images are rectangular grids of pixels that can be displayed and modified.

\n

Existing images can be loaded by calling\nloadImage(). Blank images can be created by\ncalling createImage(). p5.Image objects\nhave methods for common tasks such as applying filters and modifying\npixel values.

\n", + "example": [ + "
\n\nlet img;\n\nasync function setup() {\n // Load the image.\n img = await loadImage('assets/bricks.jpg');\n\n createCanvas(100, 100);\n\n // Display the image.\n image(img, 0, 0);\n\n describe('An image of a brick wall.');\n}\n\n
\n\n
\n\nlet img;\n\nasync function setup() {\n // Load the image.\n img = await loadImage('assets/bricks.jpg');\n\n createCanvas(100, 100);\n\n // Apply the GRAY filter.\n img.filter(GRAY);\n\n // Display the image.\n image(img, 0, 0);\n\n describe('A grayscale image of a brick wall.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Create a p5.Image object.\n let img = createImage(66, 66);\n\n // Load the image's pixels.\n img.loadPixels();\n\n // Set the pixels to black.\n for (let x = 0; x < img.width; x += 1) {\n for (let y = 0; y < img.height; y += 1) {\n img.set(x, y, 0);\n }\n }\n\n // Update the image.\n img.updatePixels();\n\n // Display the image.\n image(img, 17, 17);\n\n describe('A black square drawn in the middle of a gray square.');\n}\n\n
" + ], + "params": [ + { + "name": "width", + "type": "Number" + }, + { + "name": "height", + "type": "Number" + } + ], + "is_constructor": 1, + "module": "Image", + "submodule": "Image" }, - "src/webgl/p5.RendererGL.Immediate.js": { - "name": "src/webgl/p5.RendererGL.Immediate.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} + "p5.PrintWriter": { + "name": "p5.PrintWriter", + "file": "src/scripts/parsers/in/p5.js/src/io/files.js", + "line": 1374, + "description": "

A class to describe a print stream.

\n

Each p5.PrintWriter object provides a way to save a sequence of text\ndata, called the print stream, to the user's computer. It's a low-level\nobject that enables precise control of text output. Functions such as\nsaveStrings() and\nsaveJSON() are easier to use for simple file\nsaving.

\n

Note: createWriter() is the recommended way\nto make an instance of this class.

\n", + "example": [ + "
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Style the text.\n textAlign(LEFT, CENTER);\n textFont('Courier New');\n textSize(12);\n\n // Display instructions.\n text('Double-click to save', 5, 50, 90);\n\n describe('The text \"Double-click to save\" written in black on a gray background.');\n}\n\n// Save the file when the user double-clicks.\nfunction doubleClicked() {\n // Create a p5.PrintWriter object.\n let myWriter = createWriter('xo.txt');\n\n // Add some lines to the print stream.\n myWriter.print('XOO');\n myWriter.print('OXO');\n myWriter.print('OOX');\n\n // Save the file and close the print stream.\n myWriter.close();\n}\n\n
" + ], + "params": [ + { + "name": "filename", + "description": "name of the file to create.", + "type": "String" + }, + { + "name": "extension", + "description": "format to use for the file.", + "optional": 1, + "type": "String" + } + ], + "is_constructor": 1, + "module": "IO", + "submodule": "Input" }, - "src/webgl/p5.RendererGL.Retained.js": { - "name": "src/webgl/p5.RendererGL.Retained.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} + "p5.Table": { + "name": "p5.Table", + "file": "src/scripts/parsers/in/p5.js/src/io/p5.Table.js", + "line": 1360, + "deprecated": true, + "deprecationMessage": "p5.Table will be removed in a future version of p5.js to make way for a new, friendlier version :)", + "description": "Table objects store data with multiple rows and columns, much\nlike in a traditional spreadsheet. Tables can be generated from\nscratch, dynamically, or using data from an existing file.", + "example": [], + "params": [ + { + "name": "rows", + "description": "An array of p5.TableRow objects", + "optional": 1, + "type": "p5.TableRow[]" + } + ], + "is_constructor": 1, + "module": "IO", + "submodule": "Table" }, - "src/webgl/p5.RendererGL.js": { - "name": "src/webgl/p5.RendererGL.js", - "modules": {}, - "classes": { - "p5.RendererGL": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {} + "p5.TableRow": { + "name": "p5.TableRow", + "file": "src/scripts/parsers/in/p5.js/src/io/p5.TableRow.js", + "line": 368, + "deprecated": true, + "deprecationMessage": "p5.Table will be removed in a future version of p5.js to make way for a new, friendlier version :)", + "description": "

A TableRow object represents a single row of data values,\nstored in columns, from a table.

\n

A Table Row contains both an ordered array, and an unordered\nJSON object.

\n", + "example": [], + "params": [ + { + "name": "row", + "description": "optional: populate the row with an\narray of values", + "type": "any[]" + } + ], + "is_constructor": 1, + "module": "IO", + "submodule": "Table" }, - "src/webgl/p5.Shader.js": { - "name": "src/webgl/p5.Shader.js", - "modules": {}, - "classes": { - "p5.Shader": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {} + "p5.XML": { + "name": "p5.XML", + "file": "src/scripts/parsers/in/p5.js/src/io/p5.XML.js", + "line": 1290, + "description": "

A class to describe an XML object.

\n

Each p5.XML object provides an easy way to interact with XML data.\nExtensible Markup Language\n(XML)\nis a standard format for sending data between applications. Like HTML, the\nXML format is based on tags and attributes, as in\n<time units=\"s\">1234</time>.

\n

Note: Use loadXML() to load external XML files.

\n", + "example": [ + "
\n\nlet myXML;\n\nasync function setup() {\n // Load the XML and create a p5.XML object.\n myXML = await loadXML('assets/animals.xml');\n\n createCanvas(100, 100);\n\n background(200);\n\n // Get an array with all mammal tags.\n let mammals = myXML.getChildren('mammal');\n\n // Style the text.\n textAlign(LEFT, CENTER);\n textFont('Courier New');\n textSize(14);\n\n // Iterate over the mammals array.\n for (let i = 0; i < mammals.length; i += 1) {\n\n // Calculate the y-coordinate.\n let y = (i + 1) * 25;\n\n // Get the mammal's common name.\n let name = mammals[i].getContent();\n\n // Display the mammal's name.\n text(name, 20, y);\n }\n\n describe(\n 'The words \"Goat\", \"Leopard\", and \"Zebra\" written on three separate lines. The text is black on a gray background.'\n );\n}\n\n
" + ], + "params": [], + "is_constructor": 1, + "module": "IO", + "submodule": "Input" }, - "src/webgl/p5.Texture.js": { - "name": "src/webgl/p5.Texture.js", - "modules": {}, - "classes": { - "p5.Texture": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {} - }, - "src/webgl/text.js": { - "name": "src/webgl/text.js", - "modules": {}, - "classes": { - "ImageInfos": 1, - "FontInfo": 1, - "Cubic": 1 - }, - "fors": {}, - "namespaces": {} + "p5.Vector": { + "name": "p5.Vector", + "file": "src/scripts/parsers/in/p5.js/src/math/p5.Vector.js", + "line": 3904, + "description": "

A class to describe a two or three-dimensional vector.

\n

A vector can be thought of in different ways. In one view, a vector is like\nan arrow pointing in space. Vectors have both magnitude (length) and\ndirection.

\n

p5.Vector objects are often used to program motion because they simplify\nthe math. For example, a moving ball has a position and a velocity.\nPosition describes where the ball is in space. The ball's position vector\nextends from the origin to the ball's center. Velocity describes the ball's\nspeed and the direction it's moving. If the ball is moving straight up, its\nvelocity vector points straight up. Adding the ball's velocity vector to\nits position vector moves it, as in pos.add(vel). Vector math relies on\nmethods inside the p5.Vector class.

\n

Note: createVector() is the recommended way\nto make an instance of this class.

\n", + "example": [ + "
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Create p5.Vector objects.\n let p1 = createVector(25, 25);\n let p2 = createVector(75, 75);\n\n // Style the points.\n strokeWeight(5);\n\n // Draw the first point using a p5.Vector.\n point(p1);\n\n // Draw the second point using a p5.Vector's components.\n point(p2.x, p2.y);\n\n describe('Two black dots on a gray square, one at the top left and the other at the bottom right.');\n}\n\n
\n\n
\n\nlet pos;\nlet vel;\n\nfunction setup() {\n createCanvas(100, 100);\n\n // Create p5.Vector objects.\n pos = createVector(50, 100);\n vel = createVector(0, -1);\n\n describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.');\n}\n\nfunction draw() {\n background(200);\n\n // Add velocity to position.\n pos.add(vel);\n\n // If the dot reaches the top of the canvas,\n // restart from the bottom.\n if (pos.y < 0) {\n pos.y = 100;\n }\n\n // Draw the dot.\n strokeWeight(5);\n point(pos);\n}\n\n
" + ], + "params": [ + { + "name": "x", + "description": "x component of the vector.", + "optional": 1, + "type": "Number" + }, + { + "name": "y", + "description": "y component of the vector.", + "optional": 1, + "type": "Number" + }, + { + "name": "z", + "description": "z component of the vector.", + "optional": 1, + "type": "Number" + } + ], + "is_constructor": 1, + "module": "Math" }, - "lib/addons/p5.sound.js": { - "name": "lib/addons/p5.sound.js", - "modules": { - "p5.sound": 1 - }, - "classes": { - "p5.SoundFile": 1, - "p5.Amplitude": 1, - "p5.FFT": 1, - "p5.Oscillator": 1, - "p5.SinOsc": 1, - "p5.TriOsc": 1, - "p5.SawOsc": 1, - "p5.SqrOsc": 1, - "p5.Envelope": 1, - "p5.Noise": 1, - "p5.Pulse": 1, - "p5.AudioIn": 1, - "p5.Effect": 1, - "p5.Filter": 1, - "p5.LowPass": 1, - "p5.HighPass": 1, - "p5.BandPass": 1, - "p5.EQ": 1, - "p5.Panner3D": 1, - "p5.Delay": 1, - "p5.Reverb": 1, - "p5.Convolver": 1, - "p5.Phrase": 1, - "p5.Part": 1, - "p5.Score": 1, - "p5.SoundLoop": 1, - "p5.Compressor": 1, - "p5.PeakDetect": 1, - "p5.SoundRecorder": 1, - "p5.Distortion": 1, - "p5.Gain": 1, - "p5.AudioVoice": 1, - "p5.MonoSynth": 1, - "p5.OnsetDetect": 1, - "p5.PolySynth": 1 - }, - "fors": { - "p5.sound": 1, - "p5": 1, - "p5.SoundFile": 1, - "p5.Amplitude": 1, - "p5.FFT": 1, - "p5.Oscillator": 1, - "p5.Envelope": 1, - "p5.AudioIn": 1, - "p5.Effect": 1, - "p5.EQ": 1, - "p5.Panner3D": 1, - "p5.Delay": 1, - "p5.Reverb": 1, - "p5.Convolver": 1, - "p5.Part": 1, - "p5.Score": 1, - "p5.SoundLoop": 1, - "p5.Compressor": 1, - "p5.SoundRecorder": 1, - "p5.Distortion": 1, - "p5.Gain": 1, - "p5.AudioVoice": 1, - "p5.MonoSynth": 1, - "p5.PolySynth": 1 - }, - "namespaces": {} + "p5.Font": { + "name": "p5.Font", + "file": "src/scripts/parsers/in/p5.js/src/type/p5.Font.js", + "line": 1149, + "description": "A class to describe fonts. Create through loadFont().", + "example": [], + "params": [], + "is_constructor": 1, + "module": "Typography" }, - "lib/addons/p5.sound.min.js": { - "name": "lib/addons/p5.sound.min.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - } - }, - "modules": { - "Environment": { - "name": "Environment", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "module": "Environment", - "file": "src/accessibility/color_namer.js", - "line": 1, - "requires": [ - "core" - ] + "p5.Camera": { + "name": "p5.Camera", + "file": "src/scripts/parsers/in/p5.js/src/webgl/p5.Camera.js", + "line": 3957, + "description": "

A class to describe a camera for viewing a 3D sketch.

\n

Each p5.Camera object represents a camera that views a section of 3D\nspace. It stores information about the camera’s position, orientation, and\nprojection.

\n

In WebGL mode, the default camera is a p5.Camera object that can be\ncontrolled with the camera(),\nperspective(),\northo(), and\nfrustum() functions. Additional cameras can be\ncreated with createCamera() and activated\nwith setCamera().

\n

Note: p5.Camera’s methods operate in two coordinate systems:

\n", + "example": [ + "
\n\nlet cam;\nlet delta = 0.001;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create a p5.Camera object.\n cam = createCamera();\n\n // Set the camera\n setCamera(cam);\n\n // Place the camera at the top-center.\n cam.setPosition(0, -400, 800);\n\n // Point the camera at the origin.\n cam.lookAt(0, 0, 0);\n\n describe(\n 'A white cube on a gray background. The cube goes in and out of view as the camera pans left and right.'\n );\n}\n\nfunction draw() {\n background(200);\n\n // Turn the camera left and right, called \"panning\".\n cam.pan(delta);\n\n // Switch directions every 120 frames.\n if (frameCount % 120 === 0) {\n delta *= -1;\n }\n\n // Draw the box.\n box();\n}\n\n
\n\n
\n\n// Double-click to toggle between cameras.\n\nlet cam1;\nlet cam2;\nlet isDefaultCamera = true;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create the first camera.\n // Keep its default settings.\n cam1 = createCamera();\n\n // Create the second camera.\n // Place it at the top-left.\n // Point it at the origin.\n cam2 = createCamera();\n cam2.setPosition(400, -400, 800);\n cam2.lookAt(0, 0, 0);\n\n // Set the current camera to cam1.\n setCamera(cam1);\n\n describe(\n 'A white cube on a gray background. The camera toggles between frontal and aerial views when the user double-clicks.'\n );\n}\n\nfunction draw() {\n background(200);\n\n // Draw the box.\n box();\n}\n\n// Toggle the current camera when the user double-clicks.\nfunction doubleClicked() {\n if (isDefaultCamera === true) {\n setCamera(cam2);\n isDefaultCamera = false;\n } else {\n setCamera(cam1);\n isDefaultCamera = true;\n }\n}\n\n
" + ], + "params": [ + { + "name": "rendererGL", + "description": "instance of WebGL renderer", + "type": "rendererGL" + } + ], + "is_constructor": 1, + "module": "3D", + "submodule": "Camera" }, - "Color": { - "name": "Color", - "submodules": { - "Color Conversion": 1, - "Creating & Reading": 1, - "Setting": 1 - }, - "elements": {}, - "classes": { - "p5.Color": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "file": "src/color/p5.Color.js", - "line": 318 + "p5.Framebuffer": { + "name": "p5.Framebuffer", + "file": "src/scripts/parsers/in/p5.js/src/webgl/p5.Framebuffer.js", + "line": 1650, + "description": "

A class to describe a high-performance drawing surface for textures.

\n

Each p5.Framebuffer object provides a dedicated drawing surface called\na framebuffer. They're similar to\np5.Graphics objects but can run much faster.\nPerformance is improved because the framebuffer shares the same WebGL\ncontext as the canvas used to create it.

\n

p5.Framebuffer objects have all the drawing features of the main\ncanvas. Drawing instructions meant for the framebuffer must be placed\nbetween calls to\nmyBuffer.begin() and\nmyBuffer.end(). The resulting image\ncan be applied as a texture by passing the p5.Framebuffer object to the\ntexture() function, as in texture(myBuffer).\nIt can also be displayed on the main canvas by passing it to the\nimage() function, as in image(myBuffer, 0, 0).

\n

Note: createFramebuffer() is the\nrecommended way to create an instance of this class.

\n", + "example": [], + "params": [ + { + "name": "target", + "description": "sketch instance or\np5.Graphics\nobject.", + "type": "p5.Graphics|p5" + }, + { + "name": "settings", + "description": "configuration options.", + "optional": 1, + "type": "Object" + } + ], + "is_constructor": 1, + "module": "Rendering" }, - "Color Conversion": { - "name": "Color Conversion", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Color", - "namespace": "", - "file": "src/color/color_conversion.js", - "line": 1, - "requires": [ - "core" - ] + "p5.Geometry": { + "name": "p5.Geometry", + "file": "src/scripts/parsers/in/p5.js/src/webgl/p5.Geometry.js", + "line": 2165, + "description": "

A class to describe a 3D shape.

\n

Each p5.Geometry object represents a 3D shape as a set of connected\npoints called vertices. All 3D shapes are made by connecting vertices to\nform triangles that are stitched together. Each triangular patch on the\ngeometry's surface is called a face. The geometry stores information\nabout its vertices and faces for use with effects such as lighting and\ntexture mapping.

\n

The first parameter, detailX, is optional. If a number is passed, as in\nnew p5.Geometry(24), it sets the number of triangle subdivisions to use\nalong the geometry's x-axis. By default, detailX is 1.

\n

The second parameter, detailY, is also optional. If a number is passed,\nas in new p5.Geometry(24, 16), it sets the number of triangle\nsubdivisions to use along the geometry's y-axis. By default, detailX is\n1.

\n

The third parameter, callback, is also optional. If a function is passed,\nas in new p5.Geometry(24, 16, createShape), it will be called once to add\nvertices to the new 3D shape.

\n", + "example": [ + "
\n\n// Click and drag the mouse to view the scene from different angles.\n\nlet myGeometry;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create a p5.Geometry object.\n myGeometry = new p5.Geometry();\n\n // Create p5.Vector objects to position the vertices.\n let v0 = createVector(-40, 0, 0);\n let v1 = createVector(0, -40, 0);\n let v2 = createVector(40, 0, 0);\n\n // Add the vertices to the p5.Geometry object's vertices array.\n myGeometry.vertices.push(v0, v1, v2);\n\n describe('A white triangle drawn on a gray background.');\n}\n\nfunction draw() {\n background(200);\n\n // Enable orbiting with the mouse.\n orbitControl();\n\n // Draw the p5.Geometry object.\n model(myGeometry);\n}\n\n
\n\n
\n\n// Click and drag the mouse to view the scene from different angles.\n\nlet myGeometry;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create a p5.Geometry object using a callback function.\n myGeometry = new p5.Geometry(1, 1, createShape);\n\n describe('A white triangle drawn on a gray background.');\n}\n\nfunction draw() {\n background(200);\n\n // Enable orbiting with the mouse.\n orbitControl();\n\n // Draw the p5.Geometry object.\n model(myGeometry);\n}\n\nfunction createShape() {\n // Create p5.Vector objects to position the vertices.\n let v0 = createVector(-40, 0, 0);\n let v1 = createVector(0, -40, 0);\n let v2 = createVector(40, 0, 0);\n\n // \"this\" refers to the p5.Geometry object being created.\n\n // Add the vertices to the p5.Geometry object's vertices array.\n this.vertices.push(v0, v1, v2);\n\n // Add an array to list which vertices belong to the face.\n // Vertices are listed in clockwise \"winding\" order from\n // left to top to right.\n this.faces.push([0, 1, 2]);\n}\n\n
\n\n
\n\n// Click and drag the mouse to view the scene from different angles.\n\nlet myGeometry;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create a p5.Geometry object using a callback function.\n myGeometry = new p5.Geometry(1, 1, createShape);\n\n describe('A white triangle drawn on a gray background.');\n}\n\nfunction draw() {\n background(200);\n\n // Enable orbiting with the mouse.\n orbitControl();\n\n // Draw the p5.Geometry object.\n model(myGeometry);\n}\n\nfunction createShape() {\n // Create p5.Vector objects to position the vertices.\n let v0 = createVector(-40, 0, 0);\n let v1 = createVector(0, -40, 0);\n let v2 = createVector(40, 0, 0);\n\n // \"this\" refers to the p5.Geometry object being created.\n\n // Add the vertices to the p5.Geometry object's vertices array.\n this.vertices.push(v0, v1, v2);\n\n // Add an array to list which vertices belong to the face.\n // Vertices are listed in clockwise \"winding\" order from\n // left to top to right.\n this.faces.push([0, 1, 2]);\n\n // Compute the surface normals to help with lighting.\n this.computeNormals();\n}\n\n
\n\n
\n\n// Click and drag the mouse to view the scene from different angles.\n\n// Adapted from Paul Wheeler's wonderful p5.Geometry tutorial.\n// https://www.paulwheeler.us/articles/custom-3d-geometry-in-p5js/\n// CC-BY-SA 4.0\n\nlet myGeometry;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create the p5.Geometry object.\n // Set detailX to 48 and detailY to 2.\n // >>> try changing them.\n myGeometry = new p5.Geometry(48, 2, createShape);\n}\n\nfunction draw() {\n background(50);\n\n // Enable orbiting with the mouse.\n orbitControl();\n\n // Turn on the lights.\n lights();\n\n // Style the p5.Geometry object.\n strokeWeight(0.2);\n\n // Draw the p5.Geometry object.\n model(myGeometry);\n}\n\nfunction createShape() {\n // \"this\" refers to the p5.Geometry object being created.\n\n // Define the Möbius strip with a few parameters.\n let spread = 0.1;\n let radius = 30;\n let stripWidth = 15;\n let xInterval = 4 * PI / this.detailX;\n let yOffset = -stripWidth / 2;\n let yInterval = stripWidth / this.detailY;\n\n for (let j = 0; j <= this.detailY; j += 1) {\n // Calculate the \"vertical\" point along the strip.\n let v = yOffset + yInterval * j;\n\n for (let i = 0; i <= this.detailX; i += 1) {\n // Calculate the angle of rotation around the strip.\n let u = i * xInterval;\n\n // Calculate the coordinates of the vertex.\n let x = (radius + v * cos(u / 2)) * cos(u) - sin(u / 2) * 2 * spread;\n let y = (radius + v * cos(u / 2)) * sin(u);\n if (u < TWO_PI) {\n y += sin(u) * spread;\n } else {\n y -= sin(u) * spread;\n }\n let z = v * sin(u / 2) + sin(u / 4) * 4 * spread;\n\n // Create a p5.Vector object to position the vertex.\n let vert = createVector(x, y, z);\n\n // Add the vertex to the p5.Geometry object's vertices array.\n this.vertices.push(vert);\n }\n }\n\n // Compute the faces array.\n this.computeFaces();\n\n // Compute the surface normals to help with lighting.\n this.computeNormals();\n}\n\n
" + ], + "params": [ + { + "name": "detailX", + "description": "number of vertices along the x-axis.", + "optional": 1, + "type": "Integer" + }, + { + "name": "detailY", + "description": "number of vertices along the y-axis.", + "optional": 1, + "type": "Integer" + }, + { + "name": "callback", + "description": "function to call once the geometry is created.", + "optional": 1, + "type": "function" + } + ], + "is_constructor": 1, + "module": "Shape", + "submodule": "3D Primitives" }, - "Creating & Reading": { - "name": "Creating & Reading", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Color": 1 - }, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Color", - "namespace": "", - "file": "src/color/p5.Color.js", - "line": 318, - "requires": [ - "core", - "constants" + "p5.Shader": { + "name": "p5.Shader", + "file": "src/scripts/parsers/in/p5.js/src/webgl/p5.Shader.js", + "line": 1497, + "description": "

A class to describe a shader program.

\n

Each p5.Shader object contains a shader program that runs on the graphics\nprocessing unit (GPU). Shaders can process many pixels or vertices at the\nsame time, making them fast for many graphics tasks. They’re written in a\nlanguage called\nGLSL\nand run along with the rest of the code in a sketch.

\n

A shader program consists of two files, a vertex shader and a fragment\nshader. The vertex shader affects where 3D geometry is drawn on the screen\nand the fragment shader affects color. Once the p5.Shader object is\ncreated, it can be used with the shader()\nfunction, as in shader(myShader).

\n

A shader can optionally describe hooks, which are functions in GLSL that\nusers may choose to provide to customize the behavior of the shader. For the\nvertex or the fragment shader, users can pass in an object where each key is\nthe type and name of a hook function, and each value is a string with the\nparameter list and default implementation of the hook. For example, to let users\noptionally run code at the start of the vertex shader, the options object could\ninclude:

\n
{\n  vertex: {\n    'void beforeVertex': '() {}'\n  }\n}

Then, in your vertex shader source, you can run a hook by calling a function\nwith the same name prefixed by HOOK_:

\n
void main() {\n  HOOK_beforeVertex();\n  // Add the rest ofy our shader code here!\n}

Note: createShader(),\ncreateFilterShader(), and\nloadShader() are the recommended ways to\ncreate an instance of this class.

\n", + "example": [ + "
\n\n// Note: A \"uniform\" is a global variable within a shader program.\n\n// Create a string with the vertex shader program.\n// The vertex shader is called for each vertex.\nlet vertSrc = `\nprecision highp float;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n vTexCoord = aTexCoord;\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n`;\n\n// Create a string with the fragment shader program.\n// The fragment shader is called for each pixel.\nlet fragSrc = `\nprecision highp float;\n\nvoid main() {\n // Set each pixel's RGBA value to yellow.\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n`;\n\nfunction setup() {\n createCanvas(100, 100, WEBGL);\n\n // Create a p5.Shader object.\n let myShader = createShader(vertSrc, fragSrc);\n\n // Apply the p5.Shader object.\n shader(myShader);\n\n // Style the drawing surface.\n noStroke();\n\n // Add a plane as a drawing surface.\n plane(100, 100);\n\n describe('A yellow square.');\n}\n\n
\n\n
\n\n// Note: A \"uniform\" is a global variable within a shader program.\n\nlet mandelbrot;\n\nasync function setup() {\n mandelbrot = await loadShader('assets/shader.vert', 'assets/shader.frag');\n createCanvas(100, 100, WEBGL);\n\n // Use the p5.Shader object.\n shader(mandelbrot);\n\n // Set the shader uniform p to an array.\n mandelbrot.setUniform('p', [-0.74364388703, 0.13182590421]);\n\n describe('A fractal image zooms in and out of focus.');\n}\n\nfunction draw() {\n // Set the shader uniform r to a value that oscillates between 0 and 2.\n mandelbrot.setUniform('r', sin(frameCount * 0.01) + 1);\n\n // Add a quad as a display surface for the shader.\n quad(-1, -1, 1, -1, 1, 1, -1, 1);\n}\n\n
" + ], + "params": [ + { + "name": "renderer", + "description": "WebGL context for this shader.", + "type": "p5.RendererGL" + }, + { + "name": "vertSrc", + "description": "source code for the vertex shader program.", + "type": "String" + }, + { + "name": "fragSrc", + "description": "source code for the fragment shader program.", + "type": "String" + }, + { + "name": "options", + "description": "

An optional object describing how this shader can\nbe augmented with hooks. It can include:

\n", + "optional": 1, + "type": "Object" + } ], - "description": "

A class to describe a color.

\n

Each p5.Color object stores the color mode\nand level maxes that were active during its construction. These values are\nused to interpret the arguments passed to the object's constructor. They\nalso determine output formatting such as when\nsaturation() is called.

\n

Color is stored internally as an array of ideal RGBA values in floating\npoint form, normalized from 0 to 1. These values are used to calculate the\nclosest screen colors, which are RGBA levels from 0 to 255. Screen colors\nare sent to the renderer.

\n

When different color representations are calculated, the results are cached\nfor performance. These values are normalized, floating-point numbers.

\n

Note: color() is the recommended way to create an\ninstance of this class.

\n" + "is_constructor": 1, + "module": "3D", + "submodule": "Material" }, - "Setting": { - "name": "Setting", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Color", + "p5.p5.sound": { + "name": "p5.p5.sound", + "shortname": "p5.sound", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", + "namespace": "" + }, + "p5.Amplitude": { + "name": "p5.Amplitude", + "shortname": "Amplitude", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/color/setting.js", - "line": 1, - "requires": [ - "core", - "constants" + "file": "src/Amplitude.js", + "line": 10, + "description": "Get the current volume of a sound.", + "is_constructor": 1, + "params": [ + { + "name": "smoothing", + "description": "Smooth the amplitude analysis by averaging with the last analysis frame. 0.0 is no time averaging with the last analysis frame.", + "type": "Number", + "optional": true + } + ], + "example": [ + "\n
\n\nlet sound, amp, cnv;\n \nfunction preload() {\n //replace this sound with something local with rights to distribute\n sound = loadSound('/assets/Damscray_DancingTiger.mp3');\n}\n\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.mousePressed(playSound);\n textAlign(CENTER);\n fill(255);\n amp = new p5.Amplitude();\n sound.connect(amp);\n}\n\nfunction playSound() {\n sound.play();\n}\n\nfunction draw() {\n let level = amp.getLevel();\n level = map(level, 0, 0.2, 0, 255);\n background(level, 0, 0);\n text('tap to play', width/2, 20);\n describe('The color of the background changes based on the amplitude of the sound.');\n}\n\n
" ] }, - "Shape": { - "name": "Shape", - "submodules": { - "2D Primitives": 1, - "Curves": 1, - "Vertex": 1, - "3D Primitives": 1, - "3D Models": 1 - }, - "elements": {}, - "classes": { - "p5.Geometry": 1, - "p5.Matrix": 1 - }, - "fors": { - "p5": 1, - "p5.Geometry": 1 - }, - "namespaces": {}, - "file": "src/webgl/p5.Matrix.js", - "line": 19 - }, - "2D Primitives": { - "name": "2D Primitives", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Shape", + "p5.AudioIn": { + "name": "p5.AudioIn", + "shortname": "AudioIn", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/core/shape/2d_primitives.js", - "line": 1, - "requires": [ - "core", - "constants" + "file": "src/AudioIn.js", + "line": 11, + "description": "Get sound from an input source, typically a computer microphone.", + "is_constructor": 1, + "example": [ + "\n
\n\nlet mic, delay, filter;\n\nfunction setup() {\n let cnv = createCanvas(100, 100);\n cnv.mousePressed(startMic);\n background(220);\n \n mic = new p5.AudioIn();\n delay = new p5.Delay(0.74, 0.1);\n filter = new p5.Biquad(600, \"bandpass\");\n \n mic.disconnect();\n mic.connect(delay);\n delay.disconnect();\n delay.connect(filter);\n \n textAlign(CENTER);\n textWrap(WORD);\n textSize(10);\n text('click to open mic, watch out for feedback', 0, 20, 100);\n describe('a sketch that accesses the user\\'s microphone and connects it to a delay line.')\n}\n\nfunction startMic() {\n mic.start();\n}\n\nfunction draw() {\n d = map(mouseX, 0, width, 0.0, 0.5);\n delay.delayTime(d);\n}\n\n
" ] }, - "Attributes": { - "name": "Attributes", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Typography", + "p5.Biquad": { + "name": "p5.Biquad", + "shortname": "Biquad", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/core/shape/attributes.js", - "line": 1, - "requires": [ - "core", - "constants" + "file": "src/Biquad.js", + "line": 11, + "description": "Filter the frequency range of a sound.", + "is_constructor": 1, + "params": [ + { + "name": "cutoff", + "description": "cutoff frequency of the filter, a value between 0 and 24000.", + "type": "Number", + "optional": true + }, + { + "name": "type", + "description": "filter type. Options: \"lowpass\", \n \"highpass\", \"bandpass\", \"lowshelf\",\n \"highshelf\", \"notch\", \"allpass\", \n \"peaking\"", + "type": "String", + "optional": true + } + ], + "example": [ + "\n
\n\n///kind of Karplus-Strong string synthesis using p5.sound.js\n\nlet noise, lowPass, hiPass, delay, env, gain;\n\nfunction setup() {\n let cnv = createCanvas(100, 100);\n background(220);\n textAlign(CENTER);\n textSize(9);\n text('click and drag mouse', width/2, height/2);\n \n noise = new p5.Noise('white');\n env = new p5.Envelope(0);\n lowPass = new p5.Biquad(1200, 'lowpass');\n hiPass = new p5.Biquad(55, 'highpass');\n delay = new p5.Delay(0.0005, 0.97);\n gain = new p5.Gain(0.5);\n noise.disconnect();\n noise.connect(hiPass);\n hiPass.disconnect();\n hiPass.connect(env);\n env.disconnect();\n env.connect(lowPass);\n lowPass.disconnect();\n lowPass.connect(delay);\n\n cnv.mousePressed(pluckStart);\n cnv.mouseReleased(pluckStop);\n cnv.mouseOut(pluckStop);\n describe('A sketch that synthesizes string sounds.');\n}\n\nfunction pluckStart() {\n background(0, 255, 255);\n text('release to trigger decay', width/2, height/2);\n let dtime = map(mouseX, 0, width, 0.009, 0.001);\n delay.delayTime(dtime, 0);\n noise.start();\n env.triggerAttack();\n}\n\nfunction pluckStop() {\n background(220);\n text('click to pluck', width/2, height/2);\n env.triggerRelease();\n}\n\n
" ] }, - "Curves": { - "name": "Curves", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Shape", + "p5.LowPass": { + "name": "p5.LowPass", + "shortname": "LowPass", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/core/shape/curves.js", - "line": 1, - "requires": [ - "core" + "file": "src/Biquad.js", + "line": 136, + "description": "Creates a Lowpass Biquad filter.", + "is_constructor": 1, + "extends": "Biquad", + "params": [ + { + "name": "freq", + "description": "Set the cutoff frequency of the filter", + "type": "Number", + "optional": true + } ] }, - "Vertex": { - "name": "Vertex", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Shape", + "p5.HighPass": { + "name": "p5.HighPass", + "shortname": "HighPass", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/core/shape/vertex.js", - "line": 1, - "requires": [ - "core", - "constants" + "file": "src/Biquad.js", + "line": 150, + "description": "Creates a Highpass Biquad filter.", + "is_constructor": 1, + "extends": "Biquad", + "params": [ + { + "name": "freq", + "description": "Set the cutoff frequency of the filter", + "type": "Number", + "optional": true + } ] }, - "Constants": { - "name": "Constants", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "module": "Constants", - "file": "src/core/constants.js", - "line": 1 - }, - "Structure": { - "name": "Structure", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "module": "IO", - "file": "src/core/main.js", - "line": 1, - "requires": [ - "constants" + "p5.BandPass": { + "name": "p5.BandPass", + "shortname": "BandPass", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", + "namespace": "", + "file": "src/Biquad.js", + "line": 164, + "description": "Creates a Bandpass Biquad filter.", + "is_constructor": 1, + "extends": "Biquad", + "params": [ + { + "name": "freq", + "description": "Set the cutoff frequency of the filter", + "type": "Number", + "optional": true + } ] }, - "DOM": { - "name": "DOM", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Element": 1, - "p5.MediaElement": 1, - "p5.File": 1 - }, - "fors": { - "p5.Element": 1, - "p5": 1 - }, - "namespaces": {}, - "module": "DOM", - "file": "src/dom/dom.js", - "line": 5482, - "description": "

The web is much more than just canvas and the DOM functionality makes it easy to interact\nwith other HTML5 objects, including text, hyperlink, image, input, video,\naudio, and webcam.\nThere is a set of creation methods, DOM manipulation methods, and\nan extended p5.Element that supports a range of HTML elements. See the\n\nbeyond the canvas tutorial for a full overview of how this addon works.

\n

See tutorial: beyond the canvas\nfor more info on how to use this library.

\n", - "requires": [ - "p5" + "p5.Delay": { + "name": "p5.Delay", + "shortname": "Delay", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", + "namespace": "", + "file": "src/Delay.js", + "line": 12, + "description": "A delay effect with parameters for feedback, and delay time.", + "is_constructor": 1, + "params": [ + { + "name": "delayTime", + "description": "The delay time in seconds between 0 and 1. Defaults to 0.250.", + "type": "Number", + "optional": true + }, + { + "name": "feedback", + "description": "The amount of feedback in the delay line between 0 and 1. Defaults to 0.2.", + "type": "Number", + "optional": true + } + ], + "example": [ + "\n
\n\nlet osc;\n\nfunction setup() {\n let cnv = createCanvas(100, 100);\n background(220);\n textAlign(CENTER);\n text('tap to play', width/2, height/2);\n\n osc = new p5.Oscillator('square');\n osc.amp(0.5);\n delay = new p5.Delay(0.12, 0.7);\n \n osc.disconnect();\n osc.connect(delay);\n\n cnv.mousePressed(oscStart);\n describe('Tap to play a square wave with delay effect.');\n}\n\nfunction oscStart() {\n osc.start();\n}\n\n\n
\nfunction mouseReleased() {\n osc.stop();\n}" ] }, - "Rendering": { - "name": "Rendering", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Graphics": 1, - "p5.Renderer": 1, - "p5.FramebufferCamera": 1, - "p5.FramebufferTexture": 1, - "p5.Framebuffer": 1, - "p5.RendererGL": 1 - }, - "fors": { - "p5": 1, - "p5.Framebuffer": 1 - }, - "namespaces": {}, - "module": "Rendering", - "file": "src/webgl/p5.RendererGL.js", - "line": 948, - "tag": "module", - "description": "

A class to describe a drawing surface that's separate from the main canvas.

\n

Each p5.Graphics object provides a dedicated drawing surface called a\ngraphics buffer. Graphics buffers are helpful when drawing should happen\noffscreen. For example, separate scenes can be drawn offscreen and\ndisplayed only when needed.

\n

p5.Graphics objects have nearly all the drawing features of the main\ncanvas. For example, calling the method myGraphics.circle(50, 50, 20)\ndraws to the graphics buffer. The resulting image can be displayed on the\nmain canvas by passing the p5.Graphics object to the\nimage() function, as in image(myGraphics, 0, 0).

\n

Note: createGraphics() is the recommended\nway to create an instance of this class.

\n", - "requires": [ - "constants" + "p5.Envelope": { + "name": "p5.Envelope", + "shortname": "Envelope", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", + "namespace": "", + "file": "src/Envelope.js", + "line": 10, + "description": "Generate an amplitude envelope.", + "is_constructor": 1, + "params": [ + { + "name": "attack", + "description": "how quickly the envelope reaches the maximum level", + "type": "Number", + "optional": true + }, + { + "name": "decay", + "description": "how quickly the envelope reaches the sustain level", + "type": "Number", + "optional": true + }, + { + "name": "sustain", + "description": "how long the envelope stays at the decay level", + "type": "Number", + "optional": true + }, + { + "name": "release", + "description": "how quickly the envelope fades out after the sustain level", + "type": "Number", + "optional": true + } + ], + "example": [ + "\n
\n\nconsole.log('do an example here');\n\n
" ] }, - "Foundation": { - "name": "Foundation", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "module": "Foundation", - "file": "src/core/reference.js", - "line": 1 + "p5.FFT": { + "name": "p5.FFT", + "shortname": "FFT", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", + "namespace": "", + "file": "src/FFT.js", + "line": 11, + "description": "Analyze the frequency spectrum and waveform of sounds.", + "is_constructor": 1, + "params": [ + { + "name": "fftSize", + "description": "FFT analysis size. Must be a power of two between 16 and 1024. Defaults to 32.", + "type": "Number", + "optional": true + } + ], + "example": [ + "\n
\n\nlet osc;\n\nfunction setup(){\n let cnv = createCanvas(100,100);\n cnv.mouseClicked(togglePlay);\n fft = new p5.FFT(32);\n osc = new p5.TriOsc(440);\n osc.connect(fft);\n}\n\nfunction draw(){\n background(220);\n let spectrum = fft.analyze();\n noStroke();\n fill(255, 0, 0);\n\n for (let i = 0; i < spectrum.length; i++) {\n let x = map(i, 0, spectrum.length, 0, width); \n let h = -height + map(spectrum[i], 0, 0.1, height, 0);\n rect(x, height, width / spectrum.length, h )\n }\n\n let waveform = fft.waveform();\n noFill();\n beginShape();\n stroke(20);\n \n for (let i = 0; i < waveform.length; i++){\n let x = map(i, 0, waveform.length, 0, width);\n let y = map( waveform[i], -1, 1, 0, height);\n vertex(x,y);\n }\n endShape();\n \n textAlign(CENTER);\n text('tap to play', width/2, 20);\n osc.freq(map(mouseX, 0, width, 100, 2000));\n describe('The sketch displays the frequency spectrum and waveform of the sound that plays.');\n}\n\nfunction togglePlay() {\n osc.start();\n}\n\n
" + ] }, - "Transform": { - "name": "Transform", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "module": "Transform", - "file": "src/core/transform.js", - "line": 1, - "requires": [ - "core", - "constants" + "p5.Gain": { + "name": "p5.Gain", + "shortname": "Gain", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", + "namespace": "", + "file": "src/Gain.js", + "line": 10, + "description": "Generate a gain node to use for mixing and main volume.", + "is_constructor": 1, + "example": [ + "\n
\n\nlet cnv, soundFile, osc, gain;\n\nfunction preload() {\n soundFile = loadSound('assets/Damscray_DancingTiger.mp3');\n}\n\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.mousePressed(playSound);\n\n gain = new p5.Gain(0.74);\n osc = new p5.Oscillator();\n osc.amp(0.74);\n osc.disconnect();\n soundFile.loop();\n soundFile.disconnect();\n\n //connect both sound sources to gain node\n soundFile.connect(gain);\n osc.connect(gain);\n}\n\nfunction playSound() {\n soundFile.play();\n soundFile.play();\n}\n\nfunction draw() {\n background(220);\n let level = map(mouseX, 0, width, 0, 1);\n gain.amp(level);\n}\n\n
" ] }, - "Data": { - "name": "Data", - "submodules": { - "LocalStorage": 1, - "Dictionary": 1, - "Array Functions": 1, - "Conversion": 1, - "String Functions": 1 - }, - "elements": {}, - "classes": { - "p5.TypedDict": 1, - "p5.StringDict": 1, - "p5.NumberDict": 1 - }, - "fors": { - "p5": 1, - "p5.TypedDict": 1 - }, - "namespaces": {}, - "file": "src/data/p5.TypedDict.js", - "line": 415 - }, - "LocalStorage": { - "name": "LocalStorage", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Data", + "p5.Noise": { + "name": "p5.Noise", + "shortname": "Noise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/data/local_storage.js", - "line": 1, - "requires": [ - "core\n\nThis module defines the p5 methods for working with local storage" + "file": "src/Noise.js", + "line": 11, + "description": "Generate a buffer with random values.", + "is_constructor": 1, + "params": [ + { + "name": "type", + "description": "- the type of noise (white, pink, brown)", + "type": "String", + "optional": true + } + ], + "example": [ + "\n
\n\nlet noise, env, cnv;\nlet types = ['white', 'pink', 'brown'];\nlet noiseType = 'brown';\n\nfunction setup() {\n cnv = createCanvas(100, 100);\n textAlign(CENTER);\n cnv.mousePressed(start);\n noise = new p5.Noise(noiseType);\n env = new p5.Envelope(0.01, 0.1, 0.15, 0.5);\n noise.disconnect();\n noise.connect(env);\n noise.start();\n}\n\nfunction start() {\n noiseType = random(types);\n noise.type(noiseType);\n env.play();\n}\n\nfunction draw() {\n background(noiseType);\n text('tap to play', width/2, 20);\n let txt = 'type: ' + noiseType;\n text(txt, width/2, 40);\n}\n\n
" ] }, - "Dictionary": { - "name": "Dictionary", - "submodules": {}, - "elements": {}, - "classes": { - "p5.TypedDict": 1, - "p5.StringDict": 1, - "p5.NumberDict": 1 - }, - "fors": { - "p5.TypedDict": 1, - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Data", + "p5.Oscillator": { + "name": "p5.Oscillator", + "shortname": "Oscillator", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/data/p5.TypedDict.js", - "line": 415, - "requires": [ - "core\n\nThis module defines the p5 methods for the p5 Dictionary classes.\nThe classes StringDict and NumberDict are for storing and working\nwith key-value pairs." - ], - "description": "

Base class for all p5.Dictionary types. Specifically\n typed Dictionary classes inherit from this class.

\n" - }, - "Events": { - "name": "Events", - "submodules": { - "Acceleration": 1, - "Keyboard": 1, - "Mouse": 1, - "Touch": 1 - }, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "file": "src/events/acceleration.js", - "line": 1, - "requires": [ - "core" + "file": "src/Oscillator.js", + "line": 12, + "description": "Generate Sine, Triangle, Square and Sawtooth waveforms.", + "is_constructor": 1, + "params": [ + { + "name": "frequency", + "description": "frequency defaults to 440Hz", + "type": "Number", + "optional": true + }, + { + "name": "type", + "description": "type of oscillator. Options:\n 'sine' (default), 'triangle',\n 'sawtooth', 'square'", + "type": "String", + "optional": true + } ], - "tag": "main", - "itemtype": "main" + "example": [ + "\n
\n\nlet osc, playing, freq, amp;\n\nfunction setup() {\n describe(\"a sketch that demonstrates the frequency and amplitude parameters of an oscillator.\");\n let cnv = createCanvas(100, 100);\n cnv.mousePressed(playOscillator);\n osc = new p5.Oscillator();\n}\n\nfunction draw() {\n background(220)\n freq = constrain(map(mouseX, 0, width, 100, 500), 100, 500);\n //amp = constrain(map(mouseY, height, 0, 0, 1), 0, 1);\n text('tap to play', 20, 20);\n text('freq: ' + freq, 20, 40);\n //text('amp: ' + amp, 20, 60);\n\n if (playing) {\n // smooth the transitions by 0.1 seconds\n osc.freq(freq);\n //osc.amp(amp);\n }\n}\n\nfunction playOscillator() {\n // starting an oscillator on a user gesture will enable audio\n // in browsers that have a strict autoplay policy.\n osc.start();\n playing = true;\n}\n\nfunction mouseReleased() {\n // ramp amplitude to 0 over 0.5 seconds\n //osc.amp(0, 0.5);\n playing = false;\n}\n \n
" + ] }, - "Acceleration": { - "name": "Acceleration", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Events", + "p5.SawOsc": { + "name": "p5.SawOsc", + "shortname": "SawOsc", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/events/acceleration.js", - "line": 1, - "requires": [ - "core" - ], - "tag": "main", - "itemtype": "main" + "file": "src/Oscillator.js", + "line": 220, + "description": "Creates a sawtooth oscillator.", + "is_constructor": 1, + "extends": "Oscillator", + "params": [ + { + "name": "freq", + "description": "Set the frequency", + "type": "Number", + "optional": true + } + ] }, - "Keyboard": { - "name": "Keyboard", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Events", + "p5.SqrOsc": { + "name": "p5.SqrOsc", + "shortname": "SqrOsc", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/events/keyboard.js", - "line": 1, - "requires": [ - "core" + "file": "src/Oscillator.js", + "line": 234, + "description": "Creates a square oscillator.", + "is_constructor": 1, + "extends": "Oscillator", + "params": [ + { + "name": "freq", + "description": "Set the frequency", + "type": "Number", + "optional": true + } ] }, - "Mouse": { - "name": "Mouse", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Events", + "p5.TriOsc": { + "name": "p5.TriOsc", + "shortname": "TriOsc", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/events/mouse.js", - "line": 1, - "requires": [ - "core", - "constants" + "file": "src/Oscillator.js", + "line": 248, + "description": "Creates a triangle oscillator.", + "is_constructor": 1, + "extends": "Oscillator", + "params": [ + { + "name": "freq", + "description": "Set the frequency", + "type": "Number", + "optional": true + } ] }, - "Touch": { - "name": "Touch", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Events", + "p5.SinOsc": { + "name": "p5.SinOsc", + "shortname": "SinOsc", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/events/touch.js", - "line": 1, - "requires": [ - "core" + "file": "src/Oscillator.js", + "line": 262, + "description": "Creates a sine oscillator.", + "is_constructor": 1, + "extends": "Oscillator", + "params": [ + { + "name": "freq", + "description": "Set the frequency", + "type": "Number", + "optional": true + } ] }, - "Image": { - "name": "Image", - "submodules": { - "Pixels": 1 - }, - "elements": {}, - "classes": { - "p5.Image": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "module": "Image", - "file": "src/image/p5.Image.js", - "line": 21, - "requires": [ - "core" - ], - "description": "

A class to describe an image.

\n

Images are rectangular grids of pixels that can be displayed and modified.

\n

Existing images can be loaded by calling\nloadImage(). Blank images can be created by\ncalling createImage(). p5.Image objects\nhave methods for common tasks such as applying filters and modifying\npixel values.

\n" - }, - "Loading & Displaying": { - "name": "Loading & Displaying", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Font": 1 - }, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Typography", + "p5.Panner": { + "name": "p5.Panner", + "shortname": "Panner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/typography/p5.Font.js", - "line": 13, - "requires": [ - "core" - ], - "description": "

This module defines the p5.Font class and functions for\ndrawing text to the display canvas.

\n" + "file": "src/Panner.js", + "line": 11, + "description": "A panning effect.", + "is_constructor": 1, + "example": [ + "\n
\n\nlet panner, lfo, soundfile, cnv;\n\nfunction preload() {\n soundfile = loadSound('/assets/beat.mp3');\n}\n\nfunction setup() {\n cnv = createCanvas(100, 100);\n background(220);\n cnv.mousePressed(startSound);\n \n panner = new p5.Panner();\n lfo = new p5.Oscillator(1);\n //disconnect lfo from speakers because we don't want to hear it!\n lfo.disconnect();\n panner.pan(lfo);\n\n soundfile.loop();\n soundfile.disconnect();\n soundfile.connect(panner);\n \n}\n\nfunction startSound() {\n lfo.start();\n soundfile.start();\n}\n\n
" + ] }, - "Pixels": { - "name": "Pixels", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Image", + "p5.Panner3D": { + "name": "p5.Panner3D", + "shortname": "Panner3D", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/image/pixels.js", - "line": 1, - "requires": [ - "core" + "file": "src/Panner3D.js", + "line": 10, + "description": "A 3D sound spatializer.", + "is_constructor": 1, + "example": [ + "\n
\n\nlet radius = 10 ; \nlet soundSource, spatializer;\nlet font;\nlet cnv;\n\nlet x = 0;\nlet y = 0;\nlet z = 100;\n\nlet vX;\nlet vY;\nlet vZ;\n\nfunction preload() {\n soundSource = loadSound('/assets/beat.mp3');\n font = loadFont('/assets/SourceSansPro-Regular.otf');\n}\n\nfunction setup() {\n describe(\n 'A 3D shape with a sound source attached to it. The sound source is spatialized using the Panner3D class. Click to play the sound.'\n );\n cnv = createCanvas(100, 100, WEBGL);\n cnv.mousePressed(playSound);\n\n camera(0, 0, 0, 0, 0, 1);\n \n textFont(font);\n textAlign(CENTER,CENTER);\n \n angleMode(DEGREES);\n\n vX = random(-0.5, 0.5);\n vY = random(-0.5, 0.5);\n vZ = random(-0.5, 0.5) * 1.5;\n\n spatializer = new p5.Panner3D();\n spatializer.maxDist(100);\n soundSource.loop();\n soundSource.disconnect();\n soundSource.connect(spatializer);\n}\n\nfunction playSound() {\n soundSource.play();\n}\n\nfunction draw() {\n background(220);\n push();\n textSize(5);\n fill(0);\n translate(0,0,100);\n //text('click to play', 0, 0);\n pop();\n // Update Box and Sound Source Position\n push();\n moveSoundBox();\n box(5, 5, 5);\n pop();\n}\n\n// Rotate 1 degree per frame along all three axes\nfunction moveSoundBox() {\n x = x + vX;\n y = y + vY;\n z = z + vZ;\n\n if (x > radius || x < -radius) {\n vX = -vX;\n }\n if (y > radius || y < -radius) {\n vY = -vY;\n }\n if (z > 250 || z < 80) {\n vZ = -vZ;\n }\n //set the position of the 3D panner\n spatializer.set(x, y, z);\n //set the postion of the box\n translate(x, y, z);\n rotateX(45 + frameCount);\n rotateZ(45);\n}\n\n
" ] }, - "IO": { - "name": "IO", - "submodules": { - "Structure": 1, - "Input": 1, - "Output": 1, - "Table": 1, - "Time & Date": 1 - }, - "elements": {}, - "classes": { - "p5": 1, - "p5.PrintWriter": 1, - "p5.Table": 1, - "p5.TableRow": 1, - "p5.XML": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "file": "src/io/p5.XML.js", - "line": 9 - }, - "Input": { - "name": "Input", - "submodules": {}, - "elements": {}, - "classes": { - "p5.XML": 1 - }, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "IO", - "namespace": "", - "file": "src/io/p5.XML.js", - "line": 9, - "requires": [ - "core" - ], - "description": "

A class to describe an XML object.

\n

Each p5.XML object provides an easy way to interact with XML data.\nExtensible Markup Language\n(XML)\nis a standard format for sending data between applications. Like HTML, the\nXML format is based on tags and attributes, as in\n<time units=\"s\">1234</time>.

\n

Note: Use loadXML() to load external XML files.

\n" - }, - "Output": { - "name": "Output", - "submodules": {}, - "elements": {}, - "classes": { - "p5": 1, - "p5.PrintWriter": 1 - }, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "IO", + "p5.PitchShifter": { + "name": "p5.PitchShifter", + "shortname": "PitchShifter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/io/files.js", - "line": 1565, - "description": "

This is the p5 instance constructor.

\n

A p5 instance holds all the properties and methods related to\na p5 sketch. It expects an incoming sketch closure and it can also\ntake an optional node parameter for attaching the generated p5 canvas\nto a node. The sketch closure takes the newly created p5 instance as\nits sole argument and may optionally set preload(),\nsetup(), and/or\ndraw() properties on it for running a sketch.

\n

A p5 sketch can run in \"global\" or \"instance\" mode:\n\"global\" - all properties and methods are attached to the window\n\"instance\" - all properties and methods are bound to this p5 object

\n" + "file": "src/PitchShifter.js", + "line": 10, + "description": "Change the pitch of a sound.", + "is_constructor": 1, + "example": [ + "\n
\n\n let cnv, soundFile, pitchShifter;\n \nfunction preload() {\n soundFile = loadSound('/assets/beatbox.mp3');\n}\n \nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.mousePressed(startSound);\n background(220);\n textAlign(CENTER);\n textSize(9);\n text('click to play sound', width/2, height/2);\n pitchShifter = new p5.PitchShifter();\n \n soundFile.disconnect();\n soundFile.connect(pitchShifter);\n //change the pitch and retrigger sample when done playing\n soundFile.onended(changePitch);\n}\n\nfunction startSound () {\n soundFile.play();\n}\n \nfunction changePitch () {\n let pitchValue = random(-12, 12);\n pitchShifter.shift(pitchValue);\n soundFile.play();\n}\n\n
" + ] }, - "Table": { - "name": "Table", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Table": 1, - "p5.TableRow": 1 - }, - "fors": {}, - "is_submodule": 1, - "namespaces": {}, - "module": "IO", + "p5.Reverb": { + "name": "p5.Reverb", + "shortname": "Reverb", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "p5.sound", "namespace": "", - "file": "src/io/p5.TableRow.js", - "line": 9, - "requires": [ - "core" + "file": "src/Reverb.js", + "line": 10, + "description": "Add reverb to a sound.", + "is_constructor": 1, + "params": [ + { + "name": "decayTime", + "description": "Set the decay time of the reverb", + "type": "Number", + "optional": true + } ], - "description": "

Table objects store data with multiple rows and columns, much\nlike in a traditional spreadsheet. Tables can be generated from\nscratch, dynamically, or using data from an existing file.

\n" - }, - "Math": { - "name": "Math", - "submodules": { - "Calculation": 1, - "Vector": 1, - "Noise": 1, - "Random": 1, - "Trigonometry": 1, - "Quaternion": 1 - }, - "elements": {}, - "classes": { - "p5.Vector": 1, - "p5.Quat": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "file": "src/webgl/p5.Quat.js", - "line": 8 - }, - "Calculation": { - "name": "Calculation", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Math", - "namespace": "", - "file": "src/math/calculation.js", - "line": 1, - "requires": [ - "core" + "example": [ + "\n
\n\nlet noise, osc, env, reverb;\nlet randomTime = 0;\n\nfunction setup() {\n let cnv = createCanvas(100, 100);\n cnv.mousePressed(playSound);\n noise = new p5.Noise();\n env = new p5.Envelope();\n reverb = new p5.Reverb();\n noise.disconnect();\n noise.connect(env);\n env.disconnect();\n env.connect(reverb);\n noise.start();\n textAlign(CENTER);\n}\n\nfunction playSound() {\n randomTime = random(0.1, 3);\n reverb.set(randomTime); \n env.play();\n}\n\nfunction draw() {\n background(220);\n text('click to play', width/2, 20);\n text('decay ' + round(randomTime, 2), width/2, 40);\n describe('Click to play a sound with a random decay time.');\n}\n\n
" ] }, - "Vector": { - "name": "Vector", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Vector": 1 - }, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Math", - "namespace": "", - "file": "src/math/p5.Vector.js", - "line": 11, - "requires": [ - "core" - ], - "description": "

A class to describe a two or three-dimensional vector.

\n

A vector can be thought of in different ways. In one view, a vector is like\nan arrow pointing in space. Vectors have both magnitude (length) and\ndirection.

\n

p5.Vector objects are often used to program motion because they simplify\nthe math. For example, a moving ball has a position and a velocity.\nPosition describes where the ball is in space. The ball's position vector\nextends from the origin to the ball's center. Velocity describes the ball's\nspeed and the direction it's moving. If the ball is moving straight up, its\nvelocity vector points straight up. Adding the ball's velocity vector to\nits position vector moves it, as in pos.add(vel). Vector math relies on\nmethods inside the p5.Vector class.

\n

Note: createVector() is the recommended way\nto make an instance of this class.

\n" + "p5.sound": { + "name": "p5.sound", + "shortname": "sound", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "SoundFile", + "namespace": "" }, - "Noise": { - "name": "Noise", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Math", + "p5.SoundFile": { + "name": "p5.SoundFile", + "shortname": "SoundFile", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "p5.sound", + "submodule": "SoundFile", "namespace": "", - "file": "src/math/noise.js", - "line": 14, - "requires": [ - "core" + "file": "src/SoundFile.js", + "line": 74, + "description": "Load and play sound files.", + "is_constructor": 1, + "example": [ + "\n
\n\nlet sound, amp, delay, cnv;\n\nfunction preload() {\n //replace this sound with something local with rights to distribute\n //need to fix local asset loading first though :) \n sound = loadSound('/assets/doorbell.mp3');\n}\n\nfunction setup() {\n cnv = createCanvas(100, 100);\n textAlign(CENTER);\n cnv.mousePressed(playSound);\n amp = new p5.Amplitude();\n delay = new p5.Delay();\n sound.disconnect();\n sound.connect(delay);\n delay.connect(amp);\n}\n\nfunction playSound() {\n sound.play();\n}\n\nfunction draw() {\n let dtime = map(mouseX, 0, width, 0, 1);\n delay.delayTime(dtime);\n let f = map(mouseY, 0, height, 0, .75);\n delay.feedback(f);\n let level = map(amp.getLevel(), 0, 0.5, 0, 255);\n background(level, 0, 0);\n fill(255);\n text('click to play', width/2, 20);\n }\n\n
" ] + } + }, + "classitems": [ + { + "itemtype": "property", + "name": "RGB", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 16, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Random": { - "name": "Random", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Math", - "namespace": "", - "file": "src/math/random.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "RGBHDR", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 22, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Trigonometry": { - "name": "Trigonometry", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Math", - "namespace": "", - "file": "src/math/trigonometry.js", - "line": 1, - "requires": [ - "core", - "constants" - ] + { + "itemtype": "property", + "name": "HSB", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 32, + "description": "HSB (hue, saturation, brightness) is a type of color model.\nYou can learn more about it at\nHSB.", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Typography": { - "name": "Typography", - "submodules": { - "Attributes": 1, - "Loading & Displaying": 1 - }, - "elements": {}, - "classes": { - "p5.Font": 1 - }, - "fors": { - "p5": 1 - }, - "namespaces": {}, - "file": "src/typography/p5.Font.js", - "line": 13 + { + "itemtype": "property", + "name": "HSL", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 38, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Array Functions": { - "name": "Array Functions", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Data", - "namespace": "", - "file": "src/utilities/array_functions.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "HWB", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 44, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Conversion": { - "name": "Conversion", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Data", - "namespace": "", - "file": "src/utilities/conversion.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "LAB", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 50, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "String Functions": { - "name": "String Functions", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Data", - "namespace": "", - "file": "src/utilities/string_functions.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "LCH", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 56, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Time & Date": { - "name": "Time & Date", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "IO", - "namespace": "", - "file": "src/utilities/time_date.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "OKLAB", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 62, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "3D Primitives": { - "name": "3D Primitives", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Geometry": 1 - }, - "fors": { - "p5": 1, - "p5.Geometry": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Shape", - "namespace": "", - "file": "src/webgl/p5.Geometry.js", - "line": 13, - "requires": [ - "core", - "p5.Geometry" - ], - "description": "

A class to describe a 3D shape.

\n

Each p5.Geometry object represents a 3D shape as a set of connected\npoints called vertices. All 3D shapes are made by connecting vertices to\nform triangles that are stitched together. Each triangular patch on the\ngeometry's surface is called a face. The geometry stores information\nabout its vertices and faces for use with effects such as lighting and\ntexture mapping.

\n

The first parameter, detailX, is optional. If a number is passed, as in\nnew p5.Geometry(24), it sets the number of triangle subdivisions to use\nalong the geometry's x-axis. By default, detailX is 1.

\n

The second parameter, detailY, is also optional. If a number is passed,\nas in new p5.Geometry(24, 16), it sets the number of triangle\nsubdivisions to use along the geometry's y-axis. By default, detailX is\n1.

\n

The third parameter, callback, is also optional. If a function is passed,\nas in new p5.Geometry(24, 16, createShape), it will be called once to add\nvertices to the new 3D shape.

\n" + { + "itemtype": "property", + "name": "OKLCH", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 68, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "3D": { - "name": "3D", - "submodules": { - "Interaction": 1, - "Lights": 1, - "Material": 1, - "Camera": 1 - }, - "elements": {}, - "classes": { - "p5.Camera": 1, - "p5.Shader": 1, - "p5.Texture": 1, - "ImageInfos": 1, - "FontInfo": 1, - "Cubic": 1 - }, - "fors": { - "p5": 1, - "p5.Camera": 1 - }, - "namespaces": {}, - "file": "src/webgl/text.js", - "line": 279 + { + "itemtype": "property", + "name": "RGBA", + "file": "src/scripts/parsers/in/p5.js/src/color/creating_reading.js", + "line": 74, + "description": "", + "module": "Color", + "submodule": "Creating & Reading", + "class": "p5" }, - "Interaction": { - "name": "Interaction", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "3D", - "namespace": "", - "file": "src/webgl/interaction.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "VERSION", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 14, + "type": "string", + "description": "Version of this p5.js.", + "module": "Constants", + "submodule": "Constants", + "class": "p5" }, - "Lights": { - "name": "Lights", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "3D", - "namespace": "", - "file": "src/webgl/light.js", - "line": 1, - "requires": [ - "core" - ] + { + "itemtype": "property", + "name": "P2D", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 23, + "type": "string", + "description": "The default, two-dimensional renderer.", + "module": "Constants", + "submodule": "Constants", + "class": "p5" }, - "3D Models": { - "name": "3D Models", - "submodules": {}, - "elements": {}, - "classes": {}, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "Shape", - "namespace": "", - "file": "src/webgl/loading.js", - "line": 1, - "requires": [ - "core", - "p5.Geometry" - ] + { + "itemtype": "property", + "name": "WEBGL", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 48, + "type": "string", + "description": "

One of the two render modes in p5.js, used for computationally intensive tasks like 3D rendering and shaders.

\n

WEBGL differs from the default P2D renderer in the following ways:

\n

To learn more about WEBGL mode, check out all the interactive WEBGL tutorials in the \"Tutorials\" section of this website, or read the wiki article \"Getting started with WebGL in p5\".

\n", + "module": "Constants", + "submodule": "Constants", + "class": "p5" }, - "Material": { - "name": "Material", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Shader": 1, - "p5.Texture": 1 - }, - "fors": { - "p5": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "3D", - "namespace": "", - "file": "src/webgl/p5.Texture.js", - "line": 12, - "requires": [ - "core" + { + "itemtype": "property", + "name": "WEBGL2", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 57, + "type": "string", + "description": "One of the two possible values of a WebGL canvas (either WEBGL or WEBGL2),\nwhich can be used to determine what capabilities the rendering environment\nhas.", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "ARROW", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 65, + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "SIMPLE", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 71, + "type": "string", + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "FULL", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 76, + "type": "string", + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "CROSS", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 83, + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "HAND", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 89, + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "MOVE", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 95, + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "TEXT", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 101, + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "WAIT", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 107, + "description": "", + "module": "Constants", + "submodule": "Constants", + "class": "p5" + }, + { + "itemtype": "property", + "name": "HALF_PI", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 199, + "description": "

A Number constant that's approximately 1.5708.

\n

HALF_PI is half the value of the mathematical constant π. It's useful for\nmany tasks that involve rotation and oscillation. For example, calling\nrotate(HALF_PI) rotates the coordinate system HALF_PI radians, which is\na quarter turn (90˚).

\n

Note: TWO_PI radians equals 360˚, PI radians equals 180˚, HALF_PI\nradians equals 90˚, and QUARTER_PI radians equals 45˚.

\n", + "example": [ + "
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Draw an arc from 0 to HALF_PI.\n arc(50, 50, 80, 80, 0, HALF_PI);\n\n describe('The bottom-right quarter of a circle drawn in white on a gray background.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Translate the origin to the center.\n translate(50, 50);\n\n // Draw a line.\n line(0, 0, 40, 0);\n\n // Rotate a quarter turn.\n rotate(HALF_PI);\n\n // Draw the same line, rotated.\n line(0, 0, 40, 0);\n\n describe('Two black lines on a gray background. One line extends from the center to the right. The other line extends from the center to the bottom.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n describe(\n 'A red circle and a blue circle oscillate from left to right on a gray background. The red circle appears to chase the blue circle.'\n );\n}\n\nfunction draw() {\n background(200);\n\n // Translate the origin to the center.\n translate(50, 50);\n\n // Calculate the x-coordinates.\n let x1 = 40 * sin(frameCount * 0.05);\n let x2 = 40 * sin(frameCount * 0.05 + HALF_PI);\n\n // Style the oscillators.\n noStroke();\n\n // Draw the red oscillator.\n fill(255, 0, 0);\n circle(x1, 0, 20);\n\n // Draw the blue oscillator.\n fill(0, 0, 255);\n circle(x2, 0, 20);\n}\n\n
" ], - "description": "

This module defines the p5.Shader class

\n" + "module": "Constants", + "submodule": "Constants", + "class": "p5" }, - "Camera": { - "name": "Camera", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Camera": 1 - }, - "fors": { - "p5": 1, - "p5.Camera": 1 - }, - "is_submodule": 1, - "namespaces": {}, - "module": "3D", - "namespace": "", - "file": "src/webgl/p5.Camera.js", - "line": 723, - "requires": [ - "core" + { + "itemtype": "property", + "name": "PI", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 288, + "description": "

A Number constant that's approximately 3.1416.

\n

PI is the mathematical constant π. It's useful for many tasks that\ninvolve rotation and oscillation. For example, calling rotate(PI) rotates\nthe coordinate system PI radians, which is a half turn (180˚).

\n

Note: TWO_PI radians equals 360˚, PI radians equals 180˚, HALF_PI\nradians equals 90˚, and QUARTER_PI radians equals 45˚.

\n", + "example": [ + "
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Draw an arc from 0 to PI.\n arc(50, 50, 80, 80, 0, PI);\n\n describe('The bottom half of a circle drawn in white on a gray background.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Translate the origin to the center.\n translate(50, 50);\n\n // Draw a line.\n line(0, 0, 40, 0);\n\n // Rotate a half turn.\n rotate(PI);\n\n // Draw the same line, rotated.\n line(0, 0, 40, 0);\n\n describe('A horizontal black line on a gray background.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n describe(\n 'A red circle and a blue circle oscillate from left to right on a gray background. The circles drift apart, then meet in the middle, over and over again.'\n );\n}\n\nfunction draw() {\n background(200);\n\n // Translate the origin to the center.\n translate(50, 50);\n\n // Calculate the x-coordinates.\n let x1 = 40 * sin(frameCount * 0.05);\n let x2 = 40 * sin(frameCount * 0.05 + PI);\n\n // Style the oscillators.\n noStroke();\n\n // Draw the red oscillator.\n fill(255, 0, 0);\n circle(x1, 0, 20);\n\n // Draw the blue oscillator.\n fill(0, 0, 255);\n circle(x2, 0, 20);\n}\n\n
" ], - "description": "

A class to describe a camera for viewing a 3D sketch.

\n

Each p5.Camera object represents a camera that views a section of 3D\nspace. It stores information about the camera’s position, orientation, and\nprojection.

\n

In WebGL mode, the default camera is a p5.Camera object that can be\ncontrolled with the camera(),\nperspective(),\northo(), and\nfrustum() functions. Additional cameras can be\ncreated with createCamera() and activated\nwith setCamera().

\n

Note: p5.Camera’s methods operate in two coordinate systems:

\n\n" + "module": "Constants", + "submodule": "Constants", + "class": "p5" }, - "Quaternion": { - "name": "Quaternion", - "submodules": {}, - "elements": {}, - "classes": { - "p5.Quat": 1 - }, - "fors": {}, - "is_submodule": 1, - "namespaces": {}, - "module": "Math", - "namespace": "", - "file": "src/webgl/p5.Quat.js", - "line": 8, - "description": "

A class to describe a Quaternion\nfor vector rotations in the p5js webgl renderer.\nPlease refer the following link for details on the implementation\nhttps://danceswithcode.net/engineeringnotes/quaternions/quaternions.html

\n" + { + "itemtype": "property", + "name": "QUARTER_PI", + "file": "src/scripts/parsers/in/p5.js/src/core/constants.js", + "line": 378, + "description": "

A Number constant that's approximately 0.7854.

\n

QUARTER_PI is one-fourth the value of the mathematical constant π. It's\nuseful for many tasks that involve rotation and oscillation. For example,\ncalling rotate(QUARTER_PI) rotates the coordinate system QUARTER_PI\nradians, which is an eighth of a turn (45˚).

\n

Note: TWO_PI radians equals 360˚, PI radians equals 180˚, HALF_PI\nradians equals 90˚, and QUARTER_PI radians equals 45˚.

\n", + "example": [ + "
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Draw an arc from 0 to QUARTER_PI.\n arc(50, 50, 80, 80, 0, QUARTER_PI);\n\n describe('A one-eighth slice of a circle drawn in white on a gray background.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n background(200);\n\n // Translate the origin to the center.\n translate(50, 50);\n\n // Draw a line.\n line(0, 0, 40, 0);\n\n // Rotate an eighth turn.\n rotate(QUARTER_PI);\n\n // Draw the same line, rotated.\n line(0, 0, 40, 0);\n\n describe('Two black lines that form a \"V\" opening towards the bottom-right corner of a gray square.');\n}\n\n
\n\n
\n\nfunction setup() {\n createCanvas(100, 100);\n\n describe(\n 'A red circle and a blue circle oscillate from left to right on a gray background. The red circle appears to chase the blue circle.'\n );\n}\n\nfunction draw() {\n background(200);\n\n // Translate the origin to the center.\n translate(50, 50);\n\n // Calculate the x-coordinates.\n let x1 = 40 * sin(frameCount * 0.05);\n let x2 = 40 * sin(frameCount * 0.05 + QUARTER_PI);\n\n // Style the oscillators.\n noStroke();\n\n // Draw the red oscillator.\n fill(255, 0, 0);\n circle(x1, 0, 20);\n\n // Draw the blue oscillator.\n fill(0, 0, 255);\n circle(x2, 0, 20);\n}\n\n
" + ], + "module": "Constants", + "submodule": "Constants", + "class": "p5" }, - "p5.sound": { - "name": "p5.sound", - "submodules": {}, - "elements": {}, - "classes": { - "p5.sound": 1, - "p5.SoundFile": 1, - "p5.Amplitude": 1, - "p5.FFT": 1, - "p5.Oscillator": 1, - "p5.SinOsc": 1, - "p5.TriOsc": 1, - "p5.SawOsc": 1, - "p5.SqrOsc": 1, - "p5.Envelope": 1, - "p5.Noise": 1, - "p5.Pulse": 1, - "p5.AudioIn": 1, - "p5.Effect": 1, - "p5.Filter": 1, - "p5.LowPass": 1, - "p5.HighPass": 1, - "p5.BandPass": 1, - "p5.EQ": 1, - "p5.Panner3D": 1, - "p5.Delay": 1, - "p5.Reverb": 1, - "p5.Convolver": 1, - "p5.Phrase": 1, - "p5.Part": 1, - "p5.Score": 1, - "p5.SoundLoop": 1, - "p5.Compressor": 1, - "p5.PeakDetect": 1, - "p5.SoundRecorder": 1, - "p5.Distortion": 1, - "p5.Gain": 1, - "p5.AudioVoice": 1, - "p5.MonoSynth": 1, - "p5.OnsetDetect": 1, - "p5.PolySynth": 1 - }, - "fors": { - "p5.sound": 1, - "p5": 1, - "p5.SoundFile": 1, - "p5.Amplitude": 1, - "p5.FFT": 1, - "p5.Oscillator": 1, - "p5.Envelope": 1, - "p5.AudioIn": 1, - "p5.Effect": 1, - "p5.EQ": 1, - "p5.Panner3D": 1, - "p5.Delay": 1, - "p5.Reverb": 1, - "p5.Convolver": 1, - "p5.Part": 1, - "p5.Score": 1, - "p5.SoundLoop": 1, - "p5.Compressor": 1, - "p5.SoundRecorder": 1, - "p5.Distortion": 1, - "p5.Gain": 1, - "p5.AudioVoice": 1, - "p5.MonoSynth": 1, - "p5.PolySynth": 1 - }, - "namespaces": {}, - "module": "p5.sound", - "file": "lib/addons/p5.sound.js", - "line": 11691, - "description": "

p5.sound extends p5 with Web Audio functionality including audio input,\nplayback, analysis and synthesis.\n

\n