Liking cljdoc? Tell your friends :D

score.core


convert-measured-scoreclj

(convert-measured-score score)

Converts a measured score into a single score list. The measured-score is a single list that has the following shape:

[:meter 4 4 0 list0 list1 1 list0 2 list0 list1]

Given a meter of 4/4, process each value according the following rules:

  • If a number is found, set that as current measure number.
  • If a list is found, check if it is a single note or a list of notes. If it is a list of notes, adjust start time using with-start and beat value calculated to measure number. If it is a single note, adjust start time of the single note relative to the measure number.

For example, list0 is played at measure 0, 1, and 2, while list1 is played only in measures 0 and 2. If list1 had only one note of [instr-func 0.0 1.0], then the generated score would have:

[[instr-func 0.0 1.0] [instr-func 8.0 1.0]]

This notation allows for organizing hierarchies of materials as lists of notes. Note, notes within note lists must be in the format of:

[instr-func start-time optional-args...]

Converts a measured score into a single score list. The measured-score
is a single list that has the following shape:

[:meter 4 4 
  0 list0 list1 
  1 list0 
  2 list0 list1]

Given a meter of 4/4, process each value according the following rules:

* If a number is found, set that as current measure number. 
* If a list is found, check if it is a single note or a list of notes. 
  If it is a list of notes, adjust start time using with-start and beat
  value calculated to measure number.  If it is a single note, adjust
  start time of the single note relative to the measure number. 

For example, list0 is played at measure 0, 1, and 2,
while list1 is played only in measures 0 and 2.  If list1 had only one note
of [instr-func 0.0 1.0], then the generated score would have:

[[instr-func 0.0 1.0] [instr-func 8.0 1.0]] 

This notation allows for organizing hierarchies of materials as lists
of notes. Note, notes within note lists must be in the format of:

[instr-func start-time optional-args...]
sourceraw docstring

convert-timed-scoreclj

(convert-timed-score score)

Converts a timed score into a single score list. The timed-score is a single list that has the following shape:

[ 0 list0 list1 10 list0 20 list0 list1]

Processes each value according the following rules:

  • If a number is found, set that as current start time in beats.
  • If a list is found, check if it is a single note, a list of notes, or a sub-timed-score. If it is a list of notes, adjust start time using with-start and current start-time. If it is a single note, adjust start time of the single note relative to the start-time given. If it is a sub-timed-score, process with convert-timed-score, then adjust start time using with-start and current start-time.

For example, list0 is played at times 0, 10, and 20, while list1 is played at times 0 and 20. If list1 had only one note of [instr-func 0.0 1.0], then the generated score would have:

[[instr-func 0.0 1.0] [instr-func 20.0 1.0]]

This notation allows for organizing hierarchies of materials as lists of notes. Note, notes within note lists must be in the format of:

[instr-func start-time optional-args...]

This function will also return a score if it is not in timed-score format, which in this case is tested by checking if the passed-in score is sequential and that the first element is a number.

Converts a timed score into a single score list. The timed-score
is a single list that has the following shape:

[ 0 list0 list1 
10 list0 
20 list0 list1]

Processes each value according the following rules:

* If a number is found, set that as current start time in beats. 
* If a list is found, check if it is a single note, a list of notes, or a 
sub-timed-score.  If it is a list of notes, adjust start time using 
with-start and current start-time.  If it is a single note, adjust start time 
of the single note relative to the start-time given.  If it is a 
sub-timed-score, process with convert-timed-score, then adjust start time 
using with-start and current start-time. 

For example, list0 is played at times 0, 10, and 20,
while list1 is played at times 0 and 20.  If list1 had only one note
of [instr-func 0.0 1.0], then the generated score would have:

[[instr-func 0.0 1.0] [instr-func 20.0 1.0]] 

This notation allows for organizing hierarchies of materials as lists
of notes. Note, notes within note lists must be in the format of:

[instr-func start-time optional-args...]

This function will also return a score if it is not in timed-score format, which
in this case is tested by checking if the passed-in score is sequential and that
the first element is a number.
sourceraw docstring

format-scoclj

(format-sco notes)

Formats a list of notes into a Csound SCO string

Formats a list of notes into a Csound SCO string
sourceraw docstring

gen-notesclj

(gen-notes & fields)

Generate notes by assembling sequences together into notes. If a constant value is given, it will be wrapped with (repeat). If a no-arg function is given, it will be wrapped with (repeatedly).

Generate notes by assembling sequences together into notes. 
If a constant value is given, it will be wrapped with (repeat).
If a no-arg function is given, it will be wrapped with (repeatedly).
sourceraw docstring

gen-notes2clj

(gen-notes2 start dur & fields)

Generate notes with time-based generator functions. This score generation method is based on CMask. Given fields should be single-arg functions that generate a value based-on time argument.

Generate notes with time-based generator functions. This score generation method
is based on CMask. Given fields should be single-arg functions that generate a 
value based-on time argument.
sourceraw docstring

gen-scoreclj

(gen-score & fields)

Generates Csound score using gen-notes, then apply format-sco

Generates Csound score using gen-notes, then apply format-sco
sourceraw docstring

gen-score2clj

(gen-score2 start dur & fields)
source

get-measure-beat-lengthclj

(get-measure-beat-length meter-num meter-beats)

Gets beat length of measure given beat value and meter. I.e. for beat = 4, and meter of 4 4, returns 4 beats as the measure length.

Gets beat length of measure given beat value and meter. I.e. for
beat = 4, and meter of 4 4, returns 4 beats as the measure length.
sourceraw docstring

process-notescljmacro

(process-notes notelist & body)

Process given notelist using pairs of index and functions. For example, using:

(process-notes notes 3 db->amp 4 keyword->freq)

will process each note in notes, converting the 4th field with db->amp and 5th field with keyword->freq. Uses swapv! from pink.util.

Process given notelist using pairs of index and functions. For example,
using:

(process-notes notes 
  3 db->amp
  4 keyword->freq)

will process each note in notes, converting the 4th field with db->amp and
5th field with keyword->freq.  Uses swapv! from pink.util.
sourceraw docstring

rand-rangeclj

(rand-range low high)

Generates random value between low and high

Generates random value between low and high
sourceraw docstring

repeat-seqclj

(repeat-seq num-repeat items)
(repeat-seq num-repeat head items cur-iter)

Repeats sequence x number of times. Returns lazy-sequence.

Repeats sequence x number of times. Returns lazy-sequence.
sourceraw docstring

starting-atclj

(starting-at start sco)

Given a starting time and given score, returns a note list where all notes with starting times earlier than the given start are dropped, and all remaining notes have their times translated relative to the start time. Useful when developing works to take a score start at a time somewhere in the middle, then send that off to a running engine.

Given a starting time and given score, returns a note list where all notes with
starting times earlier than the given start are dropped, and all remaining notes
have their times translated relative to the start time.  Useful when developing 
works to take a score start at a time somewhere in the middle, then send that off
to a running engine.
sourceraw docstring

with-startclj

(with-start start sco)

Translates note vectors in time by start value. Start may either be a double value, where inde of start time in notes is assumed to be 1, or start may also be given as a 2-vector in the form [index startime].

Translates note vectors in time by start value. Start may either be a double
value, where inde of start time in notes is assumed to be 1, or start may
also be given as a 2-vector in the form [index startime].
sourceraw docstring

with-tempoclj

(with-tempo tempo notes)
(with-tempo tempo note & notes)

Adjust note start and durations according to tempo. 1.0 equals one beat at tempo.

Adjust note start and durations according to tempo. 1.0 equals one beat at 
tempo.
sourceraw docstring

wrap-generatorclj

(wrap-generator f)
source

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

× close