Created
November 14, 2016 13:18
-
-
Save daveyarwood/a8ae948ab9b9187f7722868724676913 to your computer and use it in GitHub Desktop.
alda voice continuation example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ alda repl | |
Nov 14, 2016 8:12:00 AM com.jsyn.engine.SynthesisEngine start | |
INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.7.3 (build 457, 2014-12-25) | |
Preparing MIDI system... done. | |
█████╗ ██╗ ██████╗ █████╗ | |
██╔══██╗██║ ██╔══██╗██╔══██╗ | |
███████║██║ ██║ ██║███████║ | |
██╔══██║██║ ██║ ██║██╔══██║ | |
██║ ██║███████╗██████╔╝██║ ██║ | |
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═╝ ╚═╝ | |
v1.0.0-rc49 | |
repl session | |
Type :help for a list of available commands. | |
> piano: V1: c d e | |
p> V2: e f g | |
p> :play | |
p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ boot repl -n alda.lisp | |
nREPL server started on port 64122 on host 127.0.0.1 - nrepl://127.0.0.1:64122 | |
REPL-y 0.3.7, nREPL 0.2.12 | |
Clojure 1.8.0 | |
Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17 | |
Exit: Control+D or (exit) or (quit) | |
Commands: (user/help) | |
Docs: (doc function-name-here) | |
(find-doc "part-of-name-here") | |
Find by Name: (find-name "part-of-name-here") | |
Source: (source function-name-here) | |
Javadoc: (javadoc java-object-or-class-here) | |
Examples from clojuredocs.org: [clojuredocs or cdoc] | |
(user/clojuredocs name-here) | |
(user/clojuredocs "ns-here" "name-here") | |
alda.lisp=> (def s (atom (score))) | |
#'alda.lisp/s | |
alda.lisp=> (continue! s (part "piano")) | |
{:chord-mode false, :current-instruments #{"piano-TKiRk"}, :events #{}, :beats-tally nil, :instruments {"piano-TKiRk" {:octave 4, :current-offset #alda.lisp.model.records.AbsoluteOffset{:offset 0}, :key-signature {}, :config {:type :midi, :patch 1}, :duration 1, :volume 1.0, :last-offset #alda.lisp.model.records.AbsoluteOffset{:offset -1}, :id "piano-TKiRk", :quantization 0.9, :tempo 120, :panning 0.5, :current-marker :start, :time-scaling 1, :stock "midi-acoustic-grand-piano", :track-volume 0.7874015748031497}}, :markers {:start 0}, :cram-level 0, :global-attributes {}, :nicknames {}, :beats-tally-default nil} | |
alda.lisp=> (continue! s (voices (voice 1 (note (pitch :c)) (note (pitch :d)) (note (pitch :e))))) | |
{:chord-mode false, :current-instruments #{"piano-TKiRk"}, :voice-instruments {1 {"piano-TKiRk" {:octave 4, :current-offset #alda.lisp.model.records.AbsoluteOffset{:offset 1500.0}, :key-signature {}, :config {:type :midi, :patch 1}, :duration 1, :min-duration nil, :volume 1.0, :last-offset #alda.lisp.model.records.AbsoluteOffset{:offset 1000.0}, :id "piano-TKiRk", :quantization 0.9, :duration-inside-cram nil, :tempo 120, :panning 0.5, :current-marker :start, :time-scaling 1, :stock "midi-acoustic-grand-piano", :track-volume 0.7874015748031497}}}, :events #{#alda.lisp.model.records.Note{:offset 1000.0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 64, :pitch 329.6275569128699, :duration 450.0, :voice 1} #alda.lisp.model.records.Note{:offset 0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 60, :pitch 261.6255653005986, :duration 450.0, :voice 1} #alda.lisp.model.records.Note{:offset 500.0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 62, :pitch 293.6647679174076, :duration 450.0, :voice 1}}, :beats-tally nil, :instruments {"piano-TKiRk" {:octave 4, :current-offset #alda.lisp.model.records.AbsoluteOffset{:offset 0}, :key-signature {}, :config {:type :midi, :patch 1}, :duration 1, :volume 1.0, :last-offset #alda.lisp.model.records.AbsoluteOffset{:offset -1}, :id "piano-TKiRk", :quantization 0.9, :tempo 120, :panning 0.5, :current-marker :start, :time-scaling 1, :stock "midi-acoustic-grand-piano", :track-volume 0.7874015748031497}}, :markers {:start 0}, :cram-level 0, :global-attributes {}, :current-voice 1, :nicknames {}, :beats-tally-default nil} | |
alda.lisp=> (continue! s (voice 2 (note (pitch :e)) (note (pitch :f)) (note (pitch :g)))) | |
{:chord-mode false, :current-instruments #{"piano-TKiRk"}, :voice-instruments {1 {"piano-TKiRk" {:octave 4, :current-offset #alda.lisp.model.records.AbsoluteOffset{:offset 1500.0}, :key-signature {}, :config {:type :midi, :patch 1}, :duration 1, :min-duration nil, :volume 1.0, :last-offset #alda.lisp.model.records.AbsoluteOffset{:offset 1000.0}, :id "piano-TKiRk", :quantization 0.9, :duration-inside-cram nil, :tempo 120, :panning 0.5, :current-marker :start, :time-scaling 1, :stock "midi-acoustic-grand-piano", :track-volume 0.7874015748031497}}, 2 {"piano-TKiRk" {:octave 4, :current-offset #alda.lisp.model.records.AbsoluteOffset{:offset 1500.0}, :key-signature {}, :config {:type :midi, :patch 1}, :duration 1, :min-duration nil, :volume 1.0, :last-offset #alda.lisp.model.records.AbsoluteOffset{:offset 1000.0}, :id "piano-TKiRk", :quantization 0.9, :duration-inside-cram nil, :tempo 120, :panning 0.5, :current-marker :start, :time-scaling 1, :stock "midi-acoustic-grand-piano", :track-volume 0.7874015748031497}}}, :events #{#alda.lisp.model.records.Note{:offset 1000.0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 64, :pitch 329.6275569128699, :duration 450.0, :voice 1} #alda.lisp.model.records.Note{:offset 0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 60, :pitch 261.6255653005986, :duration 450.0, :voice 1} #alda.lisp.model.records.Note{:offset 1000.0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 67, :pitch 391.99543598174927, :duration 450.0, :voice 2} #alda.lisp.model.records.Note{:offset 500.0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 62, :pitch 293.6647679174076, :duration 450.0, :voice 1} #alda.lisp.model.records.Note{:offset 0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 64, :pitch 329.6275569128699, :duration 450.0, :voice 2} #alda.lisp.model.records.Note{:offset 500.0, :instrument "piano-TKiRk", :volume 1.0, :track-volume 0.7874015748031497, :panning 0.5, :midi-note 65, :pitch 349.2282314330039, :duration 450.0, :voice 2}}, :beats-tally nil, :instruments {"piano-TKiRk" {:octave 4, :current-offset #alda.lisp.model.records.AbsoluteOffset{:offset 0}, :key-signature {}, :config {:type :midi, :patch 1}, :duration 1, :volume 1.0, :last-offset #alda.lisp.model.records.AbsoluteOffset{:offset -1}, :id "piano-TKiRk", :quantization 0.9, :tempo 120, :panning 0.5, :current-marker :start, :time-scaling 1, :stock "midi-acoustic-grand-piano", :track-volume 0.7874015748031497}}, :markers {:start 0}, :cram-level 0, :global-attributes {}, :current-voice 2, :nicknames {}, :beats-tally-default nil} | |
alda.lisp=> (clojure.pprint/pprint (:events *1)) | |
#{{:offset 1000.0, | |
:instrument "piano-TKiRk", | |
:volume 1.0, | |
:track-volume 0.7874015748031497, | |
:panning 0.5, | |
:midi-note 64, | |
:pitch 329.6275569128699, | |
:duration 450.0, | |
:voice 1} | |
{:offset 0, | |
:instrument "piano-TKiRk", | |
:volume 1.0, | |
:track-volume 0.7874015748031497, | |
:panning 0.5, | |
:midi-note 60, | |
:pitch 261.6255653005986, | |
:duration 450.0, | |
:voice 1} | |
{:offset 1000.0, | |
:instrument "piano-TKiRk", | |
:volume 1.0, | |
:track-volume 0.7874015748031497, | |
:panning 0.5, | |
:midi-note 67, | |
:pitch 391.99543598174927, | |
:duration 450.0, | |
:voice 2} | |
{:offset 500.0, | |
:instrument "piano-TKiRk", | |
:volume 1.0, | |
:track-volume 0.7874015748031497, | |
:panning 0.5, | |
:midi-note 62, | |
:pitch 293.6647679174076, | |
:duration 450.0, | |
:voice 1} | |
{:offset 0, | |
:instrument "piano-TKiRk", | |
:volume 1.0, | |
:track-volume 0.7874015748031497, | |
:panning 0.5, | |
:midi-note 64, | |
:pitch 329.6275569128699, | |
:duration 450.0, | |
:voice 2} | |
{:offset 500.0, | |
:instrument "piano-TKiRk", | |
:volume 1.0, | |
:track-volume 0.7874015748031497, | |
:panning 0.5, | |
:midi-note 65, | |
:pitch 349.2282314330039, | |
:duration 450.0, | |
:voice 2}} | |
nil | |
alda.lisp=> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notice that the events have the correct offsets -- two notes at offset 0, two at 500, and two at 1000.