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`

public class TutorialOne_06_WB_Retrofit extends TutorialOne_03_Drawing
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

  Fields
  Modifier and Type
  Field
  Description
  `(package private) ddf.minim.MultiChannelBuffer`
  `anthemBuffer`
  Full-file source buffer used by the Sampler instrument pool.
  `(package private) float[]`
  `anthemSignal`
  Full-file mono source, padded to at least mapper.getSize().
  `(package private) boolean`
  `isRaining`
  Optional random point-event texture while windowing.
  `(package private) boolean`
  `isWindowing`
  If true, draw() advances windowBuff each frame and refreshes the display.
  `(package private) boolean`
  `oldIsWindowing`
  Save animation state when file loading or windowing temporarily suspends it.
  `(package private) int`
  `poolSize`
  `(package private) int`
  `samplerMaxVoices`
  `(package private) float`
  `samplerSourceRateRef`
  sampling rate of samplerSourceRef
  `(package private) ddf.minim.MultiChannelBuffer`
  `samplerSourceRef`
  Sampler instruments use anthemBuffer, not the current visible playBuffer.
  `(package private) boolean`
  `windowAudioReady`
  WindowBuffer initialized or not? see initAudio()
  `(package private) WindowedBuffer`
  `windowBuff`
  Moving view onto anthemSignal, with window size == mapper.getSize().
  `(package private) int`
  `windowHopSize`
  Hop 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, videx`

  ### Fields 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, windowY`

  ### Fields 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
  Constructor
  Description
  `TutorialOne_06_WB_Retrofit()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `(package private) float[]`
  `backingGranularSignal()`
  `(package private) int`
  `backingIndexFromLocal(int localIndex)`
  `void`
  `draw()`
  Advance the visible audio window during draw().
  `(package private) void`
  `ensureGranularReady()`
  Granular gestures use anthemSignal as their source.
  `(package private) void`
  `ensureSamplerReady()`
  Ensures that all resources and variable necessary for the Sampler synth are ready to go.
  `processing.core.PVector`
  `getCoordFromSignalPos(int pos)`
  Backing-file index -> visible display coordinate, relative to the current window.
  `int`
  `getSamplePos(int x, int y)`
  Display coordinate -> visible window index -> backing file index.
  `int`
  `handleClickOutsideBrush(int x, int y)`
  Point clicks are copied from TutorialOne_03_Drawing, but the initial samplePos is the backing source index.
  `void`
  `initAudio()`
  Initializes audio using the TutorialOne_03_Drawing defaults, then creates an initial full-file backing source from the empty playBuffer.
  `(package private) void`
  `installBackingSource(float[] sig, float sourceSampleRate)`
  Installs a full-file backing source for WindowedBuffer and instruments.
  `void`
  `loadAudioFile(File audFile)`
  Loads an audio file through TutorialOne_03_Drawing's normal path.
  `static void`
  `main(String[] args)`
  `void`
  `moveAudioWindow(int delta)`
  `void`
  `parseKey(char key, int keyCode)`
  Add WindowBuffer controls, then pass all other commands to TutorialOne_03_Drawing.
  `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.
  `int`
  `playSample(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.
  `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.
  `(package private) void`
  `refreshWindowFromBacking(boolean advance)`
  Copies the current window into audioSignal and playBuffer.
  `void`
  `resetAudioWindow()`
  `(package private) void`
  `scheduleGranularBrushClick(TutorialOne_03_Drawing.AudioBrushLite b)`
  Brush granular playback uses the full backing signal and backing indices.
  `void`
  `setup()`
  `void`
  `showHelp()`
  to generate help output, run RegEx search/replace on parseKey case lines with: // case ('.'): // (.+) // println(" * Press $1 to $2.");
  `(package private) void`
  `suspendWindowAudio()`
  `(package private) void`
  `updateAudioChain(float[] sig)`
  `(package private) void`
  `updateAudioChain(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, writeToScreen`

  ### Methods 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### anthemSignal

    float[] anthemSignal
    Full-file mono source, padded to at least mapper.getSize().

  - ### anthemBuffer

    ddf.minim.MultiChannelBuffer anthemBuffer
    Full-file source buffer used by the Sampler instrument pool.

  - ### windowBuff

    WindowedBuffer windowBuff
    Moving view onto anthemSignal, with window size == mapper.getSize().

  - ### windowHopSize

    int windowHopSize
    Hop size for automatic window traversal.

  - ### isWindowing

    boolean isWindowing
    If true, draw() advances windowBuff each frame and refreshes the display.

  - ### oldIsWindowing

    boolean oldIsWindowing
    Save animation state when file loading or windowing temporarily suspends it.

  - ### isRaining

    boolean isRaining
    Optional random point-event texture while windowing.

  - ### windowAudioReady

    boolean windowAudioReady
    WindowBuffer initialized or not? see initAudio()

  - ### samplerSourceRef

    ddf.minim.MultiChannelBuffer samplerSourceRef
    Sampler instruments use anthemBuffer, not the current visible playBuffer.

  - ### samplerSourceRateRef

    float samplerSourceRateRef
    sampling rate of samplerSourceRef

  - ### poolSize

    int poolSize

  - ### samplerMaxVoices

    int samplerMaxVoices

- ## Constructor Details

  - ### TutorialOne_06_WB_Retrofit

    public TutorialOne_06_WB_Retrofit()

- ## Method Details

  - ### main

    public static void main(String[] args)

  - ### setup

    public void setup()
    Overrides:
      `setup` in class `TutorialOne_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:
      `initAudio` in class `TutorialOne_03_Drawing`

  - ### loadAudioFile

    public void loadAudioFile(File audFile)
    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:
      `loadAudioFile` in class `TutorialOne_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:
      `updateAudioChain` in class `TutorialOne_03_Drawing`
    Parameters:
      `sig` - an audio signal
      `sourceSampleRate` - audio sample rate for sig, usually obtained when reading from an audio file

  - ### updateAudioChain

    void updateAudioChain(float[] sig)
    Overrides:
      `updateAudioChain` in class `TutorialOne_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_Drawing`
    Ensures that all resources and variable necessary for the Sampler synth are ready to go.
    Overrides:
      `ensureSamplerReady` in class `TutorialOne_03_Drawing`

  - ### ensureGranularReady

    void ensureGranularReady()
    Granular gestures use anthemSignal as their source.
    Overrides:
      `ensureGranularReady` in class `TutorialOne_03_Drawing`

  - ### getSamplePos

    public int getSamplePos(int x, int y)
    Display coordinate -> visible window index -> backing file index.
    Overrides:
      `getSamplePos` in class `TutorialOne_03_Drawing`
    Parameters:
      `x` - an x coordinate within mapImage and display bounds
      `y` - 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:
      `getCoordFromSignalPos` in class `TutorialOne_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:
      `handleClickOutsideBrush` in class `TutorialOne_03_Drawing`

  - ### scheduleGranularBrushClick

    void scheduleGranularBrushClick(TutorialOne_03_Drawing.AudioBrushLite b)
    Brush granular playback uses the full backing signal and backing indices.
    Overrides:
      `scheduleGranularBrushClick` in class `TutorialOne_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:
      `playGranularGesture` in class `TutorialOne_03_Drawing`
    Parameters:
      `buf` - an audio signal as an array of float
      `sched` - an GestureSchedule with coordinate and timing information
      `params` - 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_Drawing`
    Plays an audio sample with with a custom envelope, pitch and stereo pan.
    Overrides:
      `playSample` in class `TutorialOne_03_Drawing`
    Parameters:
      `samplePos` - position of the sample in the audio buffer
      `samplelen` - length of the sample (will be adjusted)
      `amplitude` - amplitude of the sample on playback
      `env` - an ADSR envelope for the sample
      `pitch` - pitch scaling as deviation from default (1.0), where 0.5 = octave lower, 2.0 = octave higher
      `pan` - 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:
      `draw` in class `TutorialOne_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:
      `parseKey` in class `TutorialOne_03_Drawing`
    Parameters:
      `key` - the key that was pressed, as a char
      `keyCode` - 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_Drawing`
    to generate help output, run RegEx search/replace on parseKey case lines with: // case ('.'): // (.+) // println(" * Press $1 to $2.");
    Overrides:
      `showHelp` in class `TutorialOne_03_Drawing`