Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)

Derive.C.Prelude.Trill

Contents

Description

Various kinds of trills.

Trills want to generate an integral number of cycles. For the purpose of counting integral cycles, trills count the end (either the end of the event, or the start of the next event). This is different than other control calls, which tend to omit the end point, expecting that the next call will place a sample there. This is so that a trill can end on an off note if it exactly fits into its allotted space, otherwise a 16th note trill in a quarter note would degenerate into a mordent.

Various flavors of trills:

• Trill cycles depend on real duration of note. Cycle durations are given in real time.
• As above, but durations are given in score time.
• Number of trill cycles given as argument, and note stretches normally.
• Sung style vibrato in a sine wave rather than a square wave.
• Trill that simply adds an attribute, instrument will handle it.

The generic tr symbol can be bound to whichever variant is locally appropriate.

It's easy to think of more variants of trills: hold the starting note briefly, hold the final note briefly, inject a little randomness, smooth the pitch curve by a variable amount, or variants that cover the range between trill and vibrato, etc. One can also imagine dynamic effects.

Instead of trying to provide a million functions here or a few with a million parameters, it should be relatively easy to reuse the functions in here to write a specific kind of trill for the particular piece.

Synopsis

# Documentation

Arguments

 :: ControlUtil.CurveF -> DeriveT.Duration -> Speed.Speed -> Speed.Speed -> (ScoreTime.ScoreTime, ScoreTime.ScoreTime) -> Deriver [ScoreTime.ScoreTime] start time for each note, and one for the end of the last one

This is like tremolo_starts, but takes a start and end speed instead of a speed signal. In exchange, it can have start and end be different time types, which a signal can't express. Of course I could make the signal into duration and then do the reciprocal in the score as a val call, but that seems too complicated for tracklang.

# transitions

Create trill transition points from a speed.

Arguments

 :: Config -> ScoreTime.ScoreTime -> Maybe.Maybe Bool emit an even number of transitions, or Nothing for however many will fit -> (ScoreTime.ScoreTime, ScoreTime.ScoreTime) -> Deriver [RealTime.RealTime]

Get trill transition times, adjusted for all the various fancy parameters that trills have.

# types

data Config Source #

Constructors

 Config Fields_speed :: !DeriveT.ControlReftransition speed_start_dir :: !(Maybe.Maybe Direction) _end_dir :: !(Maybe.Maybe Direction) _hold :: !DeriveT.Durationextend the first transition by this amount_adjust :: !Adjusthow to fit the transitions into the time range_bias :: !Doubleoffset every other transition by this amount, from -1--1_include_end :: !Boolinclude a transition at the end time

#### Instances

Instances details
 Source # Instance detailsDefined in Derive.C.Prelude.Trill MethodsshowsPrec :: Int -> Config -> ShowS #showList :: [Config] -> ShowS #

data Direction Source #

Whether the trill starts or ends on the high or low note. This is another way to express AbsoluteMode.

I had a lot of debate about whether I should use High and Low, or Unison and Neighbor. Unison-Neighbor is more convenient for the implementation but High-Low I think is more musically intuitive.

Constructors

 High Low

#### Instances

Instances details
 Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods Source # Instance detailsDefined in Derive.C.Prelude.Trill MethodsenumFrom :: Direction -> [Direction] # Source # Instance detailsDefined in Derive.C.Prelude.Trill MethodsshowList :: [Direction] -> ShowS # Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods

This is the like Direction, but in terms of the unison and neighbor pitches, instead of high and low.

Constructors

 Unison Neighbor

#### Instances

Instances details
 Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods Source # Instance detailsDefined in Derive.C.Prelude.Trill MethodsshowList :: [AbsoluteMode] -> ShowS # Source # Instance detailsDefined in Derive.C.Prelude.Trill Methods

How to adjust an ornament to fulfill its Direction restrictions.

Constructors

 Shorten Adjust by shortening the ornament. Stretch Adjust by increasing the speed.

#### Instances

Instances details

Like get_trill_control, but for a curved trill.

full_notes :: Ord a => a -> [a] -> [a] Source #

Given start times, return only ones whose full duration fits before the end time. This is the tremolo analog to full_cycles. Unlike a trill, it emits both the starts and ends, and therefore the last sample will be at the end time, rather than before it. It should always emit an even number of elements.

chord_tremolo :: forall a. [ScoreTime.ScoreTime] -> [[SubT.EventT a]] -> [SubT.EventT a] Source #

Alternate each note with the other notes within its range, in order from the lowest track to the highest.

This doesn't restart the tremolo when a new note enters, if you want that you can have multiple tremolo events.

A signal that alternates between the base and neighbor values.