Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)

Derive.C.Idiom.String

Contents

Description

Playing idioms of plucked or bowed strings. Generally these calls expect EnvKey.open_strings, and possibly EnvKey.string.

Synopsis

# Documentation

data Config Source #

Constructors

 Config

Post-process events to play them in a string-like idiom.

This tweaks the ends of the pitch signals of notes. When a new note is played, the next event is examined to determine if it will share a string or not.

If the string must be used for the following note, the end of the event is bent up to the next pitch before the next event is triggered. This is called the "attack". A fast attack gives the sound of a stopped string, a slow one sounds like a bent one.

If the string won't be used for a long enough time, it will be released after a delay. The release time determines how long it will take to reach its open pitch. Since the release happens after the note ends, only instruments with a bit of decay will have an audible release.

This does't do anything fancy like simulate hand position or alternate fingerings. It just selects the lowest string below or at the lowest pitch in the note.

The next note has the same string, so bend this one to prepare. If it's over a certain threshold away, release this one. TODO maybe skip release and attack if the next note is over a certain threshold away? If its > the decay time, pitch curves would be inaudible... unless of course changing the pitch itself causes a sound, as it might for a fret slide.

After releasing a note, you release your hand, which means the pitch should bend down to the open string.

Bend the event up to the next note.

If there isn't enough time, do the bend faster. TODO It might be nice to make the transition spill over into the next attack.

# gliss

This provides two kinds of glissando: absolute takes an absolute amount of time for the entire glissando, while non-absolute takes a certain amount of time per string, and hence will have a different duration depending on how many strings.