Multimedia programs in Fran

Simon Thompson, Helen Cameron and Peter King


Actor examples

Prompted by Morris' questions after Helen Cameron's presentation at EP'98. The general scenario is as follows. Actor is on stage. At the end of line 105 the phone starts to ring; he picks it up, and says line 106 (a reply to the call, presumably). In the course of implementing various versions of this, functions of more general applicability are developed. These are discussed in the commentary on the files.

actor1.hs On starting the display nothing happens; clicking the left button make the phone ring exactly five times; actor picks up phone at that point and continues. The main functionality developed are functions to make events happen at particular time points. The start time can be the start of the display, or can be given by the first occurrence of an event (such as left button press).

actor2.hs The actor picking up the phone is here an action (rbp), and so ringing can go on indefinitely. This is done by a function to give a regular event (alarmE) but indexed from the occurrence of an event (here lbp).

actor3.hs The full actor scenario. Curtains open at the start, and close at the end. Start of phone ring (lbp), phone lift up (rbp) and line106 (any key) are all separate events. The performance is ended after the phone lifted up and line 106 begun.

General functions developed include: - intersection of Events: intersectE e1 e2, whose first occurrence happens only at the point by which the first occurrences of e1 and e2 have taken place; - unique occurrence events: uniqueE e happens the first time e happens.

test1.hs Preliminary work on the actor problem. How to make events which happen at a given time, and to modify colours.

Example inspired by Beethoven problem.

The viewer examples were also so inspired, but took on a life of their own.

Crescendo.hs Recognising an increasing tendency in a RealB, by testing sequences of samples to find increasing subsequences of particular lengths. A crescendo has started when the last five samples form an increasing sequence (and the last six don't). It is stopped by a decrease. An exercise in scanlE, accumB, suchThat and stepper.

Visualizing real behaviours.

TestBehavior.hs Contains the User -> RealB tester which is a composite of sawtooth, linear and wiggle functions.

Monitor.hs Display a dynamic histogram of the last two seconds' behaviour of the RealB. Given one evolving bar, namely showLine, it is a nice exercise in moveXY and later, which move and delay the displays.

TextMonitor.hs Showing the values of a RealB by means of a changing, sampled, real. Also overlays this on the histogram from Monitor. Could have used showBIm :: Show a => Behavior a -> ImageB but when used this samples at too fast a rate to be useful.

RealBPlayer.hs Controls the display of the dynamic histogram. Allows pause, rewind and fast forward. The general functionality is given by functions which can do these operations (pause etc.) on a GBehavior of any type, so that in particular one can pause the function being displayed or its display. The interface here is via pause: lbp; ff: rbp; rew: any key.

PlayerButton1.hs PlayerButton2.hs Add a simple button interface to the RealBPlayer. Three active areas on the display for the three functions -- lbp in each generates the appropriate Event. They use different variants of the Button machinery given by Button.lhs.

Button.lhs Button stuff which is part of the LiftSim example.


© Simon Thompson, 1999.

Last modified 12 February 1999.