Class ArgosyMixer

java.lang.Object
processing.core.PApplet
net.paulhertz.pixelaudio.example.ArgosyMixer
All Implemented Interfaces:
processing.core.PConstants

public class ArgosyMixer extends processing.core.PApplet
ArgosyMixer demonstrates how the Argosy class can create and animate patterns and save them to video. This is experimental code.

The Argosy class turns arrays of integers into color patterns. It steps through the Pattern array to create blocks of pixels and assigns color to the blocks as it steps through the Colors arrays. The arrays don't have to be the same size--this creates variations in the pattern color sequences. For example, we might have blocks that are [5, 3, 8] units and assign them just two colors, say black and white:

    |    5     |  3   |       8        |    5     |  3   |       8        |
    |    B     |  W   |       B        |    W     |  B   |       W        |
 

As you can see, the two patterns together generate a larger repeating unit. If the "Repeat" filed in the GUI is set to 0, the patterns fill the Argosy array, which is the same size as the pixels[] array for the display image. A non-zero Repeat value determines how many times the pattern repeats. The way the Argosy array fills the display image is determined by the Map parameter. The map is a PixelAudioMapper determined by a PixelMapGen: basically, it creates a path (the "signal path") that visits every pixel in the display image once. Experiment with the GUI Map menu to find out more about how paths work. Read PixelAudioMapper and PixelMapGen documentation if you want detailed information. You can also browse the code for quite a few MultiGen PixelMapGens in this sketch and in the static methods appended to PixelAudio PixelMapGen classes.

ArgosyMixer provides a GUI for modifying argosy and animation parameters, plus a series of key commands that can shift patterns along the signal path. There are two Argosy patterns involved: the top one, Argosy 2, is transparent (Opacity = 127, initially).

In the GUI, the following parameters are exposed for each Argosy pattern:

   Map          -- select the PixelMapGen for each Argosy instance
   Colors       -- select a preset palette from a drop down list
   Opacity      -- opacity of the colors in the palette, 0-255
   Pattern      -- select a preset numeric pattern from a drop down list
   Repeat       -- number of times to repeat the pattern; enter 0 for maximum repetitions 
   Unit         -- the number of pixels in each unit of the pattern
   Gap          -- the number of pixels between each repeated pattern
   Gap color    -- select a preset gap color from a drop down list
   Gap opacity  -- enter the alpha channel value 0-255 for the gap color
   == ANIMATION ==
   Show         -- show or hide Argosy 1 or Argosy 2
   Freeze       -- freeze animation of Argosy 1 or Argsoy 2
   Step         -- number of pixels to shift on each animation step (negative to shift right)
   Open frames  -- number of frames to hold at animation start, applies both Argosy 1 and Argosy 2
   Close frames -- number of frames to hold at animation end, applies to both Argsoy 1 and Argosy 2
   Run frames   -- number of frames to animate before a hold, sets Argosy 1 and Argosy 2 separately
   Hold frames  -- number of frames to hold after a run of frames, sets Argosy 1 and Argosy 2 separately
   Duration     -- number of frames in the animation
   Record Video -- press to run and record animation from current display 
 

I suggest you start by experimenting with the patterns "The One" and "One-one". They create repeating patterns of one or two elements. Setting the Unit value (the number of pixels in each pattern element) to a power of 2 or a sum of powers of 2 is a good place to start, especially with the Hilbert PixelMapGens in the Map menu.

Click on the image to hear the sounds made by the patterns with sampling rate 48KHz. The patterns produce step or pulse (square) waves, so they are buzzy. Opacity will change how loud the sound is.

You can create stereo drones with the 'e' command, which creates a series of audio events along the points of an ellipse.

Press the spacebar to start or stop animation.

  
 --------------------------------------------------------------------------------------------
 ***++ NOTE: Key commands only work when the image display window is the active window. ++***
 --------------------------------------------------------------------------------------------
 
 Key Commands
 
 Press ' ' to trigger audio at the current mouse position.
 Press TAB to toggle animation.
 Press 'e' to trigger elliptical trail of audio events.
 Press 'a' to shift left one argosy unit.
 Press 'A' to shift right one argosy unit.
 Press 'b' to shift left one argosy length.
 Press 'B' to shift right one argosy length.
 Press 'c' to shift left one argosy length + argosy gap.
 Press 'C' to shift right one argosy length + argosy gap.
 Press 'd' to advance one animation step.
 Press 'D' to go back one animation step.
 Press 'g' or 'G' to set the pixelShift of argosies to zero (reset return point).
 Press 'l' to shift argosies left one animation step.
 Press 'L' to shift argosies left one animation step.
 Press 'r' to shift argosies right one animation step.
 Press 'R' to shift argosies right one animation step.
 Press 'p' to shift argosies left one pixel.
 Press 'P' to shift argosies right one pixel.
 Press 'f' to freeze changes to argosy 1.
 Press 'F' to freeze changes to argosy 2.
 Press 'i' or 'I' to show stats about argosies.
 Press 'S' to save current Argosy signals to a stereo WAV file.
 Press 's' to save current display to a PNG file.
 Press 'u' or 'U' to reinitialize any argosies that aren't frozen.
 Press 'v' or 'V' to toggle video recording.
 Press 'w' to reset animation tracking.
 Press 'W' to reset animation tracking.
 Press 'z' to reset argosy 1 to initial position.
 Press 'Z' to reset argosy 2 to initial position.
 Press 'h' or 'H' to show help message in console.
 
 
TODO save two image files, two audio files -- one for each Argosy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) ADSRParams
     
    (package private) ADSRParams
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GLabel
     
    (package private) ArrayList<TimedLocation>
     
    (package private) int
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) int
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) int
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) int
     
    (package private) ArrayList<processing.core.PVector>
     
    (package private) Argosy
     
    (package private) int
     
    (package private) ddf.minim.MultiChannelBuffer
     
    (package private) int[]
     
    (package private) g4p_controls.GCheckbox
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) PixelMapGen
     
    (package private) int
     
    (package private) processing.core.PImage
     
    (package private) boolean
     
    (package private) g4p_controls.GLabel
     
    (package private) PixelAudioMapper
     
    (package private) int
     
    (package private) int[]
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) g4p_controls.GCheckbox
     
    (package private) float[]
     
    (package private) int
     
    (package private) PASamplerInstrument
     
    (package private) int
     
    (package private) Argosy
     
    (package private) int
     
    (package private) ddf.minim.MultiChannelBuffer
     
    (package private) int[]
     
    (package private) g4p_controls.GCheckbox
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) PixelMapGen
     
    (package private) int
     
    (package private) processing.core.PImage
     
    (package private) boolean
     
    (package private) g4p_controls.GLabel
     
    (package private) PixelAudioMapper
     
    (package private) int
     
    (package private) int[]
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) g4p_controls.GCheckbox
     
    (package private) float[]
     
    (package private) int
     
    (package private) PASamplerInstrument
     
    (package private) int
     
    (package private) int
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) ddf.minim.AudioOutput
     
    (package private) int
     
    (package private) int
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int[]
     
     
    (package private) String[]
     
    (package private) g4p_controls.GDropList
     
    (package private) g4p_controls.GDropList
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) int[][]
     
    (package private) g4p_controls.GWindow
     
    (package private) int
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int
     
    (package private) int[]
     
    (package private) AffineTransformType
     
    (package private) AffineTransformType
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) AffineTransformType
     
    (package private) AffineTransformType
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) String[]
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GDropList
     
    (package private) g4p_controls.GDropList
     
    (package private) int[]
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) String[]
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GDropList
     
    (package private) g4p_controls.GDropList
     
    (package private) int
     
    (package private) int
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) int[]
     
    (package private) processing.core.PImage
     
    (package private) int
     
    (package private) ddf.minim.Minim
     
    (package private) int[]
     
    (package private) AffineTransformType
     
    (package private) int
     
    (package private) int
     
    (package private) int[]
     
    (package private) int[]
     
    (package private) float
     
    (package private) float
     
    (package private) String[]
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GDropList
     
    (package private) g4p_controls.GDropList
     
    (package private) int[][]
     
    (package private) float
     
    (package private) PixelAudio
     
    (package private) AffineTransformType
     
    (package private) AffineTransformType
     
    (package private) AffineTransformType
     
    (package private) Random
     
    (package private) g4p_controls.GButton
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) float
     
    (package private) int
     
    (package private) int
     
    (package private) int[]
     
    (package private) int
     
    (package private) int[]
     
    (package private) ArrayList<TimedLocation>
     
    (package private) int[]
     
    (package private) AffineTransformType[]
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GLabel
     
    (package private) g4p_controls.GTextField
     
    (package private) g4p_controls.GTextField
     
    (package private) int
     
    (package private) String
     
    (package private) int
     
    (package private) String
     
    (package private) com.hamoid.VideoExport
     
    (package private) int
     
    (package private) int
     
    (package private) int[]
     
    (package private) int
     

    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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    alphaText1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    alphaText2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    Drives animation and video recording.
    void
    Animates argo1 and argo2 argosy arrays.
    ArrayList<processing.core.PVector>
    animationPoints(float w, float h, int count)
     
    void
    animClose_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    animDuration_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    animHold1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    animHold2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    animOpen_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    animRun1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    animRun2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    argo1FreezeCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
     
    void
     
    void
    argo1ShowCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
     
    void
    argo2FreezeCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
     
    void
     
    void
    argo2ShowCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
     
    void
    argoStep1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    argoStep2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    audioMouseClick(int x, int y)
    Typically called from mouseClicked with mouseX and mouseY, generates audio events.
    boustrophRowRandom(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols BoustropheGens.
    int
     
    int
    clipToHeight(int y)
     
    int
    clipToWidth(int x)
     
    void
    colorMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    void
    colorMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    void
     
    void
     
    void
    drawCircle(int x, int y)
    Draws a circle at the location of an audio trigger (mouseDown event).
    void
    drawControlWindow(processing.core.PApplet appc, g4p_controls.GWinData data)
     
    processing.core.PImage
     
    void
    gap1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    gap2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    gapColorMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    void
    gapColorMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    void
    gapOpacity1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    gapOpacity2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    genMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    void
    genMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    getArgosy(PixelAudioMapper mapper, int[] argosyPattern, int argosyUnitSize, int argosyReps, boolean isCentered, int[] argosyColors, int argosyGap, int argosyGapColor, int argoStep)
    Creates a new Argosy instance using supplied arguments.
    int
    getSamplePos(Argosy argo, int x, int y, int shift)
    Calculate position of the image pixel within the signal path, taking the shifting of pixels and audioSignal into account.
    hilbertColumnOrtho(int cols, int rows, int genW, int genH)
    This variation on hilbertRowOrtho arranges the gens vertically, in columns.
    hilbertLoop3x2(int genW, int genH)
    hilbertLoop3x2() returns a looping fractal signal path consisting of 6 Hilbert gens, 3 wide by 2 tall, to fit a 3 * genW by 2 * genH image.
    hilbertLoop6x4(int genW)
     
    hilbertRowOrtho(int cols, int rows, int genW, int genH)
    This method creates rows of HilbertGens, starting each row from the left and adding gens.
    hilbertRowRandomFlip(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols HilbertGens.
    hilbertStackBou(int stacks, int rows, int units, int genW, int genH)
    This method creates a vertical stacks of rows of HilbertGens.
    hilbertStackOrtho(int stacks, int rows, int units, int genW, int genH)
    This method creates a vertical stacks of rows of HilbertGens.
    hilbertZigzagLoop6x4(int genW, int genH)
    This method creates a MultiGen consisting of a mix of zigzag and Hilbert curves in 6 columns and 4 rows arranged to provide a continuous loop.
    void
    Handles image file output once an output file is selected.
    void
    Initializes some animation variables.
    void
    initArgo1(int shift)
    Initializes Argosy instance argo1 and then shifts its pixels by shift pixels.
    void
    initArgo2(int shift)
    Initializes Argosy instance argo2 and then shifts its pixels by shift pixels.
    void
    Initializes argo1 and argo2 Argosy instances, sets some values for GUI, sets animation variables: your one-stop setup method for the argosies.
    void
    CALL THIS METHOD IN SETUP() Initializes Minim audio library and audio variables.
    boolean
    Detects Caps Lock state.
    void
    The built-in keyPressed handler for Processing, forwards key and keyCode to parseKey().
    static void
    main(String[] args)
     
    void
    The built-in mouseClicked handler for Processing, forwards clipped mouse coords to audioMouseClick().
    void
    parseKey(char key, int keyCode)
    Handles key press events passed on by the built-in keyPressed method.
    void
    patternMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    void
    patternMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
     
    int
    playSample(PASamplerInstrument synth, int samplePos, int samplelen, float amplitude, ADSRParams env, float pan)
    Plays an audio sample with a custom envelope and stereo pan.
    Returns a randomly selected AffineTransformType.
    void
    recordButton_hit(g4p_controls.GButton source, g4p_controls.GEvent event)
     
    void
    record a frame of video
    void
    Calls Argosy to get a floating point representation of an argosy array.
    void
    repText1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    repText2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
     
    void
    Run the animation for audio events.
    void
    Starts the image saving event chain.
    void
    saveImageToFile(processing.core.PImage img, String fileName)
    Saves display image to a specified file.
    void
    saveToAudio(boolean isStereo)
    Save audio buffer to a file
    selectMapper(int selector, PixelMapGen gen)
    A method for creating a PixelMapGen (MultiGen) to initialize and return a PixelAudioMapper, called by the GUI methods genMenu1_hit() and genMenu2_hit().
    int[]
    setArgoColorsAlpha(int[] colorArray, int alpha)
    Applies alpha channel value alpha to all the RGB colors in colorArray and returns a new array with the modified colors.
    void
    setAudioGain(float g)
    Sets audioOut.gain.
    void
     
    void
     
    void
    Posts some information about the state of argo1 and argo2 to the console.
    void
    Posts key command help to the console.
    void
    Toggle animation and handle any side effects (none for the moment).
    void
    unitSize1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    unitSize2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
     
    void
    Updates argo1 and argo2 to reflect animation and other changes.
    zigzagColumnAltOrtho(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols DiagonalZigzagGens.
    zigzagColumnOrtho(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols DiagonalZigzagGens.
    zigzagLoop6x4(int genW, int genH)
     
    zigzagRowAltOrtho(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols DiagonalZigzagGens.
    zigzagRowOrtho(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols DiagonalZigzagGens.
    zigzagRowRandomFlip(int cols, int rows, int genW, int genH)
    Creates a MultiGen with rows * cols DiagonalZigzagGens.

    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, 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, mouseDragged, mouseEntered, mouseEntered, mouseExited, mouseExited, mouseMoved, mouseMoved, mousePressed, mousePressed, mouseReleased, 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, stop, 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

    • imageWidth

      int imageWidth
    • imageHeight

      int imageHeight
    • bgColor

      int bgColor
    • pixelaudio

      PixelAudio pixelaudio
    • mapSize

      int mapSize
    • mapImage

      processing.core.PImage mapImage
    • chan

    • r270

    • r90

    • r180

    • flipx

    • fx270

    • fx90

    • flipy

    • nada

    • transArray

      AffineTransformType[] transArray
    • rand

      Random rand
    • roig

      int roig
    • groc

      int groc
    • blau

      int blau
    • blau2

      int blau2
    • blanc

      int blanc
    • gris

      int gris
    • negre

      int negre
    • grana

      int grana
    • vert

      int vert
    • taronja

      int taronja
    • roigtar

      int roigtar
    • violet

      int violet
    • black

      int black
    • white

      int white
    • gray

      int gray
    • theOne

      int[] theOne
    • oneOne

      int[] oneOne
    • countToFive

      int[] countToFive
    • oddOneToSeven

      int[] oddOneToSeven
    • fourPower

      int[] fourPower
    • sevenFortyNine

      int[] sevenFortyNine
    • fiboLSystem55

      int[] fiboLSystem55
    • fibonacciNums

      int[] fibonacciNums
    • lucasNums

      int[] lucasNums
    • blackAlone

      int[] blackAlone
    • blackWhite

      int[] blackWhite
    • whiteBlack

      int[] whiteBlack
    • blackGrayWhite

      int[] blackGrayWhite
    • grayRamp

      int[] grayRamp
    • grayTriangle

      int[] grayTriangle
    • espectroOcho

      int[] espectroOcho
    • espectroSeis

      int[] espectroSeis
    • totsElsColors

      int[] totsElsColors
    • multicolor

      int[] multicolor
    • blueCream

      int[] blueCream
    • creamBlue

      int[] creamBlue
    • fourColor

      int[] fourColor
    • fiveColor

      int[] fiveColor
    • argo1

      Argosy argo1
    • argo1Gen

      PixelMapGen argo1Gen
    • argo1Mapper

      PixelAudioMapper argo1Mapper
    • argo1Pattern

      int[] argo1Pattern
    • argo1Colors

      int[] argo1Colors
    • argo1Alpha

      int argo1Alpha
    • argo1Reps

      int argo1Reps
    • argo1Unit

      int argo1Unit
    • argo1Gap

      int argo1Gap
    • argo1GapColor

      int argo1GapColor
    • argo1GapColorIndex

      int argo1GapColorIndex
    • argo1GapAlpha

      int argo1GapAlpha
    • argo1IsCentered

      boolean argo1IsCentered
    • argo1Image

      processing.core.PImage argo1Image
    • isShowArgo1

      boolean isShowArgo1
    • argo2

      Argosy argo2
    • argo2Gen

      PixelMapGen argo2Gen
    • argo2Mapper

      PixelAudioMapper argo2Mapper
    • argo2Pattern

      int[] argo2Pattern
    • argo2Colors

      int[] argo2Colors
    • argo2Alpha

      int argo2Alpha
    • argo2Reps

      int argo2Reps
    • argo2Unit

      int argo2Unit
    • argo2Gap

      int argo2Gap
    • argo2GapColor

      int argo2GapColor
    • argo2GapColorIndex

      int argo2GapColorIndex
    • argo2GapAlpha

      int argo2GapAlpha
    • argo2IsCentered

      boolean argo2IsCentered
    • argo2Image

      processing.core.PImage argo2Image
    • isShowArgo2

      boolean isShowArgo2
    • argo1Step

      int argo1Step
    • argo2Step

      int argo2Step
    • animOpen

      int animOpen
    • animClose

      int animClose
    • animRun1

      int animRun1
    • animHold1

      int animHold1
    • animRun2

      int animRun2
    • animHold2

      int animHold2
    • animDuration

      int animDuration
    • argoStep

      int argoStep
    • isAnimating

      boolean isAnimating
    • isLooping

      boolean isLooping
    • animstep1

      int animstep1
    • runCount1

      int runCount1
    • holdCount1

      int holdCount1
    • animstep2

      int animstep2
    • runCount2

      int runCount2
    • holdCount2

      int holdCount2
    • isArgo1Freeze

      boolean isArgo1Freeze
    • isArgo2Freeze

      boolean isArgo2Freeze
    • argo1PixelCount

      int argo1PixelCount
    • argo2PixelCount

      int argo2PixelCount
    • videx

      com.hamoid.VideoExport videx
    • videoPath

      String videoPath
    • videoFilename

      String videoFilename
    • videoFrameRate

      int videoFrameRate
    • currentFrame

      int currentFrame
    • isRecordingVideo

      boolean isRecordingVideo
    • isSavePatterns

      boolean isSavePatterns
    • minim

      ddf.minim.Minim minim
    • audioOut

      ddf.minim.AudioOutput audioOut
    • isBufferStale

      boolean isBufferStale
    • sampleRate

      float sampleRate
    • audioLength

      int audioLength
    • noteDuration

      int noteDuration
    • samplelen

      int samplelen
    • pitchScaling

      float pitchScaling
    • panning

      float panning
    • outputGain

      float outputGain
    • adsr1

      ADSRParams adsr1
    • adsr2

      ADSRParams adsr2
    • sampleX

      int sampleX
    • sampleY

      int sampleY
    • timeLocsArray

      ArrayList<TimedLocation> timeLocsArray
    • animationLocsArray

      ArrayList<TimedLocation> animationLocsArray
    • aniPoints

      ArrayList<processing.core.PVector> aniPoints
    • count

      int count
    • fileIndex

      int fileIndex
    • argo1Buffer

      ddf.minim.MultiChannelBuffer argo1Buffer
    • argo2Buffer

      ddf.minim.MultiChannelBuffer argo2Buffer
    • argo1Synth

    • argo2Synth

    • argo1Signal

      float[] argo1Signal
    • argo2Signal

      float[] argo2Signal
    • argo1SamplePos

      int argo1SamplePos
    • argo2SamplePos

      int argo2SamplePos
    • argo1GenSelect

      int argo1GenSelect
    • argo2GenSelect

      int argo2GenSelect
    • argo1PaletteSelect

      int argo1PaletteSelect
    • argo2PaletteSelect

      int argo2PaletteSelect
    • argo1PatternSelect

      int argo1PatternSelect
    • argo2PatternSelect

      int argo2PatternSelect
    • controlWindow

      g4p_controls.GWindow controlWindow
    • argo1Label

      g4p_controls.GLabel argo1Label
    • genLabel1

      g4p_controls.GLabel genLabel1
    • genMenu1

      g4p_controls.GDropList genMenu1
    • colorsLabel1

      g4p_controls.GLabel colorsLabel1
    • colorMenu1

      g4p_controls.GDropList colorMenu1
    • alpha1Label

      g4p_controls.GLabel alpha1Label
    • alpha1Text

      g4p_controls.GTextField alpha1Text
    • patternLabel1

      g4p_controls.GLabel patternLabel1
    • patternMenu1

      g4p_controls.GDropList patternMenu1
    • repLabel1

      g4p_controls.GLabel repLabel1
    • repText1

      g4p_controls.GTextField repText1
    • unitLabel1

      g4p_controls.GLabel unitLabel1
    • unitSize1

      g4p_controls.GTextField unitSize1
    • gapLabel1

      g4p_controls.GLabel gapLabel1
    • gap1Text

      g4p_controls.GTextField gap1Text
    • gapColorLabel1

      g4p_controls.GLabel gapColorLabel1
    • gapColorMenu1

      g4p_controls.GDropList gapColorMenu1
    • gapAlpha1Label

      g4p_controls.GLabel gapAlpha1Label
    • gapAlpha1Text

      g4p_controls.GTextField gapAlpha1Text
    • argo1Show

      g4p_controls.GCheckbox argo1Show
    • argo1Freeze

      g4p_controls.GCheckbox argo1Freeze
    • argoStepLabel1

      g4p_controls.GLabel argoStepLabel1
    • argoStepText1

      g4p_controls.GTextField argoStepText1
    • argo2Label

      g4p_controls.GLabel argo2Label
    • genLabel2

      g4p_controls.GLabel genLabel2
    • genMenu2

      g4p_controls.GDropList genMenu2
    • colorsLabel2

      g4p_controls.GLabel colorsLabel2
    • colorMenu2

      g4p_controls.GDropList colorMenu2
    • alpha2Label

      g4p_controls.GLabel alpha2Label
    • alpha2Text

      g4p_controls.GTextField alpha2Text
    • patternLabel2

      g4p_controls.GLabel patternLabel2
    • patternMenu2

      g4p_controls.GDropList patternMenu2
    • repLabel2

      g4p_controls.GLabel repLabel2
    • repText2

      g4p_controls.GTextField repText2
    • unitLabel2

      g4p_controls.GLabel unitLabel2
    • unitSize2

      g4p_controls.GTextField unitSize2
    • gapLabel2

      g4p_controls.GLabel gapLabel2
    • gap2Text

      g4p_controls.GTextField gap2Text
    • gapColorLabel2

      g4p_controls.GLabel gapColorLabel2
    • gapColorMenu2

      g4p_controls.GDropList gapColorMenu2
    • gapAlpha2Label

      g4p_controls.GLabel gapAlpha2Label
    • gapAlpha2Text

      g4p_controls.GTextField gapAlpha2Text
    • argo2Show

      g4p_controls.GCheckbox argo2Show
    • argo2Freeze

      g4p_controls.GCheckbox argo2Freeze
    • argoStepLabel2

      g4p_controls.GLabel argoStepLabel2
    • argoStepText2

      g4p_controls.GTextField argoStepText2
    • animationLabel

      g4p_controls.GLabel animationLabel
    • animOpenLabel

      g4p_controls.GLabel animOpenLabel
    • animOpenText

      g4p_controls.GTextField animOpenText
    • animRunLabel1

      g4p_controls.GLabel animRunLabel1
    • animRunText1

      g4p_controls.GTextField animRunText1
    • animHoldLabel1

      g4p_controls.GLabel animHoldLabel1
    • animHoldText1

      g4p_controls.GTextField animHoldText1
    • animRunLabel2

      g4p_controls.GLabel animRunLabel2
    • animRunText2

      g4p_controls.GTextField animRunText2
    • animHoldLabel2

      g4p_controls.GLabel animHoldLabel2
    • animHoldText2

      g4p_controls.GTextField animHoldText2
    • animCloseLabel

      g4p_controls.GLabel animCloseLabel
    • animCloseText

      g4p_controls.GTextField animCloseText
    • animDurationLabel

      g4p_controls.GLabel animDurationLabel
    • animDurationText

      g4p_controls.GTextField animDurationText
    • recordButton

      g4p_controls.GButton recordButton
    • genItems

      String[] genItems
    • colorItems

      String[] colorItems
    • colorVars

      int[][] colorVars
    • patternItems

      String[] patternItems
    • patternVars

      int[][] patternVars
    • gapColorVars

      int[] gapColorVars
    • gapColorItems

      String[] gapColorItems
    • ypos

      int ypos
    • inc

      int inc
  • Constructor Details

    • ArgosyMixer

      public ArgosyMixer()
  • Method Details

    • main

      public static void main(String[] args)
    • settings

      public void settings()
      Overrides:
      settings in class processing.core.PApplet
    • setup

      public void setup()
      Overrides:
      setup in class processing.core.PApplet
    • initArgosies

      public void initArgosies()
      Initializes argo1 and argo2 Argosy instances, sets some values for GUI, sets animation variables: your one-stop setup method for the argosies.
    • setArgoColorsAlpha

      public int[] setArgoColorsAlpha(int[] colorArray, int alpha)
      Applies alpha channel value alpha to all the RGB colors in colorArray and returns a new array with the modified colors.
      Parameters:
      colorArray - an array of RGB colors
      alpha - alpha channel value to apply to RGB colors
      Returns:
      a new array with the modified colors.
    • initArgo1

      public void initArgo1(int shift)
      Initializes Argosy instance argo1 and then shifts its pixels by shift pixels.
      Parameters:
      shift - number of pixels to rotate left argo1.argosyArray
    • initArgo2

      public void initArgo2(int shift)
      Initializes Argosy instance argo2 and then shifts its pixels by shift pixels.
      Parameters:
      shift - number of pixels to rotate left argo2.argosyArray
    • getArgosy

      public Argosy getArgosy(PixelAudioMapper mapper, int[] argosyPattern, int argosyUnitSize, int argosyReps, boolean isCentered, int[] argosyColors, int argosyGap, int argosyGapColor, int argoStep)
      Creates a new Argosy instance using supplied arguments. Display of the Argosy array of color values is managed through the supplied PixelAudioMapper argument. The array is created by stepping through the pattern and color values, creating blocks of color of argosyUnitSize, separated by argosyGap pixels.
      Parameters:
      mapper - a PixelAudioMapper instance, with width and height appropriate for display window
      argosyPattern - a pattern of ints to step through in creating the argosy array
      argosyUnitSize - number of pixels in each block of same-colored pixels in the Argosy.argosyArray
      argosyReps - number of times to repeat the pattern, 0 for as many as will fit
      isCentered - true if argosy pixel array should be centered
      argosyColors - array of colors to step through
      argosyGap - number of pixels between repeated patterns
      argosyGapColor - color to apply to the argosy gap
      argoStep - the number of pixels to rotate when animating, mostly ignored in this app
      Returns:
      a new Argosy instance
    • updateArgosies

      public void updateArgosies()
      Updates argo1 and argo2 to reflect animation and other changes.
    • initAnimation

      public void initAnimation()
      Initializes some animation variables.
    • draw

      public void draw()
      Overrides:
      draw in class processing.core.PApplet
    • animate

      public void animate()
      Drives animation and video recording.
    • animateArgosies

      public void animateArgosies()
      Animates argo1 and argo2 argosy arrays. Note that we are supplying our own animation step values by calling the Argosy.shift() method. The total shift is stored in Argosy.argosyPixelShift if isCounted is true (last argument to argo1.shift() and argo2.shift()).
    • recordVideo

      public void recordVideo()
      record a frame of video
    • mouseClicked

      public void mouseClicked()
      The built-in mouseClicked handler for Processing, forwards clipped mouse coords to audioMouseClick().
      Overrides:
      mouseClicked in class processing.core.PApplet
    • clipToWidth

      public int clipToWidth(int x)
    • clipToHeight

      public int clipToHeight(int y)
    • isCapsLockDown

      public boolean isCapsLockDown()
      Detects Caps Lock state. We use Caps Lock state to switch between audio and graphics command sets.
      Returns:
      true if Caps Lock is down, false otherwise.
    • keyPressed

      public void keyPressed()
      The built-in keyPressed handler for Processing, forwards key and keyCode to parseKey().
      Overrides:
      keyPressed in class processing.core.PApplet
    • parseKey

      public void parseKey(char key, int keyCode)
      Handles key press events passed on by the built-in keyPressed method.
      Parameters:
      key - the key the user pressed, as a char
      keyCode - numeric keycode for the key the user pressed
    • showHelp

      public void showHelp()
      Posts key command help to the console.
    • setAudioGain

      public void setAudioGain(float g)
      Sets audioOut.gain.
      Parameters:
      g - gain value for audioOut, in decibels
    • toggleAnimation

      public void toggleAnimation()
      Toggle animation and handle any side effects (none for the moment).
    • showArgosyStats

      public void showArgosyStats()
      Posts some information about the state of argo1 and argo2 to the console.
    • saveImage

      public void saveImage()
      Starts the image saving event chain.
    • imageFileSelectedWrite

      public void imageFileSelectedWrite(File selection)
      Handles image file output once an output file is selected.
      Parameters:
      selection - an output file for the image, forwarded from saveImage()
    • saveImageToFile

      public void saveImageToFile(processing.core.PImage img, String fileName)
      Saves display image to a specified file.
      Parameters:
      img - image to save, reference to a PImage
      fileName - name of the file to save, typically a fully qualified file path + file name
    • drawOffscreen

      public processing.core.PImage drawOffscreen()
      Returns:
      a PImage generated in an offscreen PGraphics buffer.
    • hilbertLoop3x2

      public MultiGen hilbertLoop3x2(int genW, int genH)
      hilbertLoop3x2() returns a looping fractal signal path consisting of 6 Hilbert gens, 3 wide by 2 tall, to fit a 3 * genW by 2 * genH image. Note that genH must equal genW and both must be powers of 2. For the image size we're using in this example, genW = image width / 3 and genH = image height / 2.
      Parameters:
      genW - width of each HilbertGen
      genH - height of each HilbertGen
      Returns:
      a MultiGen consisting of 6 HilbertGens linked together by one signal path
    • hilbertLoop6x4

      public MultiGen hilbertLoop6x4(int genW)
    • hilbertZigzagLoop6x4

      public MultiGen hilbertZigzagLoop6x4(int genW, int genH)
      This method creates a MultiGen consisting of a mix of zigzag and Hilbert curves in 6 columns and 4 rows arranged to provide a continuous loop.
      Parameters:
      genW -
      genH -
      Returns:
    • hilbertStackOrtho

      public MultiGen hilbertStackOrtho(int stacks, int rows, int units, int genW, int genH)
      This method creates a vertical stacks of rows of HilbertGens. Each row begins genH pixels down from the previous row, back at the beginning of the previous row (i.e., in "row major" order, like a bitmap). This method pairs nicely with an image with 3 columns of with 8 rows of words, using the image as a control surface for sampling an audio file with words recorded at the appropriate locations to match the screen order. I used it for a performance work, DeadBodyWorkFlow, which is included in the The signal path jumps from the end of the last gen in each row to the beginning of the first gen int he next row. The path in each row is continuous, which provides some interesting optical effects.
      Parameters:
      stacks - the number of stacks
      rows - the number of rows in each stack
      units - the number of gens in each row
      genW - the width of each gen, a power of 2
      genH - the height of each gen, equal to genW
      Returns:
      a Multigen consisting of stacks * rows * units PixelMapGens
    • hilbertStackBou

      public MultiGen hilbertStackBou(int stacks, int rows, int units, int genW, int genH)
      This method creates a vertical stacks of rows of HilbertGens. Each row begins genH pixels down from the previous row. Alternating rows add units in opposite directions. This means path continuity is possible in each stack by changing the orientation of the gens; however, it isn't fully implemented in this example. Hint: choosing the right orientation for each gen will assure path continuity.
      Parameters:
      stacks - the number of stacks
      rows - the number of rows in each stack
      units - the number of gens in each row
      genW - the width of each gen, a power of 2
      genH - the height of each gen, equal to genW
      Returns:
      a Multigen consisting of stacks * rows * units PixelMapGens
    • hilbertRowOrtho

      public MultiGen hilbertRowOrtho(int cols, int rows, int genW, int genH)
      This method creates rows of HilbertGens, starting each row from the left and adding gens. The odd rows are flipped vertically and the even rows are unchanged. The unchanged HilbertGen starts at upper left corner and ends at upper right corner, so this provides some possibilities of symmetry between rows. The path is not continuous.
      Parameters:
      cols - number of columns of gens wide
      rows - number of rows of gens high
      genW - width of each gen (same as genH and a power of 2)
      genH - height of each gen
      Returns:
      a MultiGen composed of cols * rows PixelMapGens
    • hilbertColumnOrtho

      public MultiGen hilbertColumnOrtho(int cols, int rows, int genW, int genH)
      This variation on hilbertRowOrtho arranges the gens vertically, in columns.
      Parameters:
      cols - number of columns of gens wide
      rows - number of rows of gens high
      genW - width of each gen (same as genH and a power of 2)
      genH - height of each gen
      Returns:
      a MultiGen composed of cols * rows PixelMapGens
    • zigzagLoop6x4

      public MultiGen zigzagLoop6x4(int genW, int genH)
      Parameters:
      genW - width of each zigzag gen
      genH - height of each zigzag gen
      Returns:
      a looping MultiGen with 6 rows x 4 columns of DiagonalZigzagGen instances
    • zigzagRowOrtho

      public MultiGen zigzagRowOrtho(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols DiagonalZigzagGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height. "Ortho" implies that each row starts at the left edge. The orientation of the the diagonals changes for alternate rows.
      Parameters:
      cols - number of vertical columns
      rows - number of horiaontal rows
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • zigzagRowAltOrtho

      public MultiGen zigzagRowAltOrtho(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols DiagonalZigzagGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height. "Ortho" implies that each row starts at the left edge. The orientation of the the diagonals is more complex than zigzagRowOrtho(), hence the "Alt" in the method name.
      Parameters:
      cols - number of vertical columns
      rows - number of horiaontal rows
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • zigzagColumnOrtho

      public MultiGen zigzagColumnOrtho(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols DiagonalZigzagGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height. The MultiGen steps along columns rather than rows. "Ortho" implies that each column starts at the top edge. The orientation of the diagonals alternates one column to the next.
      Parameters:
      cols - number of vertical columns
      rows - number of horiaontal rows
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • zigzagColumnAltOrtho

      public MultiGen zigzagColumnAltOrtho(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols DiagonalZigzagGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height. The MultiGen steps along columns rather than rows. "Ortho" implies that each column starts at the top edge. The orientation of the diagonals is more complex than zigzagColumnOrtho(), hence "Alt" in the method name.
      Parameters:
      cols - number of vertical columns wide
      rows - number of horiaontal rows high
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • zigzagRowRandomFlip

      public MultiGen zigzagRowRandomFlip(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols DiagonalZigzagGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height. The MultiGen steps along rows. "Ortho" implies that each row starts at the left edge. The orientation of the diagonals is randomized.
      Parameters:
      cols - number of vertical columns
      rows - number of horiaontal rows
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • boustrophRowRandom

      public MultiGen boustrophRowRandom(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols BoustropheGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height.
      Parameters:
      cols - number of vertical columns wide
      rows - number of horiaontal rows high
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • hilbertRowRandomFlip

      public MultiGen hilbertRowRandomFlip(int cols, int rows, int genW, int genH)
      Creates a MultiGen with rows * cols HilbertGens. Note that you should set values for such that: (rows * genW) == width and (cols * genH) == height and that genH == genW and both are powers of 2. The orientation of the HilbertGens is randomized.
      Parameters:
      cols - number of vertical columns wide
      rows - number of horiaontal rows high
      genW - width of an individual PixelMapGen
      genH - height of an indvidual PixelMapGen
      Returns:
      a MultiGen created from rows * cols PixelMapGens
    • randomTransform

      public AffineTransformType randomTransform()
      Returns a randomly selected AffineTransformType. @see PixelMapGen.
      Returns:
      a random element from transArray
    • selectMapper

      public PixelAudioMapper selectMapper(int selector, PixelMapGen gen)
      A method for creating a PixelMapGen (MultiGen) to initialize and return a PixelAudioMapper, called by the GUI methods genMenu1_hit() and genMenu2_hit().
      Parameters:
      selector - number to select a particular method to create MultiGen, keyed to GUI.
      gen - a PixelMapGen object that will contain the new PixelMapGen on completion
      Returns:
      a PixelAudioMapper created with the new PixelMapGen
    • createGUI

      public void createGUI()
    • drawControlWindow

      public void drawControlWindow(processing.core.PApplet appc, g4p_controls.GWinData data)
    • genMenu1_hit

      public void genMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • colorMenu1_hit

      public void colorMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • alphaText1_change

      public void alphaText1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • patternMenu1_hit

      public void patternMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • repText1_change

      public void repText1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • unitSize1_change

      public void unitSize1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • gap1_change

      public void gap1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • gapColorMenu1_hit

      public void gapColorMenu1_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • gapOpacity1_change

      public void gapOpacity1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • argoStep1_change

      public void argoStep1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • argo1ShowCheck_hit

      public void argo1ShowCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
    • argo1FreezeCheck_hit

      public void argo1FreezeCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
    • argo1InitAndShift

      public void argo1InitAndShift()
    • genMenu2_hit

      public void genMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • colorMenu2_hit

      public void colorMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • alphaText2_change

      public void alphaText2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • patternMenu2_hit

      public void patternMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • repText2_change

      public void repText2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • unitSize2_change

      public void unitSize2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • gap2_change

      public void gap2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • gapColorMenu2_hit

      public void gapColorMenu2_hit(g4p_controls.GDropList source, g4p_controls.GEvent event)
    • gapOpacity2_change

      public void gapOpacity2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • argoStep2_change

      public void argoStep2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • argo2ShowCheck_hit

      public void argo2ShowCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
    • argo2FreezeCheck_hit

      public void argo2FreezeCheck_hit(g4p_controls.GCheckbox source, g4p_controls.GEvent event)
    • argo2InitAndShift

      public void argo2InitAndShift()
    • animOpen_change

      public void animOpen_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • animClose_change

      public void animClose_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • animRun1_change

      public void animRun1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • animHold1_change

      public void animHold1_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • animRun2_change

      public void animRun2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • animHold2_change

      public void animHold2_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • animDuration_change

      public void animDuration_change(g4p_controls.GTextField source, g4p_controls.GEvent event)
    • recordButton_hit

      public void recordButton_hit(g4p_controls.GButton source, g4p_controls.GEvent event)
    • initAudio

      public void initAudio()
      CALL THIS METHOD IN SETUP() Initializes Minim audio library and audio variables.
    • saveToAudio

      public void saveToAudio(boolean isStereo)
      Save audio buffer to a file
    • renderSignals

      public void renderSignals()
      Calls Argosy to get a floating point representation of an argosy array. Values in the returned array are scaled by argosy alpha / 255.0f, so that opacity corresponds to audio gain. The arrays from Argosy are loaded into audio buffers so that we can hear the patterns for argo1 and argo2.
    • audioMouseClick

      public void audioMouseClick(int x, int y)
      Typically called from mouseClicked with mouseX and mouseY, generates audio events. TODO play these argo1 and argo2 signals in a stereo buffer.
      Parameters:
      x - x-coordinate within a PixelAudioMapper's width
      y - y-coordinate within a PixelAudioMapper's height
    • playSample

      public int playSample(PASamplerInstrument synth, int samplePos, int samplelen, float amplitude, ADSRParams env, float pan)
      Plays an audio sample with a custom envelope and stereo pan.
      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
      pan - position of sound in the stereo audio field (-1.0 = left, 0.0 = center, 1.0 = right)
      Returns:
      the calculated sample length in samples
    • calcSampleLen

      public int calcSampleLen()
    • getSamplePos

      public int getSamplePos(Argosy argo, int x, int y, int shift)
      Calculate position of the image pixel within the signal path, taking the shifting of pixels and audioSignal into account. See MusicBoxBuffer for use of a windowed buffer in this calculation.
    • runTimeArray

      public void runTimeArray()
      Run the animation for audio events.
    • runAnimationArray

      public void runAnimationArray()
    • drawCircle

      public void drawCircle(int x, int y)
      Draws a circle at the location of an audio trigger (mouseDown event).
      Parameters:
      x - x coordinate of circle
      y - y coordinate of circle
    • animationPoints

      public ArrayList<processing.core.PVector> animationPoints(float w, float h, int count)