denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] CapXML import


From: Richard Shann
Subject: Re: [Denemo-devel] CapXML import
Date: Mon, 27 Apr 2015 11:15:53 +0100

On Mon, 2015-04-27 at 08:47 +0200, Andreas Schneider wrote:
> During the weekend I have started to write an import filter using a
> Scheme script, but I have soon some to the point where I did not know
> what Scheme function does a specific job, e.g. set the name of a staff.
> Is there any documentation of Denemo's Scheme interface?
The documentation is patchy beyond the user-facing commands (so
d-StaffProperties command for example does not document what arguments
it can take, just what it does with no arguments). These built-in
commands have a very primitive sort of interface involving passing a
string in.

So looking at the examples in export/importmusicxml.c I can see from
running

 grep d- importmusicxml.c | grep Staff


...
g_string_new (";Score\n\n(d-MasterVolume 0) (d-StaffProperties 
\"denemo_name=voice 1\")")
...

that one of the commands used is (d-StaffProperties "denemo_name=voice
1")
which is setting the denemo_name of the staff to "voice 1", and you that
is an undocumented interface (sorry).

What might be useful is to look at the functions that are defined in
this file that do specific tasks, for example:


static gchar *
add_note (gint octave, gchar * step, gint alter)
{                         
  const gchar *octavation = octave_string (octave);
  gchar *text = g_strdup_printf ("(d-InsertNoteInChord \"%c%s%s\")", 
g_ascii_tolower (*step), alteration (alter), octavation);
  GString *ret = g_string_new (text);
  g_free (text);
  return g_string_free (ret, FALSE);
}

this is writing a d-InsertNoteInChord command to the script. This is
documented in: 

src/scripting/scheme-identifiers.c:  install_scm_function (0, "Takes a
LilyPond note name, and adds that note to the chord",
DENEMO_SCHEME_PREFIX "InsertNoteInChord", scheme_insert_note_in_chord);

I'm not sure if that documentation gets out into a documentation file at
all - there is a scheme script in denemo.scm which extracts
documentation, which I included in the denemo_manual.html until the
latest revisions (I took it out because it was enormous and the command
center is more useful).


I'll try to email some more later, but in the interim I hope this
helps...

Richard


> 
> Andreas
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

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