Skip to content

Commit e63aea4

Browse files
experimental quelisma + ponctuation
1 parent 29c3793 commit e63aea4

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

packages/core/src/augustinus.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function psalmLogic(input: string[], notes: string[]) { //Função que aplica a
2525
const i = input.length;
2626
let tonicNote = notes.filter(note => note.includes("r1")).reverse().map(note => note.replace("r1", "")); // Procura pela nota da tônica melódica
2727
const replaceAt = (index: number, value: string) => { input[index] = input[index].replace("@", value) }; // Função menor, parecida com a replaceFromEnd, mas para array
28-
const isTonic = (index: number): boolean => input[index]?.includes("#") ?? false; // Função que será usada mais tarde
28+
// const isTonic = (index: number): boolean => input[index]?.includes("#") ?? false; // Função que será usada mais tarde
2929
const tonicIndex = i - input.findLastIndex(syllable => syllable.includes("#")); // Procura pelo índice da primeira sílaba tônica de trás pra frente
3030
notes = notes.map(notes => notes.replace("r1", "").replace("r", "") || ""); // Limpa as marcações de acento das notas
3131
if (tonicNote.length > 0) {
@@ -277,6 +277,7 @@ export interface Parameters {
277277
customPattern?: string;
278278
customStart?: string;
279279
header?: string;
280+
quelisma?: boolean;
280281
}
281282

282283
export default function generateGabc(input: string, modelObject: Model, parametersObject: Parameters): string {
@@ -412,10 +413,18 @@ export default function generateGabc(input: string, modelObject: Model, paramete
412413
if (parametersObject.header) {
413414
resultGabc = parametersObject.header + "\n%%\n" + resultGabc;
414415
}
416+
// if quelisma (experimental)
417+
if (parametersObject.quelisma) {
418+
resultGabc = resultGabc.replaceAll("can(g)tan(g)do(g) a(g) u(fe)ma(ef) só(g) voz:.(fgf) (::)", "can(g)tan(fgwh)do(g) a(g) u(fe)ma(ef) só(g) voz:(fgf) (::)")
419+
}
420+
421+
415422
// fix temporary use cases
423+
resultGabc = resultGabc.replaceAll(",.", ",");
416424
resultGabc = resultGabc.replaceAll(";.", ";");
417425
resultGabc = resultGabc.replaceAll(":.", ":");
418-
426+
resultGabc = resultGabc.replaceAll("?.", "?");
427+
resultGabc = resultGabc.replaceAll("!.", "!");
419428
return resultGabc;
420429
}
421430

packages/frontend/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ <h1>Augustinus</h1>
6161
<input type="checkbox" id="removeSeparator" />
6262
<label for="removeSeparator">Remover separador</label>
6363
</div>
64+
<div id="quelisma-option" class="option">
65+
<input type="checkbox" id="quelisma" />
66+
<label for="quelisma">Quelisma no prefácio (experimental)</label>
67+
</div>
6468
</div>
6569
<div id="custom-options" style="display: none;">
6670
<div id="custom-simples-options" style="display: none;">

packages/frontend/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const psalmSelect = document.getElementById('psalm') as HTMLSelectElement;
1111
const repeatIntonationCheckbox = document.getElementById('repeatIntonation') as HTMLInputElement;
1212
const separateStanzasCheckbox = document.getElementById('separateStanzas') as HTMLInputElement;
1313
const doElisionCheckbox = document.getElementById('doElision') as HTMLInputElement;
14+
const quelismaCheckbox = document.getElementById('quelisma') as HTMLInputElement;
1415
const separatorInput = document.getElementById('separator') as HTMLInputElement;
1516
const addOptionalStartCheckbox = document.getElementById('addOptionalStart') as HTMLInputElement;
1617
const addOptionalEndCheckbox = document.getElementById('addOptionalEnd') as HTMLInputElement;
@@ -140,6 +141,7 @@ function generate() {
140141
customPattern: customPatternTextArea.value,
141142
customStart: customStartInput.value,
142143
header: metadataTextArea.value,
144+
quelisma: quelismaCheckbox.checked,
143145
};
144146

145147
const gabc = generateGabc(inputText, selectedModel, parameters);

0 commit comments

Comments
 (0)