[pmwiki-users] ABC tunebook

david at ellendee.co.uk david at ellendee.co.uk
Wed Dec 11 11:30:41 PST 2019


Many thanks for your email. I seem to have it working except that since most browsers no longer have the music player plug-in, how do you get the tune to be played?

 

Regards

 

Dave Cooke

 

From: Hans-Jürgen Godau <juergen at godau-witten.de> 
Sent: 19 July 2019 15:34
To: David Cooke <david at ellendee.co.uk>
Cc: PMWiki <pmwiki-users at pmichaud.com>
Subject: Re: [pmwiki-users] ABC tunebook

 

I use abctunebook. I made some mods to cope with php 7.2 and the latest pmwiki-release.

 

Here are my diffs:

 

--- abctunebook/cookbook/abctunebook.php 2016-01-08 15:39:00.000000000 +0100
+++ cookbook/abctunebook.php 2018-11-13 12:43:55.756779161 +0100
@@ -16,20 +16,23 @@
 
 $RecipeInfo['AbcTunebook']['Version'] = '2016-01-08';
 
-SDV($AbcTunebooks['default'], 'Tunebook');
+SDV($AbcTunebooks, array('default'=>'Tunebook', 0 => 'Liederbuch'));
+
+
 SDV($AddTunePage, 'NewTune');
 
 SDVA($Abcjs, array(
- 'dir' => $PubDirUrl.'/abcjs',
+ 'dir' => $FarmPubDirUrl.'/abcjs',
  'base' => 'abcjs_base-min.js',
  'editor' => 'abc_editor.js',
+ 'editor' => 'abc_editor.js',
  'plugin' => 'abc_plugin.js',
  'midi_program' => '1',
  'midi_qpm' => '160',
 ));
 
 # (:abcjs:) directive will load abcjs plugin scripts even if page is not in a tunebook group.
-Markup_e('abcjs', 'directives', '/\\(:abcjs:\\)/is', "AbcjsLoadPlugin(\$pagename)");
+Markup('abcjs', 'directives', '/\\(:abcjs:\\)/is', "AbcjsLoadPlugin");
 
 # otherwise abcjs will not be loaded and markup rules not be set
 $name = PageVar($pagename,'$Name');
@@ -37,17 +40,21 @@
 if (!in_array($group, $AbcTunebooks)) return;
 
 # load abcjs plugin
-if($action=='browse') {
+if($action!='edit') {
  AbcjsLoadPlugin($pagename);
- Markup_e('X:abc', '>[=','/(?<!\\]\\]\n)(X:\\s*\\d+\\s*\n.*?)\n <file://]/n)(X:/s*/d+/s*/n.*%3f)/n%3c:vspace%3e/s',%22AbcTextMarkup(/$m%5b1%5d)> <:vspace>/s',"AbcTextMarkup(\$m[1])");
- Markup_e('#abc', '<X:abc',
-  '/\\[\\[#(abc\\d*)\\]\\](.*?)\\[\\[#\\1end\\]\\]/is <file://]//%5d(.*%3f)/%5b/%5b%23/1end/%5d/%5d/is> ', "AbcTextMarkup(\$m[2],\$m[1])");
+ Markup('X:abc', '>[=','/(?<!\\]\\]\n)(X:\\s*\\d+\\s*\n.*?)\n <file://]/n)(X:/s*/d+/s*/n.*%3f)/n%3c:vspace%3e/s',%22AbcTextMarkup> <:vspace>/s',"AbcTextMarkup");
+ Markup('#abc', '<X:abc',
+  '/\\[\\[#(abc\\d*)\\]\\](.*?)\\[\\[#\\1end\\]\\]/is <file://]//%5d(.*%3f)/%5b/%5b%23/1end/%5d/%5d/is> ', "AbcTextMarkup2");
+}
+
+function AbcTextMarkup2($m) {
+return AbcTextMarkup($m,$m[1]);
 }
 
 $FmtPV['$MidiTempo'] = '$GLOBALS[Abcjs]["midi_qpm"]';
 
-function AbcjsLoadPlugin($pagename) {
- global $Abcjs, $AbcTunebooks, $HTMLFooterFmt, $HTMLHeaderFmt, $HTMLStylesFmt;
+function AbcjsLoadPlugin($m) {
+ global $Abcjs, $AbcTunebooks, $HTMLFooterFmt, $HTMLHeaderFmt, $HTMLStylesFmt, $pagename;
  $speed = PageTextVar($pagename, 'speed');
  if (!$speed) $speed = 1;
  $rhythm = PageTextVar($pagename, 'R');
@@ -73,9 +80,9 @@
  ";
 }
 
-function AbcTextMarkup($text, $section=false) {
+function AbcTextMarkup($m, $section=false) {
  static $cnt=0; $cnt++;
- $text = trim($text);
+ $text = trim($m[2]);
  $out = '';
  if ($section) {
  $editlnk = "{[foxedit $section 'edit' form=Site.FoxAbcTemplates#editabc]}";

----------------------------------------------------------------------------------

It seems to work for me, at least partially. I have some difficulties with the inline-editor.

 

Hope this helps,

 

jürgen

 

 

Am Di., 16. Juli 2019 um 04:44 Uhr schrieb David Cooke <david at ellendee.co.uk <mailto:david at ellendee.co.uk> >:

Is anyone using ABC tunebook and got it working. I used to use this a while ago, I came back last week to rebuild my folk song website only to find that it is now 'broken'. The last update was about 3 years ago with the previous major PHP update. Now when I try to install it,  I'm getting loads of error messages and no music script. 

 Regards

 

Dave Cooke

_______________________________________________
pmwiki-users mailing list
pmwiki-users at pmichaud.com <mailto:pmwiki-users at pmichaud.com> 
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


This email has been scanned by BullGuard antivirus protection.
For more info visit www.bullguard.com <http://www.bullguard.com/tracking.aspx?affiliate=bullguard&buyaffiliate=smtp&url=/> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20191211/a28f15ba/attachment.html>


More information about the pmwiki-users mailing list