Skip to content

Varying signal length (and other Track sensitive things) #97

@CMorrison82z

Description

@CMorrison82z

I have an instrument used in a song here :

    song_instr (amp, cps) =
      mul (sig amp * linseg [0, 0.015, 1, 0.7, 0]) $ sfCps english_horn_sf 0 amp cps

I have melodies that use str N which define the duration of the note in that song. The issue is that the instrument
has no context about the duration of a note to be held, so I can't vary the length of the signal (I want the attack and diminish to vary with the length of the note.

The song is played via

mix_score song_instr $ loopBy 1 $ har [fmap (\x -> (0.4, x)) songChords, fmap (\x -> (0.6, x)) songMelody]

where mix_score is

mix_score instrument = mix . sco (pure . instrument) . fmap (\(a, b) -> (a, cpspch b))

I can't seem to figure out how (or what would be the "correct way) of giving the instrument context about duration of the note its going to play, in order to very the sustain-length of the signal.

I've tried something like this, but I don't understand the meaning of Sig as the duration of the Track

tmap (\e -> (eventDur e, eventContent e))

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions