Skip to content

Commit

Permalink
Changed to a better name for creating midi connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Feb 21, 2021
1 parent 2b24100 commit 0b43469
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/xt/midi.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
(init 0)
(list-devices 0)
(stop 1)
(set-out-stream! 2)))
(create-out-stream 2)))

(include-lib "logjam/include/logjam.hrl")

(defun init ()
(xt.msg:async
Expand Down Expand Up @@ -44,7 +46,7 @@
(xt.lang:->xt 'dur)))
(xt.lang:->xt 'true)))))

(defun set-out-stream! (device-name device-id)
(defun create-out-stream (device-name device-id)
(xt.msg:async
(xt.lang:sexp
"define"
Expand Down Expand Up @@ -79,12 +81,12 @@
(incr (/ (* 1000 duration) steps)))
(lists:foldl
(lambda (val acc)
(let ((sum (+ acc incr)))
(log-debug
(timer:apply_after (round sum)
'xt.midi
'cc
`(,(mupd midi-opts 'cc-value val))))
(let* ((sum (+ acc incr))
(sched (timer:apply_after (round sum)
'xt.midi
'cc
`(,(mupd midi-opts 'cc-value val)))))
(log-debug "Scheduled: ~p" `(,sched))
sum))
0
sq))
Expand All @@ -96,4 +98,4 @@
(lists:reverse (lists:seq end start))))

(defun cc-sine (midi-opts)
'tbd)
'not-implemented)

0 comments on commit 0b43469

Please sign in to comment.