csound-expression-3.1.0: library to make electronic music

Safe HaskellNone

Csound.Control.Gui.Widget

Contents

Description

Primitive GUI elements.

There is a convention that constructors take only parameters that specify the logic of the widget. The view is set for GUI-elements with other functions.

Synopsis

Common properties

data ValDiap

The diapason of the continuous value.

Constructors

ValDiap 

data ValScaleType

Constructors

Linear 
Exponential 

data ValSpan

A value span is a diapason of the value and a type of the scale (can be linear or exponential).

linSpan :: Double -> Double -> ValSpan

Makes a linear ValSpan with specified boundaries.

 linSpan minVal maxVal

expSpan :: Double -> Double -> ValSpan

Makes an exponential ValSpan with specified boundaries.

 expSpan minVal maxVal

uspan :: ValSpan

Unit span. A special case:

 uspan = linSpan 0 1

bspan :: ValSpan

Bipolar unit span. A special case:

 uspan = linSpan (-1) 1

uspanExp :: ValSpan

An exponential unit span. A special case:

 uspan = expSpan 0 1

Valuators

count :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source (Evt D)

Allows the user to increase/decrease a value with mouse clicks on a corresponding arrow button. Output is an event stream that contains values when counter changes.

 count diapason fineValStep maybeCoarseValStep initValue 

doc: http:www.csounds.commanualhtml/FLcount.html

countSig :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source Sig

A variance on the function count, but it produces a signal of piecewise constant function.

joy :: ValSpan -> ValSpan -> (Double, Double) -> Source (Sig, Sig)

It is a squared area that allows the user to modify two output values at the same time. It acts like a joystick.

 joy valueSpanX valueSpanY (initX, initY) 

doc: http://www.csounds.com/manual/html/FLjoy.html

knob :: String -> ValSpan -> Double -> Source Sig

A FLTK widget opcode that creates a knob.

 knob valueSpan initValue

doc: http://www.csounds.com/manual/html/FLknob.html

data KnobType

Constructors

ThreeD (Maybe Int) 
Pie 
Clock 
Flat 

Instances

roller :: String -> ValSpan -> ValStep -> Double -> Source Sig

FLroller is a sort of knob, but put transversally.

 roller valueSpan step initVal

doc: http://www.csounds.com/manual/html/FLroller.html

slider :: String -> ValSpan -> Double -> Source Sig

FLslider puts a slider into the corresponding container.

 slider valueSpan initVal 

doc: http://www.csounds.com/manual/html/FLslider.html

sliderBank :: String -> [Double] -> Source [Sig]

Constructs a list of linear unit sliders (ranges in [0, 1]). It takes a list of init values.

data SliderType

Constructors

Fill 
Engraved 
Nice 

Instances

numeric :: String -> ValDiap -> ValStep -> Double -> Source Sig

numeric (originally FLtext in the Csound) allows the user to modify a parameter value by directly typing it into a text field.

 numeric diapason step initValue 

doc: http://www.csounds.com/manual/html/FLtext.html

data TextType

Constructors

NormalText 
NoDrag 
NoEdit 

Instances

Other widgets

box :: String -> Display

A FLTK widget that displays text inside of a box. If the text is longer than 255 characters the text is split on several parts (Csound limitations).

 box text

doc: http://www.csounds.com/manual/html/FLbox.html

button :: String -> Source (Evt Unit)

A FLTK widget opcode that creates a button.

 button text

doc: http://www.csounds.com/manual/html/FLbutton.html

data ButtonType

The type of the button. It affects toggle buttons and button banks.

In Csound buttons and toggle buttons are constructed with the same function (but with different button types). But in this library they are contructed by different functions (button and toggle). Normal button is a plain old button, but other values specify toggle buttons. So this property doesn't affect the buttons (since they could be only normal buttons).

Instances

toggle :: String -> Source (Evt D)

A FLTK widget opcode that creates a toggle button.

 button text

doc: http://www.csounds.com/manual/html/FLbutton.html

butBank :: String -> Int -> Int -> (Int, Int) -> Source (Evt (D, D))

A FLTK widget opcode that creates a bank of buttons. Result is (x, y) coordinate of the triggered button.

 butBank xNumOfButtons yNumOfButtons

doc: http://www.csounds.com/manual/html/FLbutBank.html

toggleSig :: String -> Source Sig

A variance on the function toggle, but it produces a signal of piecewise constant function.

butBankSig :: String -> Int -> Int -> (Int, Int) -> Source (Sig, Sig)

A variance on the function butBank, but it produces a signal of piecewise constant function. Result is (x, y) coordinate of the triggered button.

butBank1 :: String -> Int -> Int -> (Int, Int) -> Source (Evt D)

A FLTK widget opcode that creates a bank of buttons.

 butBank xNumOfButtons yNumOfButtons

doc: http://www.csounds.com/manual/html/FLbutBank.html

radioButton :: Arg a => String -> [(String, a)] -> Int -> Source (Evt a)Source

A radio button. It takes a list of values with labels.

matrixButton :: Arg a => String -> Int -> Int -> [a] -> (Int, Int) -> Source (Evt a)Source

A matrix of values.

funnyRadio :: Tuple b => String -> [(String, a -> b)] -> Int -> Source (a -> b)Source

Radio button that returns functions. Useful for picking a waveform or type of filter.

funnyMatrix :: Tuple b => String -> Int -> Int -> [a -> b] -> (Int, Int) -> Source (a -> b)Source

Matrix of functional values.

value :: String -> Double -> Sink Sig

FLvalue shows current the value of a valuator in a text field.

 value initVal

doc: http://www.csounds.com/manual/html/FLvalue.html

meter :: String -> ValSpan -> Double -> Sink Sig

A slider that serves as indicator. It consumes values instead of producing.

 meter valueSpan initValue

Transformers

setTitle :: String -> Gui -> SE Gui

Appends a title to a group of widgets.

Keyboard

data KeyEvt

Keyboard events.

Constructors

Press Key 
Release Key 

Instances

keyIn :: KeyEvt -> Evt Unit

The stream of keyboard press/release events.

charOn :: Char -> Evt UnitSource

Shortcut for press CharKey events.

charOff :: Char -> Evt UnitSource

Shortcut for release CharKey events.