previous up next
Programs, events, event scheduler, and event queue



(program proc)

Wraps the procedure proc in a new program object. Returns the new program object.



(eval-program)

Returns a new evaluation program.



(new-event t prog args)

Returns a new event object with evaluation time t, program prog, and arguments args. The args should be an object array (see list->array).



(scheduler)

Returns a new scheduler object. A scheduler is a synthesis process and can be added to the synthesizer.



(scheduler-print sched)

Prints out the current schedule of the scheduler.



(scheduler-schedule sched evt)

Schedules the event evt in the scheduler sched.



(scheduler-erase sched)

Erases all events of the scheduler sched.



(global-scheduler)

Returns the global scheduler. This scheduler is created systematically at the startup of the environment.



(schedule e)

Schedules the event e in the global scheduler. This is short for (scheduler-schedule (global-scheduler) e)



(erase-schedule)

Erases all events of the global scheduler. This is short for (scheduler-erase (global-scheduler))



(event-queue size)

Creates a new event queue with size entries.



(event-queue-post q e)

Posts the event e to the event queue q. If the event queue is filled, the event is not inserted. The procedure returns a boolean indicating whether the event is posted or not.



(event-queue-get q)

Returns the next event in the event queue q. When no events are available the calling thread blocks until an event is posted.



(global-event-queue)

Returns a reference to the global event queue. This event queue is created at startup time. Events posted to this queue will be handled by the environment's default event thread.



(post e)

Posts the event e to the global event queue. This is short for (event-queue-post (global-event-queue) e))



(event t proc a1 a2 ...)

The event procedure creates and schedules a new event with time t. The proc argument should be a Scheme procedure and is implicitly wrapped into a Varèse program. The arguments a1, a2, ... are stored in an object array. The newly created event object is then scheduled in the global scheduler. The procedure is a short notation for (post (new-event t (program proc) (array a1 ...)))

previous up next