cl-patterns-study/dirty-journal/2022-09-11-attempting-more-...

233 lines
7.2 KiB
Common Lisp
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; today I'd like to do bass arpegios, with high chords
;; and maybe drums for both parts (from 09-09)
;; and join them?
;; IV V iii vi
;; (setq *my-chords* (list :major :major :minor :minor)
;; *my-roots* (list 3 4 2 5))
;; (setq *my-chords* (list :major)
;; *my-roots* (list 3))
;; Am F C G (i VI III VII)
;; (setq *my-chords* (list :minor :major :major :major)
;; *my-roots* (list 0 3 2 6))
;; i - III - iv - VI
(setq *my-chords* (list :minor :major :minor :major)
*my-roots* (list 0 2 3 5))
(in-package :cl-patterns)
(start-clock-loop :tempo 90/60 :force t)
(pb :lets-slow-bass-arpegio
:dur 2
:octave 3
;; :instrument :fmbass
:embed (not-perfect-but-arpeggio *my-chords*)
:embed (attr-per-phrase :root *my-roots*)
)
;; (play :lets-slow-bass-arpegio)
;; (stop :lets-slow-bass-arpegio)
;; well, what if I rather take my simple-bass thing
;; and give it some kind of slow pattern
;; nope, that simple-bass plays whole chords
;;
;; at this point I'm just tempted to not use chords,
;; and have a PARP
(pdef :chord-defs
(pbind :chord (pseq *my-chords* 1)
:chord-base (pseq *my-roots* 1)))
(pb :lets-slow-bass-melody
(parp
(pdef :chord-defs)
(pbind :step (pseq (list 0 1 0 1 2 0 1 2) 1)
:dur (pseq (list 1/4 1/4 1 1 1 1 1 5/2) 1)
;; :note (pfunc (lambda ()
;; (event-value *event* :step)))
:note (pfunc (lambda ()
(+ (event-value *event* :chord-base)
(nth (event-value *event* :step)
(chord-notes (event-value *event* :chord))))))
)))
;; (next-upto-n (pdef :lets-slow-bass-melody) 10)
;; (play :lets-slow-bass-melody)
;; (end :lets-slow-bass-melody)
;; (stop :lets-slow-bass-melody)
(pb :embedding-bass-melogy-into-pattern
(pseq (list (pbind
:quant 4
:dur (pseq (list (prest 7/2)) 1))
(pbind
:octave 2 ; let's add these later? when join both?
:instrument :fmbass
:embed :lets-slow-bass-melody))
1))
(next-upto-n (pdef :embedding-bass-melogy-into-pattern) 20)
;; (play :embedding-bass-melogy-into-pattern)
;; (stop :embedding-bass-melogy-into-pattern)
;; (end :embedding-bass-melogy-into-pattern)
;; now. let's brainstorm the pattern on a single chord?
;; and well, my guess is that pattern should start from 1/2 before tha bar start?
;; so is there a "timer shift" for pattern?
;; if I can only align by quant
;; ( upbeat ? )
;; well 3 6 9 - and we have -1 +2 and +1 over the quant :4
;; ok, let's for not simulate that stuff by writing continuous bass melody
;; and adding 3 1/2 rest in the beginning
;; I'd like to add bottom note repeating at 1/2 ?
;;; let's just do same? quant 4, wait for the upbeat of next bar
;;; and start playing 1/2 8 times?
(pb :lets-slow-bass-melody-root-repeating
(pseq (list (pbind :dur (pseq (list (prest 4)) 1)
:quant 4)
(parp
(pdef :chord-defs)
(pbind
:octave 1
:instrument :fmbass
:dur (pseq (list (prest 5/2) (pfindur 1/2 7/2) (prest 2)) 1)
:legato 0.5
:note (pk :chord-base)))
(pbind :dur (pseq (list (prest 1)) 1)))
1))
(next-upto-n (pdef :lets-slow-bass-melody-root-repeating) 20)
;; (play :lets-slow-bass-melody-root-repeating)
;; (end :lets-slow-bass-melody-root-repeating)
;; (stop :lets-slow-bass-melody-root-repeating)
(pdef :full-bass-melody
(ppar (list :embedding-bass-melogy-into-pattern :lets-slow-bass-melody-root-repeating)))
;; (play :full-bass-melody)
;; (stop :full-bass-melody)
;; yay, not sure whether I want :octave 1 or 2, but overall, cool,
;; even though - so much still to learn to not have to do manual calculaitons of prest and such
;; let's have some kind of light chord holding. not sure what I want, maybe default
;; maybe strings? or pluck
(pb :high-chords-hold
:embed :chord-defs
:instrument :tone-buzz
:dur 8
:quant 4
:amp 0.05
:note (p+ (pk :chord-base) (pnary #'chord-notes (pk :chord))))
(next-upto-n (pdef :high-chords-hold) 30)
;; (play :high-chords-hold)
;; (end :high-chords-hold)
;; (stop :high-chords-hold)
(pb :high-chords-with-pre-bar
(pseq (list
(pbind :dur (pseq (list (prest 4)) 1)) ; most awkward thing
(pdef :high-chords-hold))
1))
(pdef :total-base-section
(ppar (list :full-bass-melody :high-chords-with-pre-bar)))
;; (play :total-base-section)
;; (stop :total-base-section)
;; well, it seems that with restarts defsynts of fmbass start playing worse?
;; responding less and less to short notes and legato?
;; is that due to not restarting sbcl?
;; let's try full restart
;;; I've done full restart, didn't totally help.
;; and I've set slower clock speed
;;; now, let's add intro, connection and ending?
(pb :intro
:embed :chord-defs
:dur (pseq (list 2 2 4) 1)
:instrument :strings
:amp 0.1
:note (p+ (first *my-roots*) (pnary #'chord-notes (first *my-chords*))))
;; (play :intro)
;; (stop :intro)
;; (end :intro)
;; idea for not now - third chord make in two octaves?
;;; maybe add a scratch inbetween?
(pb :phrase-connection
:instrument :fmbass
:dur (pseq (list (prest 2) 12 (prest 4)) 1)
:embed :chord-defs
:octave 2
:note (p+ (first *my-roots*) (pnary #'chord-notes (first *my-chords*)))
)
;; (play :phrase-connection)
;; (stop :phrase-connection)
;;; for this to work, also evaluate ~/Documents/personal/common-lisp-study/music/dirty-journal/2022-09-09-maybe-cleanup-bass-from-chords.lisp
;; maybe later on cleanup I'd put everything into same file
(pdef :is-that-first-experiment
(pseq (list (pdef :intro)
(pdef :total-base-section)
(pdef :phrase-connection)
(pdef :arpegios-and-bass))
1))
;; (play :is-that-first-experiment)
;; (stop :is-that-first-experiment)
;; (end :is-that-first-experiment)
;; welp, when notes are too quick, they are not produced
;; and I also kind of wanted a percussion line, but oh well
;; ;;; ok, let's record that,
;; ;; we can write to buffer number out_buf_num by reading in from the 0 bus
;; (in-package cl-collider)
;; (defsynth disk_writer ((out_buf_num 99))
;; (disk-out.ar out_buf_num (in.ar 0)))
;; (setf mybuffer (buffer-alloc (expt 2 17)))
;; mybuffer
;; ;; start a disk_writer synth
;; (setf writer_0 (synth 'disk_writer))
;; ;; make it output to buffer you allocated
;; (ctrl writer_0 :out_buf_num (bufnum mybuffer))
;; ;; continuously write the buffer contents to a file
;; ;; ;; IV V iii vi
;; ;; Am F C G (i VI III VII)
;; ;; i - III - iv - VI
;; (buffer-write mybuffer "/tmp/first-experiment-i-III-iv-VI.aiff" :leave-open-p t)
;; ;; now play whatever sounds you like
;; ;; e.g.
;; (in-package :cl-patterns)
;; (play :is-that-first-experiment)
;; (stop :is-that-first-experiment)
;; (end :is-that-first-experiment)
;; ;; then when you are done
;; (in-package cl-collider)
;; ;; stop the disk_writer synth
;; (free writer_0)
;; ;; close and free the buffer
;; (buffer-close mybuffer)
;; (buffer-free mybuffer)
;; ;; then you can play what you recorded with a utility like mpv:
;; ;; mpv /tmp/foo.aiff