[pmwiki-users] Content/Music - preprocessor step

Martin Fick mogulguy at yahoo.com
Mon Mar 17 13:31:16 CDT 2008

--- Patrick Ogay <lists at basel-inside.ch> wrote:
> What  and need  and implemented partially.
> 1. Step one ABC-Input (generetes Midi)  (:music:) 
> but now with abcpp | abc2...

The latest Content recipe adds support for passing
arguments to converters.  This should now make
integrating abcpp with the music recipe feasible
without external scripts.  Assuming that you want
abcpp to always create abcm (or abctab) makes life
easier since the Content recipe does not yet have the
features required to deal with multiple paths to the
same output.  Here would be the music recipe code for
integrating abcpp:

ContentRegisterType('abcpp', 'text/plain', 'abcpp',
$MUSIC_LIST, true);

ContentRegFSConverter("abcpp", "abcm", 'abcpp ${a} <
${i} > ${o}',null,'music_args_abcpp');

function music_args_abcpp($cp, $cnv, $intype,
$outtype, $args) {
  foreach($args as $arg) $out[]= "-$arg";
  return $out;

This will allow abcpp 2 abcm arguments to be defined
with the (:abcpp:) directive like this:

 (:abcpp defargs=abcm.BASS:)
  ... abcpp markup ...

The abcpp preprocessor will end up seeing: 'abcpp
-BASS' as its arguments.

> 2. Generate Voices - makes only sense if ABC-Source
> are correctly prepared (not default, done  by shell 
> script).

With the new argument enhancements mentioned above
this should no longer require an external script, let
me know if there is a reason that you still do.

> [*]5. If there are generated Songs, I wish the
> displayed automatically bevor the notesheet, so the 
> generated Content is always automatically 
> visible.

While I have not yet decided to implement an ordering
option, this can be done indirectly with the new
(:contentlist:) directive which allows you to create
output types anywhere in a document making layouts
extremely customizable.  

For example, to get all the links before the gif, use
the (:content:) directive  ( (:abcm:) ) first to get
all the links followed by a (:contentlist:) directive
to get the gifs.  Like this:

  (:abcm types=pdf,midi,mp3,vorbis:)
   ... abc markup ...
  (:contentlist types=gif:)

> I  tryed  to make a contenttype  (:showmusic:) which
> has access to the contents  for Step 5.  but I don't

> yet understand fully the content recipe.

Hopefully this markup won't be needed anymore, again,
let me know if there is a reason that you still do.

For more details for some of these new options, do
check out the Content recipe page, it should be quite
flexible.  I will try to add some more configuration
hints to the music page.

Thanks again for the feedback,


Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

More information about the pmwiki-users mailing list