Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Feb 16, 2023
1 parent 43238e7 commit bf11115
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 42 deletions.
63 changes: 38 additions & 25 deletions docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,59 @@

<ol>
<li><a href="#keyboard">Modification/ajout de claviers</a></li>
<li><a href="#commentaires">Insertion de commentaires</a></li>
<li><a href="#tempo">Partition avec plusieurs tempo</a></li>
</ol>

<h2 id="keyboard"><a href="#Top">Modification/ajout de claviers</a></h2>

<p>
1. Ouvrir le dossier de configuration clavier <kbd>Fichier</kbd> > <kbd>Configuration</kbd> > <kbd>Clavier</kbd>.
2. Le premier fichier important est `assemblage.csv` qui permet de construire des claviers à partir de sous claviers standards. Il est construit sous la forme
```
code;Description longue;fichier_#1;fichier_#2;...;fichier_#n
```
Dans votre cas mettons que la main droite a un clavier special mais à gauche l'accompagnement est standard on pourrait ajouter une ligne comme suit:
```
monaccordeon;Mon super accordéon spécial;mon_clavier_special;ctl_8bass_GC
```
3. Il faut créer `mon_clavier_special.csv`. Pas très compliqué c'est `bouton;note` avec note dans la notation de `lilypond`
```
t1;e
<h2 id="keyboard"><a href="#Top">Mon accordéon a un clavier différent des claviers proposés dans tabliato. Puis-je créer mon propre clavier ?</a></h2>

<p><ol>
<li>Ouvrir le dossier de configuration clavier qui contient toutes les fichiers de claviers. Il y a un raccourci dans tabliato: <kbd>Fichier</kbd> > <kbd>Configuration</kbd> > <kbd>Clavier</kbd>.
<li>Le premier fichier important est « assemblage_utilisateur.csv » qui permet de construire des claviers personnalisés à partir de sous claviers standards ou de claviers utilisateur. Il est construit comme le fichier « assemblages.csv » sous la forme:

<pre><code class="csv">code;Description longue;fichier_#1;fichier_#2;...;fichier_#n</code></pre></li>

Mettons que la main droite a un clavier spécial mais à gauche l'accompagnement est standard on pourrait ajouter une ligne comme suit:

<pre><code class="csv">monaccordeon;Mon super accordéon spécial;mon_clavier_special;ctl_8bass_GC
</code></pre></li>

<li>Il faut ensuite créer « mon_clavier_special.csv ». Ce n'est pas très compliqué, la syntaxe est « bouton;note » avec « note » dans la notation de lilypond

<pre><code class="csv">t1;e
t2;fis
t3;a
t4;c'
t5;e'
t6;fis'
[...]
```
4. Redémarrer `tabliato`</p>
</code></pre></li>

<h2 id="commentaires"><a href="#Top">Insertion de commentaires</a></h2>
<li>Redémarrer tabliato</li>
</ol>
</p>

\mark \markup{ \override #'(box-padding . 0.5) \box \caps "Partie 2"}

\mbox "Partie 2"
<h2 id="tempo"><a href="#Top">Est-il possible de changer le tempo au cours d'un morceau ?</a></h2>

<p>Vu que le tempo est déclaré dans le panneau de gauche il s'applique a priori à l'ensemble du morceau donc on peut croire que non ce n'est pas possible. Mais en fait c'est possible. Il y a un exemple dans les tablatures du site: <a href = "tablatures/Cotillons%20verts/Cotillons%20verts.pdf">Cotillons verts</a>.</p>

<h2 id="tempo"><a href="#Top">Partition avec plusieurs tempo</a></h2>
<p>L'interface graphique rend plus facile d'accès certaines options mais c'est le code qui compte. On peut réécrire le rythme à n'importe quel moment avec « \time » et « \motif ». Dans l'exemple ci-dessous on peut déclarer le morceau en 3/4 avec un motif rythmique de valse « B a a » et changer au milieu de la musique en 7/8.</p>

<p>Tout est géré par Tabliato dans l'interface graphique. Indiquez grâce aux listes déroulantes les options de votre partition. Une liste déroulante est paticulièrement importante: le rythme. Cette information permet de générer automatiquement la plupart des informations d'accompagment sans avoir à les écrires explicitements. C'est ce que nous verrons dans les prochaines sections.</p>

<p><img src="img/doc-dock.png" /></p>
<pre><code class="cpp">p7:4 t6 p6 E
t7 6':4. p5':8 D
t6:4 p4':2 E
r:8 p4:8 4' t6 p6 7 E

\break

\time 7/8
\motif [B:4. a:4 a:4]

t8:8 6' 7 8 6' 7 6':16 8 A
7':4 7:8 7':4 7' D
7':8 9 8' 9 7' 8 7' G
p7':4 t8':8 p7':4 7' C
</code></pre>



Expand Down
54 changes: 54 additions & 0 deletions docs/tablatures/Quoan vols ganhar/Quoan vols ganhar.dtb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<tabliato>
<propertie title="Quoan vols ganhar" tagline="\tabliato" tempo="4=160" time="3/4" instrument="" system="cadb" motif="3" poet="" accordion="ctl1gc" rythm="B a a " subtitle="Combien veux-tu gagner - Valse" composer="Trad. des Landes de Gascogne" key="c \major"/>
<tabulature>\partial 4 p7:8 p6' [r:4]

\repeat volta 2
{
p8:4 8 t8 [G g d]
p7 7 7 G
p7 t7:8 p7 t7 p7 [G d d]
p8:2 t8:4 [G g d]

\break

t8 8 p7 [D d g]
t7 p7 t8 [D g d]
p8:4 t9:4. p8:8 [G d d]
}
\alternative
{
{ p7:2 p7:8 p6' G }
{ p6:2 p7:4 G }
}

\break

\repeat volta 2
{
p6:2 p7:4 G
t9:2 t8:4 D
t8 t10:4. 9:8 D
p8:2 p8:4 G

\break

p8 t9 p8 [G d g]
t10 t9 t7' D
}
\alternative
{
{
t8 t6':4. t7:8 D
p7:2 p7:4 G
}
{
t8:4 t6' t7 D
p6:2 [G:2]
}
}

\bar "|."
</tabulature>
<lyric></lyric>
</tabliato>
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions header/lilypond.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef LILYPOND_H
#define LILYPOND_H

#include <QString>

namespace Lilypond
{
QString get_lilypond_path();
QString get_lilypond_command();
bool is_lilypond_installed();
}

#endif // LILYPOND_H
41 changes: 41 additions & 0 deletions src/lilypond.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <QString>
#include <QSettings>

#include "lilypond.h"

namespace Lilypond
{

QString get_lilypond_path()
{
#ifdef Q_OS_WINDOWS
QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\wow6432node\\LilyPond", QSettings::NativeFormat); // 32 bits : HKEY_LOCAL_MACHINE\\SOFTWARE\\LilyPond
QString lilypath = settings.value("Install_Dir").toString();
return lilypath
#endif

#ifdef Q_OS_LINUX
return "/usr/bin";
#endif
}

QString get_lilypond_command()
{
#ifdef Q_OS_WINDOWS
QString command = "\"" + get_lilypond_path(); + "\\usr\\bin\\lilypond.exe" + "\"";
#endif

#ifdef Q_OS_LINUX
QString command = "lilypond";
#endif

return command;
}

bool is_lilypond_installed()
{
bool installed = (get_lilypond_path() == "") ? false : true;
return installed;
}

}
12 changes: 2 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "mainwindow.h"
#include "file.h"
#include "filedownloader.h"
#include "lilypond.h"

QCoreApplication* createApplication(int &argc, char *argv[])
{
Expand Down Expand Up @@ -243,16 +244,7 @@ int main(int argc, char *argv[])
arguments.append(QString("--output=") + ofolder + "/" + ofile);
arguments.append(filebasepath + ".ly");


#ifdef Q_OS_WINDOWS
QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\wow6432node\\LilyPond", QSettings::NativeFormat); // 32 bits : HKEY_LOCAL_MACHINE\\SOFTWARE\\LilyPond
QString lilypath = settings.value("Install_Dir").toString();
QString command = "\"" + lilypath + "\\usr\\bin\\lilypond.exe" + "\"";
#endif

#ifdef Q_OS_LINUX
QString command = "lilypond";
#endif
QString command = Lilypond::get_lilypond_command();

if (verbose) qDebug() << command << " " << arguments;

Expand Down
7 changes: 2 additions & 5 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "versiondialog.h"
#include "global.h"
#include "highlighter.h"
#include "lilypond.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
Expand Down Expand Up @@ -186,15 +187,11 @@ void MainWindow::compile()

terminal("Compilation");

#ifdef Q_OS_WINDOWS
QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\wow6432node\\LilyPond", QSettings::NativeFormat); // 32 bits : HKEY_LOCAL_MACHINE\\SOFTWARE\\LilyPond
QString lilypath = settings.value("Install_Dir").toString();
if (lilypath == "")
if (!Lilypond::is_lilypond_installed())
{
QMessageBox::critical(this, "Erreur", "Impossible de trouver le logicel lilypond sur cet machine. Lilypond ne semble pas avoir été installé.");
return;
}
#endif

Tabulature tab = readMusicFromUI();

Expand Down
2 changes: 0 additions & 2 deletions src/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,6 @@ void TabliatoProcessor::parseMusic()
m_tab->melody.replace(QRegExp(":"), "");
m_tab->melody.replace(QRegExp("\\doublegt"), ">>");
m_tab->melody.replace(QRegExp("\\doubleglt"), "<<");
m_tab->melody.replace("\" ", "\"");
m_tab->melody.replace(" \" ", "\"");

if (nbass == 0) return;

Expand Down

0 comments on commit bf11115

Please sign in to comment.