forked from rism-digital/verovio.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand-line.xhtml
84 lines (75 loc) · 3.75 KB
/
command-line.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
layout: verovio
verovio-light: true
title: Verovio Command-line interface
active: how
how-active: how-cmd
---
<div class="row">
<div class="col-md-3 sidebar-offcanvas" id="sidebar" role="navigation">
<div class="panel panel-default">
{% include how-sidebar.html %}
</div>
</div>
<div class="col-md-9">
<div class="panel-body">
<h3>Command-line interface</h3>
<p>
Verovio can be build as a light and fast standalone command-line tool for converting files (in DARMS, PAE or MEI) into SVG. It is written in pure standard C++ with no dependencies on third-party frameworks and libraries. This ensures maximum portability of the codebase. Verovio implements its own rendering engine, which can render SVG with all the musical symbols embedded in it and without dependency on external fonts. Since the rendering engine is defined as an abstract class, it is possible easily to implement a rendering output different from SVG if needed (e.g., PDF, or HTML Canvas).
</p>
<p>
Building and installing instructions are available on the <a href="https://github.com/rism-ch/verovio/wiki/Building-instructions">wiki</a> page.
</p>
<h4>Basic usage</h4>
<p>
For typesetting an MEI file with the default options, you need to do:
</p>
{% highlight bash %}$ verovio -f mei -o output.svg Hummel_Concerto_for_trumpet.mei{% endhighlight %}
<p>
With the <a href="{{ site.baseurl }}/examples/downloads/Hummel_Concerto_for_trumpet.mei">Hummel concerto for trumpet</a> example, this is what you should obtain:
</p>
<div id="hummel-p1" style="display: none;">
{% include svg/hummel-p1.svg %}
</div>
<h4>Typesetting options (develop version)</h4>
<div style="overflow-y: scroll;">
<p style="min-width: 1000px;">
{% highlight sh %}
{% include cli.txt %}
{% endhighlight %}
</p>
</div>
<h4>Usage with options</h4>
<p>
The following example shows how to ignore the layout information contained in the MEI file and to let it recalculated by Verovio, here with a specific page width and page height. The second page of the <a href="{{ site.baseurl }}/examples/downloads/Guami_Canzona_24.mei">Guami canzona</a> example can be typeset with the following command:
</p>
{% highlight bash %}$ verovio -f mei --breaks none --page-height 2100 --page-width 4200 --page 2 -o output.svg Guami_Canzona_24.mei{% endhighlight %}
<div id="guami-p2" style="display: none;">
{% include svg/guami-p2.svg %}
</div>
</div>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
function adjust_svg_size( div, pageWidth, pageHeight, zoom ) {
// adjust the size according to the width of the div
$( div ).show();
width = $( div ).width();
if ( width < zoom * pageWidth / 100 ) {
zoom = width * 100 / pageWidth;
}
$( div + ' svg g.page-scale').attr("transform", "scale(" + zoom / 100 + ", "+ zoom / 100 +")") ;
$( div + ' svg').height(pageHeight * zoom / 100 );
$( div + ' svg').width(pageWidth * zoom / 100 );
if ( $( div + ' svg') ) {
$( div + ' svg').height(pageHeight * zoom / 100 );
$( div + ' svg').width(pageWidth * zoom / 100 );
}
}
$( document ).ready(function() {
adjust_svg_size( "#hummel-p1", 2100, 2970, 20 );
adjust_svg_size( "#guami-p2", 4200, 2100, 20 );
});
//]]>
</script>