Create an Instrument
object to represent an instrument.
Instrument(instrument, to = NULL, volume = NULL, pan = NULL)
A single integer between 1
and 128
, which indicates
the program number
of the instrument. See the Details section for all instruments.
Optional. A single character or a single positive integer, which indicates the musical line where to add the instrument.
Optional. A single integer between 0
and 100
, which
represents the volume of the instrument. The default value is 80
.
Please note that volume
and pan
only work in MuseScore 3.
Optional. A single integer between -90
and 90
, which
represents the panning of the instrument. The default value is 0
.
A list of class Instrument
.
Supported instruments:
Acoustic Grand Piano
Bright Acoustic Piano
Electric Grand Piano
Honky-Tonk Piano
Electric Piano 1
Electric Piano 2
Harpsichord
Clavinet
Celesta
Glockenspiel
Music Box
Vibraphone
Marimba
Xylophone
Tubular Bells
Dulcimer
Drawbar Organ
Percussive Organ
Rock Organ
Church Organ
Reed Organ
Accordion
Harmonica
Tango Accordion
Acoustic Guitar (Nylon)
Acoustic Guitar (Steel)
Electric Guitar (Jazz)
Electric Guitar (Clean)
Electric Guitar (Muted)
Overdriven Guitar
Distortion Guitar
Guitar Harmonics
Acoustic Bass
Electric Bass (Finger)
Electric Bass (Pick)
Fretless Bass
Slap Bass 1
Slap Bass 2
Synth Bass 1
Synth Bass 2
Violin
Viola
Cello
Contrabass
Tremolo Strings
Pizzicato Strings
Orchestral Harp
Timpani
String Ensemble 1
String Ensemble 2
Synth Strings 1
Synth Strings 2
Choir Aahs
Voice Oohs
Synth Voice
Orchestra Hit
Trumpet
Trombone
Tuba
Muted Trumpet
French Horn
Brass Section
Synth Brass 1
Synth Brass 2
Soprano Sax
Alto Sax
Tenor Sax
Baritone Sax
Oboe
English Horn
Bassoon
Clarinet
Piccolo
Flute
Recorder
Pan Flute
Blown Bottle
Shakuhachi
Whistle
Ocarina
Lead 1 (Square)
Lead 2 (Sawtooth)
Lead 3 (Calliope)
Lead 4 (Chiff)
Lead 5 (Charang)
Lead 6 (Voice)
Lead 7 (Fifths)
Lead 8 (Bass + Lead)
Pad 1 (New Age)
Pad 2 (Warm)
Pad 3 (Polysynth)
Pad 4 (Choir)
Pad 5 (Bowed)
Pad 6 (Metallic)
Pad 7 (Halo)
Pad 8 (Sweep)
FX 1 (Rain)
FX 2 (Soundtrack)
FX 3 (Crystal)
FX 4 (Atmosphere)
FX 5 (Brightness)
FX 6 (Goblins)
FX 7 (Echoes)
FX 8 (Sci-Fi)
Sitar
Banjo
Shamisen
Koto
Kalimba
Bag Pipe
Fiddle
Shanai
Tinkle Bell
Agogo
Steel Drums
Woodblock
Taiko Drum
Melodic Tom
Synth Drum
Reverse Cymbal
Guitar Fret Noise
Breath Noise
Seashore
Bird Tweet
Telephone Ring
Helicopter
Applause
Gunshot
+.Music()
for adding an instrument to a Music
object.
# Create a flute
flute <- Instrument(74, pan = -90)
flute
#> Flute
#>
#> * of pan -90
# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C5", "D5", "E5", "F5")) + flute
music
#> Music
#>
#> $meters
#> # A tibble: 1 × 6
#> bar number unit actual_number actual_unit invisible
#> <int> <int> <int> <int> <int> <lgl>
#> 1 1 4 4 4 4 FALSE
#>
#> $notes
#> # A tibble: 4 × 7
#> line i j pitch midi duration length
#> <int> <int> <int> <chr> <int> <chr> <dbl>
#> 1 1 1 NA C5 72 NA 1
#> 2 1 2 NA D5 74 NA 1
#> 3 1 3 NA E5 76 NA 1
#> 4 1 4 NA F5 77 NA 1
#>
#> $lines
#> # A tibble: 1 × 7
#> part staff voice segment bar offset name
#> <int> <int> <int> <int> <int> <dbl> <chr>
#> 1 1 1 1 1 1 0 NA
#>
#> $instruments
#> # A tibble: 1 × 5
#> line midi name volume pan
#> <int> <int> <chr> <dbl> <dbl>
#> 1 1 74 Flute 80 -90
#>
# Generate the music score
if (interactive()) {
show(music)
}