Liking cljdoc? Tell your friends :D

chronoid.core


*clocks*cljs

source

audio-contextcljs

An atomic reference to a global audio context that gets created the first time you call clock and is reused for any subsequent clocks.

An atomic reference to a global audio context that gets created the first
time you call `clock` and is reused for any subsequent clocks.
sourceraw docstring

callback-at-time!cljs

(callback-at-time! clock-atom f deadline & {:as opts})

Schedules f to run before deadline. Returns the event.

opts may contain :tolerance-early and :tolerance-late for optionally overriding the clock's timing window for events.

Schedules `f` to run before `deadline`. Returns the event.

`opts` may contain :tolerance-early and :tolerance-late for optionally
overriding the clock's timing window for events.
sourceraw docstring

clear!cljs

(clear! {:keys [clock-id] :as event})

Unschedules an event by removing it from its clock's event queue.

Unschedules an event by removing it from its clock's event queue.
sourceraw docstring

clockcljs

(clock & {:as attrs})
source

current-timecljs

(current-time {:keys [context]})

Returns the current time of a clock's audio context, in milliseconds.

Returns the current time of a clock's audio context, in milliseconds.
sourceraw docstring

default-optionscljs

source

new-audio-contextcljs

(new-audio-context)
source

repeat!cljs

(repeat! {:keys [deadline] :as event} time)

Sets the event to repeat every time milliseconds

Sets the event to repeat every `time` milliseconds 
sourceraw docstring

set-timeout!cljs

(set-timeout! clock-atom f delay-ms & {:as opts})

Schedules f after delay-ms milliseconds. Returns the event.

opts may contain :tolerance-early and :tolerance-late for optionally overriding the clock's timing window for events.

Schedules `f` after `delay-ms` milliseconds. Returns the event.

`opts` may contain :tolerance-early and :tolerance-late for optionally
overriding the clock's timing window for events.
sourceraw docstring

start!cljs

(start! clock-atom)

Remove all scheduled events and start the clock.

Remove all scheduled events and start the clock.
sourceraw docstring

stop!cljs

(stop! clock-atom)

Stops the clock.

Stops the clock.
sourceraw docstring

time-stretch!cljs

(time-stretch! e ratio)
(time-stretch! e time-reference ratio)

Reschedules events according to a time-reference and a ratio. If the event is a repeating event, adjusts its repeat-time accordingly.

The first argument can be either a single event or a list of events. Returns the rescheduled event, or a list of rescheduled events, depending on the input type.

e.g. (time-stretch! e (current-time clock) 0.5) ^-- makes an event e occur twice as soon as it would otherwise

If time-reference is omitted, the default value is the current time of the event's clock.

Reschedules events according to a `time-reference` and a `ratio`.
If the event is a repeating event, adjusts its repeat-time accordingly.

The first argument can be either a single event or a list of events.
Returns the rescheduled event, or a list of rescheduled events, depending
on the input type.

e.g.
(time-stretch! e (current-time clock) 0.5)
^-- makes an event `e` occur twice as soon as it would otherwise

If `time-reference` is omitted, the default value is the current time of the
event's clock.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close