Re:Cal error any help
2011/09/06 20:12:06
(permalink)
I'm no expert, either, but it looked like you closed your "(while (< TracksDone TotalTracks)" before the second track was done. So I took out a couple of parens right before the second track section to open the "while" and "do" back up, and moved them down to the bottom. But I must still be missing something, because it runs without errors, but doesn't fill the second track.
FWIW, here's what I've got:
(do
;; initialize variables
(dword TimeNow 0)
(dword TimeTotal 0)
(dword TimeEnd 0)
(dword BeatsPM 0)
(dword TicksPQ 0)
(int ChannelNumber 0)
(dword TotalTracks 0)
(dword TracksDone 0)
;;;;;; set known variables
;;
;; (getInt ChannelNumber "ChannelNumber: " 0 15)
;;
;; set default values
(= TimeNow 0)
(= TimeTotal 10)
(= TimeEnd 0)
(= BeatsPM 120)
(= TicksPQ 960)
(= ChannelNumber 6)
(= TotalTracks 8) ;; NUMBER OF TRACKS TO CREATE AND ADD
(= TracksDone 0)
;;
;; convert time to ticks
(= TimeEnd (* BeatsPM TicksPQ))
;; (pause "TimeEnd " TimeEnd)
;;
(= TimeEnd (* TimeEnd TimeTotal))
;; (pause "TimeEnd " TimeEnd)
;;
;; insert TotalTracks
(do
(while (< TracksDone TotalTracks)
(do
(= TimeNow 0)
(TrackSelect 1 0)
(do
(while (< TimeNow TimeEnd)
(do
(= TimeNow (+ TimeNow 7680)) ;; on the one of every other measure
(insert TimeNow ChannelNumber NOTE 52 127 60)
(= TracksDone (+ TracksDone 1))
)
)
)
;; 2nd track
(= TimeNow 0)
(TrackSelect 1 1)
(do
(while (< TimeNow TimeEnd)
(do
(= TimeNow (+ TimeNow 3840)) ;; on the 1
(insert TimeNow ChannelNumber NOTE 52 127 60)
(= TracksDone (+ TracksDone 1))
)
)
)
)
)
)
)
SONAR Platinum x64, 2x MOTU 2408/PCIe-424 (24-bit, 48kHz)
Win10, I7-6700K @ 4.0GHz, 24GB DDR4, 2TB HDD, 32GB SSD Cache, GeForce GTX 750Ti, 2x 24" 16:10 IPS Monitors