DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:abc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:abc [2013-07-14 01:23] – [Requirements] 85.186.41.249plugin:abc [2023-10-30 22:41] (current) Klap-in
Line 6: Line 6:
 email      : anika@selfthinker.org email      : anika@selfthinker.org
 type       : syntax type       : syntax
-lastupdate : 2008-08-17 +lastupdate : 2021-01-05 
-compatible : 2005-07-01 - 2007-06-26, 2008-05-05, 2009-02-14, 2009-12-25 "Lemming"2010-11-07 "Anteater"2011-05-25 "Rincewind"2012-01-25 "Angua"2012-10-13 "Adora Belle""Weatherwax"+compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun
 depends    :  depends    : 
-conflicts  :  +conflicts abc2 
-similar    : +similar    : abc2
 tags       : music, markup_language, media, export tags       : music, markup_language, media, export
  
-downloadurl: http://www.dokuwiki.org/_media/plugin:abc_plugin.zip +downloadurl: https://github.com/selfthinker/dokuwiki_plugin_abc/archive/master.zip 
-bugtracker : http://github.com/selfthinker/dokuwiki_plugin_abc/issues +bugtracker : https://github.com/selfthinker/dokuwiki_plugin_abc/issues 
-sourcerepo : http://github.com/selfthinker/dokuwiki_plugin_abc/+sourcerepo : https://github.com/selfthinker/dokuwiki_plugin_abc/
 donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11071728 donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11071728
 ---- ----
 +
 +There is a successor to this plugin which is much easier to install, the **[[plugin:abc2|ABC2 Plugin]]**.
  
 ===== What is ABC? ===== ===== What is ABC? =====
  
-abc is a musical notation language and "designed to notate tunes in plain text format."+ABC is a musical notation language and "designed to notate tunes in plain text format."
  
-See http://abcnotation.org.uk/ for more information.+See http://abcnotation.com/ for more information.
  
-===== Attempts by other Wikis =====+===== Implementations in other Wikis =====
  
   * [[http://www.wikisophia.org/wiki/Wikitex#Music|WikiSophia]] does not use ABC but [[http://www.lilypond.org|lilypond]]   * [[http://www.wikisophia.org/wiki/Wikitex#Music|WikiSophia]] does not use ABC but [[http://www.lilypond.org|lilypond]]
-  * one attempt to implement ABC is the [[http://10pouces.homelinux.net/phpwiki/index.php/AbcPlugin|ABC plugin for  PhpWiki]] FIXME Link does not work +  * one attempt to implement ABC is the [[http://www.pmwiki.org/wiki/Cookbook/AbcMusic|AbcMusic recipe for PmWiki]] 
-  * another attempt is an [[http://www.soe.ucsc.edu/cgi-bin/cgiwrap/nwhitehe/moin.cgi/MusicWiki|ABC plugin for MoinMoin]] +  * another attempt is the [[http://www.mediawiki.org/wiki/Extension:Score|Score extension for MediaWiki]] 
-  * there is also the [[http://www.pmwiki.org/wiki/Cookbook/AbcMusic|AbcMusic recipe for PmWiki]] +  * not a wiki, but other PHP implementations are available for WordPress: the [[https://wordpress.org/plugins/music-sheet-viewer/|Music Sheet Viewer Plugin]]the [[https://wordpress.org/plugins/abc-notation/|ABC Notation Plugin]] and the [[https://wordpress.org/plugins/choon-player/|Choon Player Plugin]] 
-  * and finally the "big one" got a [[http://www.mediawiki.org/wiki/Extension:ABC|ABC extension for MediaWiki]] (and an older [[http://www.mediawiki.org/wiki/Extension:AbcMusic|AbcMusic extension]]) +  * not a wiki either, but you can write ABC collaboratively in [[https://stackedit.io/|StackEdit]] because it has implemented [[https://www.abcjs.net/|abcjs]] 
-  * not a wiki, but another PHP implementation is the [[http://scorerender.abelcheung.org/|ScoreRender Plugin for WordPress]]+
  
 ===== Implementing in DokuWiki ===== ===== Implementing in DokuWiki =====
Line 38: Line 40:
 ==== Requirements ==== ==== Requirements ====
  
-  * ''convert'' from [[http://www.imagemagick.org/|ImageMagick ]] (GPL-compatible license) +  * ''convert'', one of the tools from **[[http://www.imagemagick.org/|ImageMagick]]** (GPL-compatible license) 
-    which (should) use **[[http://www.cs.wisc.edu/~ghost/|Ghostscript]]** (GPL or AFPL) -- see Andi's tutorial on [[notes>ImageMagick]] for details +  * **[[http://www.ghostscript.com/|Ghostscript]]** (GPL or AFPL) 
-    * ImageMagick-6.8.6-Q16Win 32, for example, will not work without **Ghostscript** (you can get it and install from the link above). +    * needed by ''convert'' for handling eps files, see [[notes>ImageMagick|Andi's tutorial on ImageMagick]] for details 
-       im_convert is abbreviation from **ImageMagic Convert**. This file is an executable inside a whole kit. Don't look after this converter because it exist just in the ImageMagic. Download the kit from the link above. +    * ''ps2pdf'' from the same package (optionalonly needed if you want to have PDF files created instead of PS files
-  * ''[[http://moinejf.free.fr/|abcm2ps]]'' (GPL 2) +  * **''[[http://moinejf.free.fr/|abcm2ps]]''** (GPL 2) 
-  * ''abc2midi'' from [[http://abc.sourceforge.net/abcMIDI/|abcMIDI]] (GPL 2, only needed if you want to have midi files created)+  * ''abc2midi'' from [[http://abc.sourceforge.net/abcMIDI/|abcMIDI]] (GPL 2, optional, only needed if you want to have midi files created)
     * ''abc2abc'' from the same package (optional, only needed if you want to be able to transpose automatically)     * ''abc2abc'' from the same package (optional, only needed if you want to be able to transpose automatically)
-  * [[http://www.cs.wisc.edu/~ghost/|Ghostscript]]'s ''ps2pdf'' (only needed if you want to have PDF files created instead of PS files) 
  
 ==== Download and Install ==== ==== Download and Install ====
  
-Download and install the latest version of the plugin (**for DokuWiki versions 2006-11-06 - 2009-12-25**) using the [[plugin:plugin|Plugin Manager]] using the URL given above. Refer to [[:Plugins]] on how to install plugins manually. +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
- +
-{{plugin:plugin_abc_2006-02-27a.zip|Download version 2006-02-27a}} **for older DokuWiki versions** (2005-07-01 - 2006-03-09)+
  
 ==== Configuration ==== ==== Configuration ====
- 
-=== For the latest plugin versions (2007-06-03, 2006-12-09 + 2006-07-23) === 
  
 Please use the [[plugin:config|Configuration Manager]] to configure the needed variables! Please use the [[plugin:config|Configuration Manager]] to configure the needed variables!
-(If you want to change these manually, you can edit ''./lib/plugins/abc/conf/default.php'' instead.) 
  
 ^config variable^description                                        ^importance ^ ^config variable^description                                        ^importance ^
 ^''abc2ps''         |path where to find ''abcm2ps''                             |**essential**  | ^''abc2ps''         |path where to find ''abcm2ps''                             |**essential**  |
-^''im_convert''     |path where to find ''convert'' from ImageMagick **(from the main DokuWiki config!)**   |**essential**  |+^''[[config:im_convert]]'' |path where to find ''convert'' from ImageMagick **(from the main DokuWiki config!)**   |**essential**  |
 ^''displayType''    |how to display the output (image only; image linked to midi; image with list of abc, midi, PS/PDF) |recommended| ^''displayType''    |how to display the output (image only; image linked to midi; image with list of abc, midi, PS/PDF) |recommended|
 ^''abc2midi''       |path where to find ''abc2midi'' (optional if you keep to the default displayType, needed with all other displayTypes)|recommended| ^''abc2midi''       |path where to find ''abc2midi'' (optional if you keep to the default displayType, needed with all other displayTypes)|recommended|
Line 75: Line 71:
 ^''params4ps''      |parameters for generating the ps/pdf file                      |(optional, **new in version 2007-06-03**, only for experts!)| ^''params4ps''      |parameters for generating the ps/pdf file                      |(optional, **new in version 2007-06-03**, only for experts!)|
  
-== style.css and file icons ==+=== style.css and file icons ===
  
-Since version 2006-12-09 a file icon for midi files was added. If you want to allow midi files to be uploaded by the media manager and want them to be automatically recognized by DokuWiki, you should take the steps [[:mime|described here]] (using my mid.png or any other) and comment out the last lines of ''style.css''.+If you want to allow midi files to be uploaded by the media manager and want them to be automatically recognized by DokuWiki, you should take the steps [[:mime|described here]] (using the mid.png file icon in the root folder of the plugin or any other) and comment out the last lines of ''style.css''.
  
 You can do the same with a possible abc icon ... You can do the same with a possible abc icon ...
- 
- 
-=== For older versions (2006-02-27a and earlier) === 
- 
-Please read the README that comes with the zip file! 
- 
  
 ==== Probable alteration of ./inc/search.php ==== ==== Probable alteration of ./inc/search.php ====
Line 118: Line 108:
 ==== Transposition ==== ==== Transposition ====
  
-<del>Since version 2005-11-20 it is possible to let the plugin transpose for you by an extra parameter. This parameter has to be a number between -23 and 23, which is the amount of semitones the tune will be transposed up (if positive) or down (if negative).</del> +It is possible to let the plugin transpose for you by extra parameters (separated by spaces; only 7 different values allowed). These parameters have to be numbers between -23 and 23, which is the amount of semitones that the tune will be transposed up (if positive) or down (if negative). E.g.
- +
-Since version 2006-02-21 it is possible to let the plugin transpose for you by extra parameters (separated by spaces; only 7 different values allowed). These parameters have to be numbers between -23 and 23, which is the amount of semitones that the tune will be transposed up (if positive) or down (if negative). E.g.+
  
 <code> <code>
Line 141: Line 129:
  
   - Make sure the involved programmes work properly (by testing e.g. "''/path/to/abcm2ps test.abc -O test.ps''" in the shell).   - Make sure the involved programmes work properly (by testing e.g. "''/path/to/abcm2ps test.abc -O test.ps''" in the shell).
-  - There is an internal debug variable, which can be turned on for more detailed hints what could be wrong ("''var $_debug = 1;''" near the top of ''syntax.php'').+  - Enable the [[config:allowdebug|'allowdebug' config option]]. That will turn on more detailed hints about what could be wrong.
   - Add a [[devel:caching#purging_the_cache|purge parameter]] to the URL ("?purge=1" or "&purge=1") when testing - to force a recaching of the page and to recreate all abc plugin related files.   - Add a [[devel:caching#purging_the_cache|purge parameter]] to the URL ("?purge=1" or "&purge=1") when testing - to force a recaching of the page and to recreate all abc plugin related files.
  
Line 147: Line 135:
 ===== Important notes ===== ===== Important notes =====
  
-  * I only just began to learn PHP, so please feel free to make improvements! 
   * Any kind of error handling or other measures to provide security may not have been cared for satisfyingly. So any usage at your own risk.   * Any kind of error handling or other measures to provide security may not have been cared for satisfyingly. So any usage at your own risk.
-  * I have successfully tested on Windows2000 and Linux Debian. +  * You can test the plugin on http://abcwiki.selfthinker.org/
-  * You can test the plugin at this live wiki: http://abcwiki.selfthinker.org/+
  
 ===== Version history ===== ===== Version history =====
  
-  * **2008-08-17**: +{{rss>https://github.com/selfthinker/dokuwiki_plugin_abc/commits/master.atom date}}
-    * made abc media namespace configurable (if your wiki closed, this could fix a security issue) +
-    * added the option to display the error logs of abcm2ps and abc2midi (only once when the page is saved or previewed) +
-    * fixed browser caching for changed media files +
-    * fixed preview of a revision +
-    * improved error messages +
-  * **2007-06-03**: +
-    * support for (many) UTF-8 characters, which will be automatically converted into their equivalent escape sequence +
-    * formerly nothing was displayed when the image failed to be generated, now an error is displayed instead +
-    * two config options were added for the possibility of changing the abcm2ps parameters for the image and ps/pdf generation +
-  * **2006-12-09**: +
-    * support for PDF file creation +
-    * for the list of abc, midi, PS/PDF files corresponding file icons for different media types are used +
-    * when doing a "[[devel:caching#purging_the_cache|?purge=1]]", the behaviour for not parsing unchanged source again, is avoided +
-    * a simple (hidden) way to debug was added +
-    * the style.css was changed (so was a bit of the HTML output) +
-  * **2006-07-23**: +
-    * no more usage of the .trans file +
-    * if transposition parameters have changed, only the necessary files are parsed again +
-    * old transposed files will now be deleted +
-    * upgraded for ability to use the config manager for configuration +
-    * from now on the abc source is always in the HTML source (for search engine optimization) +
-    * rough error handling +
-  * **2006-02-27a**: bugfix for creation of ps file when no fmt file is used +
-  * **2006-02-27**: bugfix for preview and revisions (similar to [[bug>670]]) and reaction to deletion of $conf['dmask'+
-  * **2006-02-21**: enhanced transposition functionality +
-  * **2005-11-21**: bugfix for handling file names (realpath) of more than 120 characters and changing the file base +
-  * **2005-11-20**: new transposition functionality +
-  * **2005-10-23**: first //functioning// version! +
-  * **2005-07-04**: first version+
  
  
 +===== Feedback =====
  
 +==== Rendering ====
  
 +Please include http://code.google.com/p/abcjs/ for rendering.
  
- +> There is now a new ABC Plugin which includes abcjs and other similar JS libraries. The implementation is too different from this plugin, that's why I created a new one, see [[plugin:abc2|ABC2 Plugin]]. --- [[user>ach|ach]] //2021-01-11 19:21//
-===== Feedback =====+
  
 ==== Output tabs ==== ==== Output tabs ====
Line 236: Line 195:
 I'm not too sure what to put when setting ps2pdf. I've tried putting ''c:\xxx\xxx\ghostscript\gs8.71\lib\ps2pdf14'' and I get the error message that it's not an executable. There's no .exe files that I can see in the ghostscript folder. Midi & ps conversion works fine. Dokuwiki on local install. Any help appreciated. I'm not too sure what to put when setting ps2pdf. I've tried putting ''c:\xxx\xxx\ghostscript\gs8.71\lib\ps2pdf14'' and I get the error message that it's not an executable. There's no .exe files that I can see in the ghostscript folder. Midi & ps conversion works fine. Dokuwiki on local install. Any help appreciated.
  --- ty //2011/08/29 10:13//  --- ty //2011/08/29 10:13//
 +
 +==== Understanding Transposition ====
 +I understood that I have to put the following in the plugin beginning to obtain a transposition:
 +<code><abc 7 -3></code>
 +Do I need to do something else to obtain a transposition? I copied your example in my page but it seems to not work. What did I missed?
 +//[[partenery ate gmail point com|Florin]]//
 +
 +> You only need to make sure ''abc2abc'' (from the ''abc2midi'' package) is installed and working. The path to it then needs to be set in the ''abc2abc'' config option. --- [[user>ach|Anika Henke]] //2014/03/23 13:43//
  
 ==== Error messages ==== ==== Error messages ====
Line 252: Line 219:
 >>> >>>
 >>>> Yes, I get that message all the time. That is nothing to worry about. --- [[user>ach|Anika Henke]] //2013/07/12 00:35// >>>> Yes, I get that message all the time. That is nothing to worry about. --- [[user>ach|Anika Henke]] //2013/07/12 00:35//
 +>So, please tell me where exactly should I post this debugging code ''var $_debug = 1''?
 +>>There is only one syntax.php in the plugin and there is only one "var $_debug".\\
 +>>https://github.com/selfthinker/dokuwiki_plugin_abc/blob/master/syntax.php#L18.
 +>For test I made myself via notepad an ABC File with this content:\\
 +>test.abc:
 +> <abc 5>
 +>X:42
 +>T:Test
 +>M:4/4
 +>K:C
 +>"C" C2 D2 E2 G2 |"C" c8 |]
 +>w:This is just a test.
 +></abc>
 +>>ABC files shouldn't have <abc></abc> in them. That's only meant for DokuWiki to know that the content can be rendered by the ABC plugin.
 +>>>Good to know.\\
 +
 +>**1.**This is my first manual testing steps:\\
 +>Win server 2003. Run, cmd:
 +>C:\Utile\abcm2ps>C:\Utile\abcm2ps\abcm2ps.exe test.abc -s 1 -w 600 -E -O test. 2>&1
 +>abcm2ps-6.6.22 (November 28, 2012)
 +>-In tune:
 +>Error: 'staffwidth' too big
 +>Output written on test001.eps
 +
 +>**2.**C:\Utile\ImageMagick-6.8.6-Q8\convert.exe C:\Utile\abcm2ps\test001.eps -flatten test.png
 +>convert: Postscript delegate failed `rrr.eps': No such file or directory @ error/ps.c/ReadPSImage/837.
 +>convert: no images defined `rrr.png' @ error/convert.c/ConvertImageCommand/3106.
 +>>You are probably missing the Ghostscript delegate library. Install it from here: [[http://www.imagemagick.org/script/binary-releases.php]]  [[user>ach|Anika Henke]]
 +>>>It works! My advice is to open the **imdisplay.exe** inside ImageMagick folder and try to  open manually test001.eps. If you see the image the converter is working. (to me it did not work before installing GhostScript application!)\\
 +>>>Pay attention too to the apache error.log. It seems that for some reasons the path to im_converter (set in Configuration Manager DW) to not be recognized because of the space between C:\Program(space)files\path. For me it worked installing it outside the ''Program Files'' folder (I have Windows 2003 and I installed it in the ''C:\Util\''. //[[partenery ate gmail point com|Florin]]//\\
 +
 +==== Multiple abc section on the same page ====
 +
 +Hi Anika and thanks for this plugin.
 +
 +I recently installed it on a 2014-09-29d "Hrun" and it works great.
 +
 +Just one question, is there is a way to have multiple <abc> section on the same page?
 +
 +When I'm doing it, I'm getting multiple image of the last section instead of 2 distinct section.
 +
 +Thanks - Thomas.
 +
 +> Yes, having multiple abc section on the same page is no problem. The problem you're having sounds like it's because your sections have the same titles and IDs/reference number (''X:''). The media files which get created all follow a pattern for the file name which first has the ID and then the title. So, when both are the same, the previous files get overwritten. Just make sure you use different reference numbers. --- [[user>ach|Anika Henke]] //2017-01-23 00:19//
 +
 +>> Great. This is working as you mentioned. Thanks again Anika!
 +
 +>>> This does not happen with the new [[plugin:abc2|ABC2 Plugin]]. --- [[user>ach|ach]] //2021-01-11 19:21//
plugin/abc.1373757801.txt.gz · Last modified: 2013-07-14 01:23 by 85.186.41.249

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki