csound-expression-4.9.1: library to make electronic music

Safe HaskellNone



A multitap looper.



data LoopSpec Source

The type for fine tuning of the looper. Let's review the values:

  • loopMixVal - list of initial values for mix levels (default is 0.5 for all taps)
  • loopPrefx - list of pre-loop effects (the default is do-nothing effect)
  • loopPostfx - list of post-loop effects (the default is do-nothing effect)
  • loopPrefxVal - list of dry/wet values for pre-looop effects (the default is 0.5 for all taps)
  • loopPostfxVal - list of dry/wet values for post-looop effects (the default is 0.5 for all taps)
  • loopInitInstr - the initial sounding tap (sound source) (what tap we are going to record when the looper starts up).
  • loopFades - the list of instrument groups to fade/out. Eachl list item is a list of integers where an integer points to a tap number. By default a single fader is given to each tap. with lists of integers we can group the sound sources by their functions in the song. We may group all harmonic instruments in a single group and all drums into another group.
  • loopReeatFades -- a repeat fade weight is a value that represents an amount of repetition. A looping tap is implemented as a delay tap with big feedback. The repeat fades equals to the feedback amount. It have to be not bigger than 1. If the value equals to 1 than the loop is repeated forever. If it's lower than 1 the loop is gradually going to fade.
  • loopControl -- specifies an external controllers for the looper. See the docs for the type LoopSpec.

data LoopControl Source

External controllers. We can control the looper with UI-widgets but sometimes it's convenient to control the loper with some external midi-device. This structure mocks all controls (except knobs for effects and mix).

  • loopTap - selects the current tap. It's a stream of integers (from 0 to a given integer).
  • loopFade - can fade in or fade out a group of taps. It's a list of toggle-like event streams. they produce 1s for on and 0s for off.
  • loopDel - is for deleting the content of a given tap. It's just a click of the button. So the value should be an event stream of units (which is Tick = Evt Unit).
  • loopThrough - is an event stream of toggles.

All values are wrapped in the Maybe type. If the value is Nothing in the given cell the looper is controled only with virtual widgets.

There is an instance of Default for LoopControl with all values set to Nothing. It's useful when we want to control only a part of parameters externally. We can use the value def to set the rest parameters:

def { loopTap = Just someEvt }



sigLoop :: LoopSpec -> D -> [D] -> [Sig2] -> Source Sig2 Source

Simple multitap Looper. We can create as many taps as we like also we can create fade outs/ins insert effects and control mix.

sigLoop spec bpm times imputs 


  • looper spec (see the docs for the type)
  • main bpm rate. All taps are aligned with the main rate
  • list of multipliers for each tap. Each tap is going to have a fixed length that is a multiplier of the main rate. It doesn't have to be an integer. So we can create weird drum patterns with odd loop durations.
  • list of signal sources. By convention all sources are stereo signals. We can use the function fromMono to convert the mono signal to stereo.

midiLoop :: LoopSpec -> D -> [D] -> [Msg -> SE Sig2] -> Source Sig2 Source

The sigLoop that is adapted for usage with midi instruments. It takes a list of midi instruments in place of signal inputs. The rest is the same

sfLoop :: LoopSpec -> D -> [D] -> [(Sf, D)] -> Source Sig2 Source

The midiLoop that is adapted for usage with soundfonts. It takes in a list of pairs of sound fonts as sound sources. The second value in the pair is the release time for the given sound font.

patchLoop :: LoopSpec -> D -> [D] -> [Patch2] -> Source Sig2 Source

Some instruments not work well with the looper. Alwo be aware of limitation of software resources.