denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Scheme scripts and libs


From: Richard Shann
Subject: Re: [Denemo-devel] Scheme scripts and libs
Date: Fri, 13 Mar 2009 09:46:24 +0000

On Thu, 2009-03-12 at 23:50 +0100, Nils Gey wrote:
> Hi all,
> 
> today I began to write scheme scripts.
> Using the functions to control Denemo are very easy and good to use.
> 
> But I noticed that, in opposite to other script-languages, scheme has not 
> many build-in functions. 
I think you may have a couple of problems here
      * The documentation is at
        http://www.gnu.org/software/guile/manual/html_node/index.html
      * Even with this, it can be difficult to locate functions to do
        what you want. This is a general problem with documentation.
        While it is true that functions are mostly (and increasingly)
        not built-in (i.e. they are scripts), they are nevertheless
        documented there. But if you don't have a name to look up in the
        index it can be tricky to know it's there. I found the random
        functions by looking up the word random (at random :-) in the
        index. I've used them in the script
        menus/MainMenu/Educational/ReadingNoteNames which puts a random
        note on the screen and expects you to name it. (This is a very
        old script and not a good model).
      * The functions are (increasingly) being put into modules which
        have to be loaded (in denemo.scm). So you may get an obscure
        "unbound variable" error, which can be either that you mis-typed
        the name, or that you are using a module not yet included in
        denemo.scm. To check write (display func-name) in the denemo
        scheme window (where func-name is the function you are going to
        be using). Then execute it and look in the console to see that
        it reports it as <procedure....>. If it doesn't the you can get
        a terminal up outside denemo and run guile and then with the
        same command (display func-name) you should always get it,
        because the guile interpreter loads all the modules at startup.
        If so then you need to look up the module (listed in the docs)
        and load it (in your script, initially). Perhaps we should load
        all the modules as the guile interpreter does? The modules are
        in the ice-9 directory...
HTH
Richard


> 
> I am planning a script that involve placing some random notes in the score. 
> In the end there shall be a script that composes simple melodies and a second 
> voice in the medieval discantus style around 1100. 
> 
> I looked a bit around and there seem to be a few places that provide 
> libraries for additional scheme functions, like a random number generator.
> 
> For example this http://planet.plt-scheme.org/ (random.plt is the lib). Is 
> there any way we can provide/integrate these libs so that its easy for a user 
> to use specific functions?
> 
> I also encountered that the scheme-window is very limited (like the 
> lilypond-edit-window) and it would be quite a nice project in the future to 
> use something like http://www.scintilla.org/ to provide more comfort for 
> textediting.
> 
> Nils, exploring Denemos beauty.
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

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