Package wellen

Class Arpeggiator

java.lang.Object
wellen.Arpeggiator

public class Arpeggiator extends Object
creates a sequence of notes based on an input pattern.
  • Constructor Details

    • Arpeggiator

      public Arpeggiator(int pLengthInQuarterNotes)
      Parameters:
      pLengthInQuarterNotes - length of the pattern in quarter notes
  • Method Details

    • set

      public static boolean set(Arpeggiator.NoteStruct[] pPattern, int pPosition, int pScaler, int pNote, float pVelocity)
      Parameters:
      pPattern - pattern to set
      pPosition - position in pattern
      pScaler - position scaler in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • set

      public static boolean set(Arpeggiator.NoteStruct[] pPattern, int pPosition, int pNote, float pVelocity)
      Parameters:
      pPattern - pattern to set
      pPosition - position in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • step

      public boolean step()
      Returns:
      the current note
    • replace_pattern

      public void replace_pattern(Arpeggiator.NoteStruct[] pPattern)
      Parameters:
      pPattern - pattern to replace current pattern
    • clear_pattern

      public void clear_pattern()
      clear current pattern
    • trigger

      public boolean trigger()
      Returns:
      true if a note is currently playing and if is active
    • note

      public int note()
      Returns:
      current note
    • velocity

      public int velocity()
      Returns:
      current velocity
    • reset

      public void reset()
      reset to beginning of pattern
    • play

      public void play(int pNote, int pVelocity)
      Parameters:
      pNote - set base note
      pVelocity - set base velocity
    • pattern

      public boolean pattern(int pPosition, int pNote, float pVelocity)
      set note in pattern
      Parameters:
      pPosition - position in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • pattern

      public boolean pattern(int pPosition, int pScaler, int pNote, float pVelocity)
      set note in pattern
      Parameters:
      pPosition - position in pattern
      pScaler - scaler in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • pattern_4

      public boolean pattern_4(int pPosition, int pNote, float pVelocity)
      Parameters:
      pPosition - position in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • pattern_8

      public boolean pattern_8(int pPosition, int pNote, float pVelocity)
      Parameters:
      pPosition - position in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • pattern_16

      public boolean pattern_16(int pPosition, int pNote, float pVelocity)
      Parameters:
      pPosition - position in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set
    • pattern_32

      public boolean pattern_32(int pPosition, int pNote, float pVelocity)
      Parameters:
      pPosition - position in pattern
      pNote - note in pattern
      pVelocity - velocity in pattern
      Returns:
      true if note was set