Instructions
Click the guitar neck to make noises! "A-G" to play chords, spacebar to toggle major/minor.
Chord
Attributes
chord: float[]
Holds the frequencies for each string
Constructor
constructor(e, a, d, g, b, hie)
Pushes all params into an array, taken as fret held down
Methods
playChord()
Sets frequency for each string and plays them
GuitarString
Attributes
baseFreq: float
Base frequency of the string
x: float
Location of the string
playing: bool
Whether or not the string is emitting sound
osc: Oscillator
Processing Oscillator to produce sound
distReq: float
Distance requirement to be active
playingChord: bool
Whether or not there is a chord being played
chordFret: int
Integer of the fret passed by the chord
Constructor
constructor(baseFreq, x)
Sets attributes to params, initializes else to defaults
Methods
freq()
Trivial getter for freqAtFret()
freqAtFret()
Determines string's current frequency
play()
Plays the current frequency
display()
Displays the string at its position. Current string is highlighted
GuitarNeck
Attributes
numFrets: int
Number of frets on the neck
scaleLength: float
Length of the neck
Constructor
constructor(e, a, d, g, b, hie)
Pushes all params into an array, taken as fret held down
Methods
playChord()
Sets frequency for each string and plays them