Guitar

interface Guitar extends Instrument { uuid: string label: string enabled: boolean minimized: boolean audioUnit: InstrumentAudioUnit icon: string key: 'Guitar' mode: 0 | 1 rate: 0 | 1 | 2 speed: number speedVariation: number velocity: number velocityVariation: number tilt: number position: number tuning: number body: number damping: number dampingVariation: number pluck: number pluckVariation: number tension: number spot: number pick: number spread: number volume: number slot: number chord: number shapes: readonly (readonly number[])[] notes: readonly number[] groove: Nullable<AnyGroove> patterns: readonly GuitarSlot[] patternNames: readonly string[] remove(): void setShape(index: number, frets: readonly number[]): void setNotes(notes: readonly number[]): void }

Six string Karplus-Strong guitar. In mode 0 the pattern of the playing slot strums a chord while the transport runs: the chord of the chord track, or one of 16 custom shapes chosen with chord. A custom shape plays its exact frets, ignores the chord track and is heard by no other device. Automate chord and slot to play an own progression and change the rhythm. Played notes sound on the strings in both modes.

Example

CODE
const guitar = project.addInstrumentUnit("Guitar").instrument
guitar.setShape(0, [-1, 3, 2, 0, 1, 0])
guitar.setShape(1, [12, 0, 0, 0, 12, 0])
guitar.chord = 1
guitar.patterns[3].load("Travis")
guitar.patterns[4].setSteps([{stroke: "bass"}, {stroke: "rest"}, {stroke: "pick", strings: 0b110000}, {stroke: "rest"}])
guitar.slot = 4

Hierarchy


Properties

uuid: string

readonly

Inherited from uuid

Unique id

label: string

Inherited from label

Custom label

enabled: boolean

Inherited from enabled

Enable or bypass the device

minimized: boolean

Inherited from minimized

Collapse the device editor in the studio

audioUnit: InstrumentAudioUnit

readonly

Inherited from audioUnit

The audio unit this instrument belongs to

icon: string

Inherited from icon

Icon name (see IconSymbol)

key: 'Guitar'

readonly

Overrides key

Always "Guitar"

mode: 0 | 1

0 = strum the chord track with the pattern, 1 = play notes only (default 0)

rate: 0 | 1 | 2

Pattern speed: 0 = eighths, 1 = sixteenths, 2 = thirty-seconds (default 1)

speed: number

How long a strum takes to cross the strings, higher is slower (0.0 to 1.0, default 0.3)

speedVariation: number

Strum timing variation (0.0 to 1.0, default 0.2)

velocity: number

Velocity (0.0 to 1.0, default 0.8)

velocityVariation: number

Velocity variation per stroke, the same for all its strings (0.0 to 1.0, default 0.75)

tilt: number

Strum level across the strings: above 0 the treble strings are louder, below 0 the bass strings (-1.0 to 1.0, default 0.0)

position: number

Neck position: 0 = Open, 1 = 3rd, 2 = 5th, 3 = 7th, 4 = 9th, 5 = 12th fret (default 0)

tuning: number

Tuning: 0 = Standard, 1 = Drop D, 2 = Open G, 3 = DADGAD, 4 = Bass, 5 = Custom, which plays Guitar.notes (default 0)

body: number

Body: 0 = Off, 1 = Dreadnought, 2 = Classical, 3 = Parlor, 4 = Jumbo, 5 = Archtop, 6 = Electric Neck, 7 = Electric Bridge, 8 = Acoustic Bass, 9 = Electric Bass (default 1)

damping: number

String damping, higher rings shorter and darker (0.0 to 1.0, default 0.33)

dampingVariation: number

Damping variation per pluck (0.0 to 1.0, default 0.5)

pluck: number

Pick brightness (0.0 to 1.0, default 0.5)

pluckVariation: number

Pick brightness variation per pluck (0.0 to 1.0, default 0.5)

tension: number

Shortens the ringing strings up to two octaves higher, every pick still sounds like the full string (0.0 to 1.0, default 0.0)

spot: number

Where the pick hits the string, from the bridge to the middle (0.0 to 1.0, default 0.2)

pick: number

What plucks the strings: 0 = Finger, 1 = Thumb, 2 = Nail, 3 = Plectrum (default 3)

spread: number

Stereo spread of the strings (0.0 to 1.0, default 0.6)

volume: number

Volume in dB (default -6)

slot: number

The slot that plays (0 to 15, default 0), a change takes over at once

chord: number

0 strums the chord track, 1 to 16 the custom shape of that number (default 0). An empty shape strums the chord track

shapes: readonly (readonly number[])[]

readonly

The 16 custom shapes, each six frets from the low E: -1 mutes a string, 0 is open, up to 24

notes: readonly number[]

readonly

The six open notes of the Custom tuning, low string first: a MIDI note from 24 to 88 or -1 for a string that is off. All off plays Standard

groove: Nullable<AnyGroove>

The groove the pattern plays through, null for none. Set a groove of the project or null.

patterns: readonly GuitarSlot[]

readonly

The 16 pattern slots, a new Guitar fills them with built in patterns

patternNames: readonly string[]

readonly

The names of the built in patterns

Methods

remove(): void

Inherited from remove

Removes the whole audio unit. Use InstrumentAudioUnit.setInstrument to swap the instrument. An instrument inside an InstrumentCompositeLayer removes that layer instead

Returns

  • void

setShape(index: number, frets: readonly number[]): void

Sets a custom shape (0 to 15) from six frets, low E first: -1 mutes a string, 0 is open, up to 24, out of range frets are clamped

Parameters

  • index (number)
  • frets (readonly number[])

Returns

  • void

setNotes(notes: readonly number[]): void

Sets the six open notes of the Custom tuning, low string first: a MIDI note from 24 to 88 or -1 for a string that is off, out of range notes are clamped

Parameters

  • notes (readonly number[])

Returns

  • void