Heinz Hupfer Posted April 2, 2020 Share Posted April 2, 2020 (edited) Hi:) In CAL language I'm trying to insert a NOTE event at the Now Time, here the very easy Script: ============================ (dword takt) (do (== takt Now) (insert takt 1 NOTE 60 100 240) ) ============================ It works, but it only works if at least one note is selected, if none is selected it doesn't work, why? Doesn't matter which note is selected but if, it inserts the note on C3 at the Now time Can't figure out, why I have to select a note to insert one! Thanks;) Bassman. Edited April 2, 2020 by Heinz Hupfer Link to comment Share on other sites More sharing options...
0 scook Posted April 2, 2020 Share Posted April 2, 2020 all three lines should be in the do block like this (do (dword takt) (= takt Now) (insert takt 1 NOTE 60 100 240) ) or use a one liner (insert Now 1 NOTE 60 100 240) BTW 39 minutes ago, Heinz Hupfer said: (== takt Now) Is not an assignment statement. This is (= takt Now) Link to comment Share on other sites More sharing options...
0 Heinz Hupfer Posted April 3, 2020 Author Share Posted April 3, 2020 @scook On 4/2/2020 at 3:45 PM, scook said: all three lines should be in the do block like this I always got an error if I did this, but found out, it was another problem: After "(do " you MUST have a new line and a TAB before you start an "(int .....". If you don't have a TAB between do and int you get an error:( (do (int mode 1) gets an error! (do (int mode 1) all is fine! Searched about an hour to find out this problem:( Thank you scook for your answer, helped me a lot:) Bassman. Link to comment Share on other sites More sharing options...
0 scook Posted April 3, 2020 Share Posted April 3, 2020 Working in CAL I have Emacs in Lisp mode so formatting happens automatically. Link to comment Share on other sites More sharing options...
0 Heinz Hupfer Posted April 3, 2020 Author Share Posted April 3, 2020 I have notepad++ as standard editor, have to look for automatic formatting. I'm pretty Sure it's possible in notepad! Thanks? Bassman Link to comment Share on other sites More sharing options...
Question
Heinz Hupfer
Hi:)
In CAL language I'm trying to insert a NOTE event at the Now Time, here the very easy Script:
============================
(dword takt)
(do
(== takt Now)
(insert takt 1 NOTE 60 100 240)
)
============================
It works, but it only works if at least one note is selected, if none is selected it doesn't work, why?
Doesn't matter which note is selected but if, it inserts the note on C3 at the Now time
Can't figure out, why I have to select a note to insert one!
Thanks;)
Bassman.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now