Learn R Programming

gm (version 2.0.0)

Velocity: Create Velocity Object

Description

Create a Velocity object to set some notes' velocities.

Usage

Velocity(velocity, to = NULL, i = NULL, j = NULL)

Value

A list of class Velocity.

Arguments

velocity

A single integer between 0 and 127, which indicates the velocity to apply.

to

Optional. A single character or a single positive integer, which indicates the musical line where to apply the velocity. If not provided, the velocity will be applied to all notes.

i

Optional. A single positive integer, which represents the position of the velocity in a musical line.

j

Optional. A single positive integer, which represents the position of the velocity in a chord.

See Also

  • +.Music() for adding a Velocity to a Music object

  • Dynamic() for adding dynamic markings

Examples

Run this code
# Create a `Velocity`
velocity <- Velocity(10)
velocity

# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "D4")) + velocity
music

# Generate the music score
if (interactive()) {
  show(music)
}

Run the code above in your browser using DataLab