denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] Scripts and Questions


From: Nils Gey
Subject: [Denemo-devel] Scripts and Questions
Date: Wed, 15 Jul 2009 00:38:53 +0200

Hi people,

my first real and useful (for me :)) script.

Its not complete and I have a few question.
Of course this can be simplified, but it growed as I wrote it, optimizing comes 
last.

;;Add Interval on top. User can choose.
;;This uses the traditional diatonic system. 1 = Prime, 3 = Third....

(define (GoUp x x-max dx) ; Define CursorUp Loop. actually stolen from some 
website
   (if (<= x x-max)
      (begin
        (d-CursorUp)
        (GoUp (+ x dx) x-max dx))))

(define (GoDown x x-max dx) ; same for CursorDown
   (if (<= x x-max)
      (begin
         (d-CursorDown)
         (GoDown (+ x dx) x-max dx))))

(define interval (d-GetKeypress)); Does not test if its only a number or 
anything.

(define AddInterval 
  (lambda ()
    (begin
        (GoUp 2 (string->number interval) 1) ;starts with 2 so Prime=1
        (d-AddNoteToChord)
        (GoDown 2 (string->number interval)1) 
      )))

(AddInterval) ; Go!

;End of Script


And now the questions

1) Is there some hidden scheme-output besides the console? All tutorials and 
scheme-manuals say if you just write values they will be returned to the 
standard-output.

Instead the bash-terminal gets spammed with all code, including comments and 
whitespace/empty lines. Maybe this can be redirected and stripped to a new tab 
in the console frame? 

Makes it maybe easier to look for real things in the console.

2) Is there a schemeway to construct already existing (denemo)-commands with 
variables? Like
(d-2) adds a quarter note in classic mode. But I want to exchange the "2" with 
another value. A clumsy way would be to make a huge "case". But with something 
like a preprocessor this would be easier.

3) What is the command to jump to the (next) note on the same cursorposition, 
means vertical. In my script the cursor just goes up and down from its current 
position, but I want that the chordnotes are added relative to the lowest note.

4) How does ApplyToSelection work? I tried to look at the transpose script for 
selections, but this is also broken.

Btw. how do you think Selections and commands should work? In my opinion a 
command like ApplyToSelection shouldn't be necessary for standard tasks. Any 
single/@cursor command should work on a complete selection without the need for 
a special "for selection" script.

I know selecting is not very well at the moment, but maybe someday this will be 
redesigned? (I hope).


Greetings,

Nils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]