Package net.paulhertz.pixelaudio.example
Class TutorialOne_06_WB_Retrofit
java.lang.Object
processing.core.PApplet
net.paulhertz.pixelaudio.example.TutorialOne_03_Drawing
net.paulhertz.pixelaudio.example.TutorialOne_06_WB_Retrofit
- All Implemented Interfaces:
processing.core.PConstants
TutorialOne_06_WB_Retrofit
A continuation of TutorialOne_03_Drawing that keeps the drawing, brush,
sampler, granular, bounds, and envelope code from TutorialOne_03_Drawing,
but changes the audio source model:
- anthemSignal / anthemBuffer hold the entire loaded audio file.
- windowBuff is a moving window over anthemSignal.
- audioSignal / playBuffer / mapImage hold only the current visible window.
- Display coordinates map first to the visible window, then to the backing
full-file source by adding windowBuff.getIndex().
This file is intentionally small: it is a retrofit layer over the newer
TutorialOne_03_Drawing rather than a refactor of the older TutorialOne_06 code.
It is not ported to Processing. The programming model in Eclipse provides better
support for the Java classes than Processing does.
See
TutorialOne_03_Drawing-
Nested Class Summary
Nested classes/interfaces inherited from class net.paulhertz.pixelaudio.example.TutorialOne_03_Drawing
TutorialOne_03_Drawing.AudioBrushLite, TutorialOne_03_Drawing.BrushConfig, TutorialOne_03_Drawing.BrushHit, TutorialOne_03_Drawing.BrushOutput, TutorialOne_03_Drawing.HopMode, TutorialOne_03_Drawing.PathMode -
Field Summary
FieldsModifier and TypeFieldDescription(package private) ddf.minim.MultiChannelBufferFull-file source buffer used by the Sampler instrument pool.(package private) float[]Full-file mono source, padded to at least mapper.getSize().(package private) booleanOptional random point-event texture while windowing.(package private) booleanIf true, draw() advances windowBuff each frame and refreshes the display.(package private) booleanSave animation state when file loading or windowing temporarily suspends it.(package private) int(package private) int(package private) floatsampling rate of samplerSourceRef(package private) ddf.minim.MultiChannelBufferSampler instruments use anthemBuffer, not the current visible playBuffer.(package private) booleanWindowBuffer initialized or not? see initAudio()(package private) WindowedBufferMoving view onto anthemSignal, with window size == mapper.getSize().(package private) intHop size for automatic window traversal.Fields inherited from class net.paulhertz.pixelaudio.example.TutorialOne_03_Drawing
activeBrush, allPoints, allTimes, animatedCircleColor, audioFile, audioFileLength, audioFileName, audioFilePath, audioFileTag, audioLength, audioOut, audioSignal, baseImage, boundaryMode, boundsPolicy, brushes, bufferSampleRate, burstGrains, chan, circleColor, currentPoint, curveMaker, curveSteps, daFile, daPath, defaultEnv, defaultPitchScaling, dimCircleColor, dimLineColor, doPlayOnNewBrush, dragColor, dragWeight, envDuration, envMaxDurationMs, envMinDurationMs, envPresets, epsilon, fileSampleRate, gDir, genHeight, genWidth, gMaxVoices, gParamsFixed, gParamsGesture, grainTimeLocs, granEnvDuration, granSamples, granSignal, granularGain, granularPointGain, gSynth, highPitchScaling, hopSamples, hoverBrush, hoverBrushColor, hoverBrushColor1, hoverBrushColor2, hoverIndex, imageFile, imageFileHeight, imageFileName, imageFilePath, imageFileTag, imageFileWidth, isAdjustEnvelope, isAnimating, isBlending, isBufferStale, isDrawMode, isLoadToBoth, isMuted, isRecordingVideo, lineColor, longSample, lowPitchScaling, mapImage, mapper, mapSize, maxAmplitude, maxBurstGrains, minBurstGrains, minim, multigen, noteDuration, oldIsAnimating, outputGain, overlapFactor, pitchScaling, pixelaudio, playBuffer, pointTimeLocs, polySteps, pool, presetIndex, readyBrushColor, readyBrushColor1, readyBrushColor2, samplelen, samplePos, sampleRate, samplerGain, samplerPointGain, samplerTimeLocs, selectedBrushColor, selectedBrushColor1, selectedBrushColor2, shift, shiftIsDown, shortSample, spectrum, startTime, step, totalShift, useGranularSynth, useLongBursts, usePitchedGrains, useShortGrain, videoFrameRate, videoSteps, videxFields inherited from class processing.core.PApplet
args, ARGS_BGCOLOR, ARGS_DISABLE_AWT, ARGS_DISPLAY, ARGS_EDITOR_LOCATION, ARGS_EXTERNAL, ARGS_FULL_SCREEN, ARGS_HIDE_STOP, ARGS_LOCATION, ARGS_PRESENT, ARGS_SKETCH_FOLDER, ARGS_STOP_COLOR, ARGS_UI_SCALE, ARGS_WINDOW_COLOR, DEFAULT_HEIGHT, DEFAULT_WIDTH, disableAWT, displayHeight, displayWidth, dmouseX, dmouseY, emouseX, emouseY, exitCalled, EXTERNAL_MOVE, EXTERNAL_STOP, finished, firstMouse, focused, frameCount, frameRate, frameRateLastNanos, g, height, insideDraw, javaPlatform, javaVersion, javaVersionName, key, keyCode, keyEvent, keyPressed, keyRepeatEnabled, looping, matchPatterns, mouseButton, mouseEvent, mousePressed, mouseX, mouseY, pixelDensity, pixelHeight, pixels, pixelWidth, platform, pmouseX, pmouseY, ratioLeft, ratioScale, ratioTop, recorder, redraw, rheight, rmouseX, rmouseY, rwidth, surface, useNativeSelect, width, windowX, windowYFields inherited from interface processing.core.PConstants
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOS, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) float[](package private) intbackingIndexFromLocal(int localIndex) voiddraw()Advance the visible audio window during draw().(package private) voidGranular gestures use anthemSignal as their source.(package private) voidEnsures that all resources and variable necessary for the Sampler synth are ready to go.processing.core.PVectorgetCoordFromSignalPos(int pos) Backing-file index -> visible display coordinate, relative to the current window.intgetSamplePos(int x, int y) Display coordinate -> visible window index -> backing file index.inthandleClickOutsideBrush(int x, int y) Point clicks are copied from TutorialOne_03_Drawing, but the initial samplePos is the backing source index.voidInitializes audio using the TutorialOne_03_Drawing defaults, then creates an initial full-file backing source from the empty playBuffer.(package private) voidinstallBackingSource(float[] sig, float sourceSampleRate) Installs a full-file backing source for WindowedBuffer and instruments.voidloadAudioFile(File audFile) Loads an audio file through TutorialOne_03_Drawing's normal path.static voidvoidmoveAudioWindow(int delta) voidparseKey(char key, int keyCode) Add WindowBuffer controls, then pass all other commands to TutorialOne_03_Drawing.voidplayGranularGesture(float[] buf, GestureSchedule sched, GestureGranularParams params, float pitchRatio) Same as TutorialOne_03_Drawing, but startIndices are offset by the current WindowedBuffer origin so grains read from the full backing file.intplaySample(int samplePos, int samplelen, float amplitude, ADSRParams env, float pitch, float pan) Plays an audio sample with with a custom envelope, pitch and stereo pan.voidraindrops(int count) Random point events along the upper part of the current window, useful for hearing time-structured files while the window is advancing.(package private) voidrefreshWindowFromBacking(boolean advance) Copies the current window into audioSignal and playBuffer.void(package private) voidBrush granular playback uses the full backing signal and backing indices.voidsetup()voidshowHelp()to generate help output, run RegEx search/replace on parseKey case lines with: // case ('.'): // (.+) // println(" * Press $1 to $2.");(package private) void(package private) voidupdateAudioChain(float[] sig) (package private) voidupdateAudioChain(float[] sig, float sourceSampleRate) Commit a new full-file source, then expose only the current mapSize window through audioSignal/playBuffer/mapImage.Methods inherited from class net.paulhertz.pixelaudio.example.TutorialOne_03_Drawing
addDrawingPoint, adjustAudioGain, adjustGranGain, adjustPoolGain, animate, applyColor, applyColorMapToDisplay, applyColorShifted, applyImageColor, audioFileSelectedWrite, audioMouseClick, blendInto, buildGranSynth, calcSampleLen, calcSampleLen, calculateEnvelopeDb, calculateEnvelopeLinear, chooseColorImage, chooseFile, clipToHeight, clipToWidth, colorFileSelected, commitMapImageToBaseImage, commitNewBaseImage, computeEnvDurationMs, defaultPathModeFor, drawBrushes, drawBrushShapes, drawCircle, envPreset, fileSelected, findHoverHit, generateJitterPitch, generateJitterPitch, getColors, getPathPoints, getPlaybackScheduleForBrush, getScheduleForBrush, handleDrawing, imageFileSelectedWrite, initAllPoints, initCurveMakerAndAddBrush, initDrawing, initGranularParams, initImages, initTimedEventLists, jitterCoord, keyPressed, keyReleased, loadImageFile, mouseClicked, mouseDragged, mouseInPoly, mousePressed, mouseReleased, normalize, playSample, playSample, preloadFiles, refreshMapImageFromBase, removeHoveredOrOldestBrush, removeNewestBrush, renderAudioToMapImage, renderFrame, renderMapImageToAudio, runGrainEvents, runPointEvents, runSamplerBrushEvents, saveAudioToFile, saveImageToFile, saveToAudio, saveToImage, scheduleSamplerBrushClick, setAlpha, setAlphaWithBlack, setBrushCurveSteps, setBrushEpsilon, settings, stepAnimation, stop, storeGranularCurveTL, storeSamplerCurveTL, updateHover, writeAudioToImage, writeImageToAudio, writeToScreenMethods inherited from class processing.core.PApplet
abs, abs, acos, alpha, ambient, ambient, ambient, ambientLight, ambientLight, append, append, append, append, append, append, applyMatrix, applyMatrix, applyMatrix, applyMatrix, applyMatrix, arc, arc, arraycopy, arraycopy, arraycopy, arrayCopy, arrayCopy, arrayCopy, asin, atan, atan2, attrib, attrib, attrib, attribColor, attribNormal, attribPosition, background, background, background, background, background, background, background, beginCamera, beginContour, beginPGL, beginRaw, beginRaw, beginRecord, beginRecord, beginShape, beginShape, bezier, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, bezierVertex, binary, binary, binary, binary, blend, blend, blendColor, blendMode, blue, box, box, brightness, calcSketchPath, camera, camera, ceil, checkAlpha, checkExtension, choice, choice, circle, clear, clip, color, color, color, color, color, color, color, color, colorMode, colorMode, colorMode, colorMode, concat, concat, concat, concat, concat, concat, concat, constrain, constrain, copy, copy, copy, cos, createFont, createFont, createFont, createGraphics, createGraphics, createGraphics, createImage, createInput, createInput, createInputRaw, createOutput, createOutput, createPath, createPath, createPrimaryGraphics, createReader, createReader, createReader, createShape, createShape, createShape, createWriter, createWriter, createWriter, cursor, cursor, cursor, cursor, curve, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, curveVertex, dataFile, dataPath, day, debug, degrees, delay, dequeueEvents, desktopFile, desktopPath, die, die, directionalLight, displayDensity, displayDensity, dispose, dist, dist, edge, ellipse, ellipseMode, emissive, emissive, emissive, endCamera, endContour, endPGL, endRaw, endRecord, endShape, endShape, exec, exec, exit, exitActual, exitCalled, exp, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, fill, fill, fill, fill, fill, fill, filter, filter, filter, floor, flush, focusGained, focusLost, frameMoved, frameRate, frustum, fullScreen, fullScreen, fullScreen, fullScreen, get, get, get, getExtension, getGraphics, getMatrix, getMatrix, getMatrix, getSurface, green, handleDraw, handleKeyEvent, handleMethods, handleMouseEvent, hex, hex, hex, hex, hideMenuBar, hint, hour, hue, image, image, image, imageMode, initSurface, insertFrame, isLooping, join, join, keyPressed, keyReleased, keyTyped, keyTyped, launch, lerp, lerpColor, lerpColor, lightFalloff, lights, lightSpecular, line, line, link, listFiles, listFiles, listPaths, loadBytes, loadBytes, loadBytes, loadFont, loadImage, loadImage, loadJSONArray, loadJSONArray, loadJSONObject, loadJSONObject, loadPixels, loadShader, loadShader, loadShape, loadShape, loadStrings, loadStrings, loadStrings, loadStrings, loadTable, loadTable, loadXML, loadXML, log, loop, mag, mag, main, main, main, makeGraphics, map, mask, match, matchAll, max, max, max, max, max, max, method, millis, min, min, min, min, min, min, minute, modelX, modelY, modelZ, month, mouseClicked, mouseDragged, mouseEntered, mouseEntered, mouseExited, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, mouseWheel, mouseWheel, nf, nf, nf, nf, nf, nf, nfc, nfc, nfc, nfc, nfp, nfp, nfp, nfp, nfs, nfs, nfs, nfs, noClip, noCursor, noFill, noise, noise, noise, noiseDetail, noiseDetail, noiseSeed, noLights, noLoop, norm, normal, noSmooth, noStroke, noTexture, noTint, orientation, ortho, ortho, ortho, parseBoolean, parseBoolean, parseBoolean, parseBoolean, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseChar, parseChar, parseChar, parseChar, parseFloat, parseFloat, parseFloat, parseFloat, parseFloat, parseFloat, parseFloat, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseJSONArray, parseJSONObject, parseXML, parseXML, pause, perspective, perspective, pixelDensity, point, point, pointLight, pop, popMatrix, popStyle, postEvent, postWindowMoved, postWindowResized, pow, print, print, print, print, print, print, print, print, print, printArray, printCamera, println, println, println, println, println, println, println, println, println, println, println, printMatrix, printProjection, printStackTrace, push, pushMatrix, pushStyle, quad, quadraticVertex, quadraticVertex, radians, random, random, randomGaussian, randomSeed, rect, rect, rect, rectMode, red, redraw, registerMethod, requestImage, requestImage, resetMatrix, resetShader, resetShader, resume, reverse, reverse, reverse, reverse, reverse, reverse, reverse, rotate, rotate, rotateX, rotateY, rotateZ, round, runSketch, runSketch, runSketch, saturation, save, saveBytes, saveBytes, saveBytes, saveFile, saveFrame, saveFrame, saveJSONArray, saveJSONArray, saveJSONObject, saveJSONObject, savePath, saveStream, saveStream, saveStream, saveStream, saveStream, saveStrings, saveStrings, saveStrings, saveTable, saveTable, saveXML, saveXML, scale, scale, scale, screenX, screenX, screenY, screenY, screenZ, second, selectCallback, selectFolder, selectFolder, selectFolder, selectInput, selectInput, selectInput, selectOutput, selectOutput, selectOutput, set, set, setMatrix, setMatrix, setMatrix, setSize, shader, shader, shape, shape, shape, shapeMode, shearX, shearY, shell, shininess, shorten, shorten, shorten, shorten, shorten, shorten, shorten, showDepthWarning, showDepthWarningXYZ, showMethodWarning, showMissingWarning, showSurface, showVariationWarning, sin, size, size, size, sketchDisplay, sketchFile, sketchFullScreen, sketchHeight, sketchOutputPath, sketchOutputStream, sketchPath, sketchPath, sketchPixelDensity, sketchRenderer, sketchSmooth, sketchWidth, sketchWindowColor, smooth, smooth, sort, sort, sort, sort, sort, sort, sort, sort, sort, sort, specular, specular, specular, sphere, sphereDetail, sphereDetail, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, split, split, splitTokens, splitTokens, spotLight, sq, sqrt, square, start, startSurface, str, str, str, str, str, str, str, str, str, str, stroke, stroke, stroke, stroke, stroke, stroke, strokeCap, strokeJoin, strokeWeight, style, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, tan, text, text, text, text, text, text, text, text, text, text, text, textAlign, textAlign, textAscent, textDescent, textFont, textFont, textLeading, textMode, textSize, texture, textureMode, textureWrap, textWidth, textWidth, textWidth, thread, tint, tint, tint, tint, tint, tint, translate, translate, triangle, trim, trim, unbinary, unhex, unregisterMethod, updatePixels, updatePixels, urlDecode, urlEncode, vertex, vertex, vertex, vertex, vertex, windowMove, windowMoved, windowRatio, windowResizable, windowResize, windowResized, windowTitle, year
-
Field Details
-
anthemSignal
float[] anthemSignalFull-file mono source, padded to at least mapper.getSize(). -
anthemBuffer
ddf.minim.MultiChannelBuffer anthemBufferFull-file source buffer used by the Sampler instrument pool. -
windowBuff
WindowedBuffer windowBuffMoving view onto anthemSignal, with window size == mapper.getSize(). -
windowHopSize
int windowHopSizeHop size for automatic window traversal. -
isWindowing
boolean isWindowingIf true, draw() advances windowBuff each frame and refreshes the display. -
oldIsWindowing
boolean oldIsWindowingSave animation state when file loading or windowing temporarily suspends it. -
isRaining
boolean isRainingOptional random point-event texture while windowing. -
windowAudioReady
boolean windowAudioReadyWindowBuffer initialized or not? see initAudio() -
samplerSourceRef
ddf.minim.MultiChannelBuffer samplerSourceRefSampler instruments use anthemBuffer, not the current visible playBuffer. -
samplerSourceRateRef
float samplerSourceRateRefsampling rate of samplerSourceRef -
poolSize
int poolSize -
samplerMaxVoices
int samplerMaxVoices
-
-
Constructor Details
-
TutorialOne_06_WB_Retrofit
public TutorialOne_06_WB_Retrofit()
-
-
Method Details
-
main
-
setup
public void setup()- Overrides:
setupin classTutorialOne_03_Drawing
-
initAudio
public void initAudio()Initializes audio using the TutorialOne_03_Drawing defaults, then creates an initial full-file backing source from the empty playBuffer.- Overrides:
initAudioin classTutorialOne_03_Drawing
-
loadAudioFile
Loads an audio file through TutorialOne_03_Drawing's normal path. The override of updateAudioChain(...) below receives the full resampled signal and installs it as the backing source instead of truncating it before instrument playback.- Overrides:
loadAudioFilein classTutorialOne_03_Drawing- Parameters:
audFile- an audio file
-
suspendWindowAudio
void suspendWindowAudio() -
updateAudioChain
void updateAudioChain(float[] sig, float sourceSampleRate) Commit a new full-file source, then expose only the current mapSize window through audioSignal/playBuffer/mapImage.- Overrides:
updateAudioChainin classTutorialOne_03_Drawing- Parameters:
sig- an audio signalsourceSampleRate- audio sample rate for sig, usually obtained when reading from an audio file
-
updateAudioChain
void updateAudioChain(float[] sig) - Overrides:
updateAudioChainin classTutorialOne_03_Drawing
-
installBackingSource
void installBackingSource(float[] sig, float sourceSampleRate) Installs a full-file backing source for WindowedBuffer and instruments. Sets the window size to mapper.getSize() -
refreshWindowFromBacking
void refreshWindowFromBacking(boolean advance) Copies the current window into audioSignal and playBuffer. The Sampler and Granular instruments still read from anthemSignal / anthemBuffer. -
ensureSamplerReady
void ensureSamplerReady()Description copied from class:TutorialOne_03_DrawingEnsures that all resources and variable necessary for the Sampler synth are ready to go.- Overrides:
ensureSamplerReadyin classTutorialOne_03_Drawing
-
ensureGranularReady
void ensureGranularReady()Granular gestures use anthemSignal as their source.- Overrides:
ensureGranularReadyin classTutorialOne_03_Drawing
-
getSamplePos
public int getSamplePos(int x, int y) Display coordinate -> visible window index -> backing file index.- Overrides:
getSamplePosin classTutorialOne_03_Drawing- Parameters:
x- an x coordinate within mapImage and display boundsy- a y coordinate within mapImage and display bounds- Returns:
- the index of the sample corresponding to (x,y) on the signal path
-
backingIndexFromLocal
int backingIndexFromLocal(int localIndex) -
getCoordFromSignalPos
public processing.core.PVector getCoordFromSignalPos(int pos) Backing-file index -> visible display coordinate, relative to the current window.- Overrides:
getCoordFromSignalPosin classTutorialOne_03_Drawing- Parameters:
pos- an index into an audio signal, must be between 0 and width * height - 1.- Returns:
- a PVector with the x and y coordinates
-
handleClickOutsideBrush
public int handleClickOutsideBrush(int x, int y) Point clicks are copied from TutorialOne_03_Drawing, but the initial samplePos is the backing source index. Long granular bursts still create display points in the current window; playGranularGesture(...) remaps them to backing indices.- Overrides:
handleClickOutsideBrushin classTutorialOne_03_Drawing
-
scheduleGranularBrushClick
Brush granular playback uses the full backing signal and backing indices.- Overrides:
scheduleGranularBrushClickin classTutorialOne_03_Drawing- Parameters:
b- an AudioBrushLite instance
-
backingGranularSignal
float[] backingGranularSignal() -
playGranularGesture
public void playGranularGesture(float[] buf, GestureSchedule sched, GestureGranularParams params, float pitchRatio) Same as TutorialOne_03_Drawing, but startIndices are offset by the current WindowedBuffer origin so grains read from the full backing file.- Overrides:
playGranularGesturein classTutorialOne_03_Drawing- Parameters:
buf- an audio signal as an array of floatsched- an GestureSchedule with coordinate and timing informationparams- a bundle of control parameters for granular synthesis
-
playSample
public int playSample(int samplePos, int samplelen, float amplitude, ADSRParams env, float pitch, float pan) Description copied from class:TutorialOne_03_DrawingPlays an audio sample with with a custom envelope, pitch and stereo pan.- Overrides:
playSamplein classTutorialOne_03_Drawing- Parameters:
samplePos- position of the sample in the audio buffersamplelen- length of the sample (will be adjusted)amplitude- amplitude of the sample on playbackenv- an ADSR envelope for the samplepitch- pitch scaling as deviation from default (1.0), where 0.5 = octave lower, 2.0 = octave higherpan- position of sound in the stereo audio field (-1.0 = left, 0.0 = center, 1.0 = right)- Returns:
-
draw
public void draw()Advance the visible audio window during draw().- Overrides:
drawin classTutorialOne_03_Drawing
-
parseKey
public void parseKey(char key, int keyCode) Add WindowBuffer controls, then pass all other commands to TutorialOne_03_Drawing. T toggle automatic window traversal { } jump backward / forward one whole window [ ] jump backward / forward one half window R rewind the audio window Y toggle random point events while windowing- Overrides:
parseKeyin classTutorialOne_03_Drawing- Parameters:
key- the key that was pressed, as a charkeyCode- keyCode for the key that was pressed
-
resetAudioWindow
public void resetAudioWindow() -
moveAudioWindow
public void moveAudioWindow(int delta) -
raindrops
public void raindrops(int count) Random point events along the upper part of the current window, useful for hearing time-structured files while the window is advancing. -
showHelp
public void showHelp()Description copied from class:TutorialOne_03_Drawingto generate help output, run RegEx search/replace on parseKey case lines with: // case ('.'): // (.+) // println(" * Press $1 to $2.");- Overrides:
showHelpin classTutorialOne_03_Drawing
-