Jump to content
  • 0
Sign in to follow this  
Heinz Hupfer

CAL Specialists, help needed on insert NOTE

Question

Posted (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 by Heinz Hupfer

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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)

 

Share this post


Link to post
Share on other sites
  • 0

@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.

 

Share this post


Link to post
Share on other sites
  • 0

Working in CAL I have Emacs in Lisp mode so formatting happens automatically.

 

Share this post


Link to post
Share on other sites
  • 0

I have notepad++ as standard editor, have  to look for automatic formatting.  I'm pretty Sure it's possible in notepad!

 

Thanks🙂

Bassman

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...