Liking cljdoc? Tell your friends :D

alda.parser


aggregate-eventsclj

(aggregate-events events-ch)

Asynchronously reads events from a channel and aggregates certain types of events that need to be aggregated, e.g. notes in a chord.

Returns a channel on which the final events can be read.

If there is an error, the error is included in the stream.

Asynchronously reads events from a channel and aggregates certain types of events that need to be aggregated, e.g. notes in a chord.

Returns a channel on which the final events can be read.

If there is an error, the error is included in the stream.
sourceraw docstring

build-scoreclj

(build-score events-ch2)

Asynchronously reads events from a channel and applies them sequentially to a new score.

Returns a channel from which the complete score can be taken.

If there was an error in the a previous part of the pipeline, it is thrown here.

Asynchronously reads events from a channel and applies them sequentially to a
new score.

Returns a channel from which the complete score can be taken.

If there was an error in the a previous part of the pipeline, it is thrown
here.
sourceraw docstring

parse-eventsclj

(parse-events tokens-ch)

Asynchronously reads tokens from a channel, parsing events and streaming them into a new channel.

Returns a channel from which events can be read as they are parsed.

If there is an error, the error is included in the stream.

Asynchronously reads tokens from a channel, parsing events and streaming
them into a new channel.

Returns a channel from which events can be read as they are parsed.

If there is an error, the error is included in the stream.
sourceraw docstring

parse-inputclj

(parse-input input & {:keys [output] :or {output :score}})

Given a string of Alda code, process it via the following asynchronous pipeline:

  • Tokenize it into a stream of recognized tokens.
  • From the token stream, parse out a stream of events.
  • Process the events sequentially to build a score.

If an :output key is supplied, the result will depend on the value of that key:

:score => an Alda score map, ready to be performed by the sound engine. If there is an error, the error is thrown.

:events => a lazy sequence of Alda events, which will produce a complete score when applied sequentially to a new score. Note that the sequence may contain an error object if there is any error parsing, and the error is not thrown. If it is desirable to throw an error, use :events-or-error.

:events-or-error => equivalent to :events, but the sequence is fully realized and an error is thrown in the event of a parse error.

The default :output is :score.

Given a string of Alda code, process it via the following asynchronous
pipeline:

- Tokenize it into a stream of recognized tokens.
- From the token stream, parse out a stream of events.
- Process the events sequentially to build a score.

If an :output key is supplied, the result will depend on the value of that
key:

:score => an Alda score map, ready to be performed by the sound engine. If
there is an error, the error is thrown.

:events => a lazy sequence of Alda events, which will produce a complete
score when applied sequentially to a new score. Note that the sequence may
contain an error object if there is any error parsing, and the error is not
thrown. If it is desirable to throw an error, use :events-or-error.

:events-or-error => equivalent to :events, but the sequence is fully realized
and an error is thrown in the event of a parse error.

The default :output is :score.
sourceraw docstring

(print-stream channel)

Continuously reads from a channel and prints what is received, stopping once the channel is closed.

Continuously reads from a channel and prints what is received, stopping once
the channel is closed.
sourceraw docstring

stream-seqclj

(stream-seq ch)

Coerces a channel into a lazy sequence that can be lazily consumed or realized at will.

Coerces a channel into a lazy sequence that can be lazily consumed or
realized at will.
sourceraw docstring

tokenizeclj

(tokenize input)

Asynchronously reads and tokenizes input, streaming the result into a channel.

Returns a channel from which tokens can be read as they are parsed.

Asynchronously reads and tokenizes input, streaming the result into a
channel.

Returns a channel from which tokens can be read as they are parsed.
sourceraw docstring

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

× close