Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code: refactor Canticles from Evang. #4049

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 66 additions & 91 deletions web/cgi-bin/horas/horas.pl
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ sub psalm : ScriptFunc {
$prepend_dagger = 0;
}

if ($first && $rest && $rest !~ /^\s*$/) {
if ($first && $rest && $rest !~ /^\s*$/ && $num != 232) {
$rest = getantcross($rest, $antline);

# Put dagger at start of second line if it would otherwise
Expand Down Expand Up @@ -801,114 +801,89 @@ sub get_link_name {
return $name;
}

#*** ant_Benedictus($num, $lang)
# returns the antiphona $num=1 = for beginning =2 for end
sub ant_Benedictus : ScriptFunc {

my $num = shift;
my $lang = shift;
our ($version, $winner);
our ($month, $day);
our $duplex;

my ($ant) = getantvers('Ant', 2, $lang);

if ($month == 12 && ($day == 21 || $day == 23) && $winner =~ /tempora/i) {
my %specials = %{setupstring($lang, "Psalterium/Major Special.txt")};
$ant = $specials{"Adv Ant $day" . "L"};
}
my @ant_parts = split('\*', $ant);
if ($num == 1 && $duplex < 3 && $version !~ /196/) { return "Ant. $ant_parts[0]"; }

if ($num == 1) {
return "Ant. $ant";
} else {
$ant =~ s/\s*\*\s*/ /;
return "Ant. {::}$ant";
}
}

#*** ant_Magnificat($num, $lang)
# returns the antiphon for $num=1 the beginning, or =2 for the end
sub ant_Magnificat : ScriptFunc {

my $num = shift; #1=before, 2=after
#*** ant_special($lang)
# return special ant. for canticum major hours & duplexflag;
sub ant123_special {
my $lang = shift;

our ($version, $winner);
our ($month, $day);
our $duplex;
our $rank;
our $vespera;

my $v = ($version =~ 1960 && $winner =~ /Sancti/i && $rank < 5) ? 3 : $vespera;
my ($ant) = getantvers('Ant', $v, $lang);
my $ant, $duplexf;

# Special processing for Common of Supreme Pontiffs. Confessor-Popes
# have a common Magnificat antiphon at second Vespers.
my $popeclass = '';
if ($month == 12 && ($day > 16 && $day < 24) && $winner =~ /tempora/i) {
my %specials = %{setupstring($lang, 'Psalterium/Major Special.txt')};

if ( $version !~ /Trident/i
&& $v == 3
&& ((undef, $popeclass, undef) = papal_rule($winner{Rule}))
&& $popeclass =~ /C/i)
{
$ant = papal_antiphon_dum_esset($lang);
setbuild2("subst: Special Magnificat Ant. Dum esset");
}
if ($hora eq 'Laudes' && ($day == 21 || $day == 23)) {
$ant = $specials{"Adv Ant $day" . 'L'};
} elsif ($hora eq 'Vespera') {
$ant = $specials{"Adv Ant $day"};
$duplexf = 1;
}
} elsif ($winner =~ /^Sancti/ && $version !~ /Trident/ && $vespera == 3) {

if ($month == 12 && ($day > 16 && $day < 24) && $winner =~ /tempora/i) {
my %specials = %{setupstring($lang, "Psalterium/Major Special.txt")};
$ant = $specials{"Adv Ant $day"};
$num = 2;
}
my @ant_parts = split('\*', $ant);
if ($num == 1 && $duplex < 3 && $version !~ /196/) { return "Ant. $ant_parts[0]"; }
# Special processing for Common of Supreme Pontiffs. Confessor-Popes
# have a common Magnificat antiphon at second Vespers.
my $popeclass;

if ($num == 1) {
return "Ant. $ant";
} else {
$ant =~ s/\s*\*\s*/ /;
return "Ant. {::}$ant";
if (((undef, $popeclass, undef) = papal_rule($winner{Rule}))
&& $popeclass =~ /C/i)
{
$ant = papal_antiphon_dum_esset($lang);
setbuild2('subst: Special Magnificat Ant. Dum esset');
}
}
($ant, $duplexf);
}

#*** canticum($psnum, $lang)
# returns the formatted text of Benedictus, Magnifificat or Nunc dimittis ($num=1-3)
sub canticum : ScriptFunc {
my $psnum = shift;
my $lang = shift;
$psnum += 230;
psalm($psnum, $lang);
}
# with antiphones
sub canticum {

sub Nunc_dimittis {
my $item = shift;
my $lang = shift;

our ($hora, $vespera);
my $num =
$hora eq 'Laudes' ? 2
: $hora eq 'Completorium' ? 4
: 3;

my $ant, $ant2;
my ($w, $c) = getproprium("Ant 4$vespera", $lang, 1);
my $duplexf = $version =~ /196/;

if ($w) {
setbuild1($ite, 'special');
($ant, $ant2) = split("\n", $w);
} else {
my %a = %{setupstring($lang, "Psalterium/Minor Special.txt")};
my $name;
$name = gettempora('Nunc dimittis') if $version =~ /^Ordo Praedicatorum/;
$ant = $a{"Ant 4$name"};

if ($version =~ /^Ordo Praedicatorum/ && $name eq ' Quad3') {
($ant, $ant2) = split("\n", $ant);
$ant2 = "$ant\n$ant2";
if ($hora eq 'Completorium') {
push(@s, '#' . translate(substr($item, 1), $lang));
my ($w, $c) = getproprium("Ant 4$vespera", $lang, 1);

if ($w) {
setbuild1($ite, 'special');
($ant, $ant2) = split("\n", $w);
} else {
my %a = %{setupstring($lang, 'Psalterium/Minor Special.txt')};
my $name;
$name = gettempora('Nunc dimittis') if $version =~ /^Ordo Praedicatorum/;
$ant = $a{"Ant 4$name"};

if ($version =~ /^Ordo Praedicatorum/ && $name eq ' Quad3') {
($ant, $ant2) = split("\n", $ant);
$ant2 = "$ant\n$ant2";
}
}
}
} else {
$comment = ($winner =~ /sancti/i) ? 3 : 2;
setcomment($item, 'Source', $comment, $lang, translate('Antiphona', $lang));

if (alleluia_required($dayname[0], $votive)) {
ensure_single_alleluia(\$ant, $lang);
}
$duplexf ||= $duplex > 2;
my $key = $num == 3 ? $vespera : $num;
my $df;
($ant, $df) = ant123_special($lang);

my @psalmi = ("$ant;;233");
my $duplexf = $version =~ /196/;
push(@s, translate('#Canticum Nunc dimittis', $lang));
unless ($ant) {
($ant, $c) = getantvers('Ant', $key, $lang);
} else {
$duplexf ||= $df;
}
}
my @psalmi = ("$ant;;" . (229 + $num));
antetpsalm(\@psalmi, $duplexf, $lang);
$s[-1] = "Ant. $ant2" if $ant2;
}
Expand Down
1 change: 1 addition & 0 deletions web/cgi-bin/horas/psalmi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ sub antetpsalm {

if ($ant) {
if ($lastant) { pop(@s); push(@s, "Ant. $lastant", "\n"); }
$ant =~ s/~?\n/ /g;
postprocess_ant($ant, $lang);
my $antp = $ant;

Expand Down
10 changes: 2 additions & 8 deletions web/cgi-bin/horas/specials.pl
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,8 @@ sub specials {
next;
}

if ($item =~ /(benedictus|magnificat)/i) {
$comment = ($winner =~ /sancti/i) ? 3 : 2;
setcomment($label, 'Source', $comment, $lang, translate('Antiphona', $lang));
next;
}

if ($item =~ /Nunc Dimittis/i) {
Nunc_dimittis($lang);
if ($item =~ /Canticum/i) {
canticum($item, $lang);
next;
}

Expand Down
4 changes: 1 addition & 3 deletions web/www/horas/Deutsch/Tempora/Pasc0-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ Ant. Alleluja, Alleluja, Alleluja.
Ant. Alleluja, Alleluja, Alleluja.
_
Ant. Nach dem Sabbat aber, als der Morgen am ersten Tag der Woche anbrach, kam Maria Magdalena und die andere Maria, das Grab zu sehen, alleluja.
&canticum(2)
&Gloria
{::}
&psalm(232)
Ant. Nach dem Sabbat aber, als der Morgen am ersten Tag der Woche anbrach, kam Maria Magdalena und die andere Maria, das Grab zu sehen, alleluja.

&Dominus_vobiscum
Expand Down
9 changes: 4 additions & 5 deletions web/www/horas/English/Commune/C12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $Oremus
#Incipit
_
$Ave Maria
(sed rubrica 1955 aut rubrica 1960 aut rubrica monastica omittitur)
(sed rubrica 1955 aut rubrica 196 omittitur)
V. Turn us then, +++ O God, our saviour:
R. And let thy anger cease from us.
$Deus in adjutorium
Expand All @@ -66,10 +66,9 @@ _
V. Pray for us, O holy Mother of God.
R. That we may be made worthy of the promises of Christ.

#Canticum Nunc dimittis
#Canticum: Nunc dimittis
Ant. We take refuge * under thy protection, O holy Mother of God! Despise not our supplications in our need, but deliver us always from all dangers, O Virgin, glorious and blessed!
&canticum(3)
&Gloria
&psalm(233)
Ant. We take refuge * under thy protection, O holy Mother of God! Despise not our supplications in our need, but deliver us always from all dangers, O Virgin, glorious and blessed!

@:Pre oratio
Expand All @@ -89,7 +88,7 @@ R. Amen.
$Pater noster
$Ave Maria
$Credo
(sed rubrica 1955 aut rubrica 1960 aut rubrica monastica omittitur)
(sed rubrica 1955 aut rubrica 196 omittitur)

[Ant Matutinum]
@Commune/C11::s/V\. .*/V. Grace is poured into thy lips./g s/R\. .*/R. Therefore God hath blessed thee for ever./g
Expand Down
50 changes: 1 addition & 49 deletions web/www/horas/English/Commune/C12P.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,4 @@ Antiphonas Horas
Feria Te Deum

[Special Completorium]
#Incipit
_
$Ave Maria
(sed rubrica 1955 aut rubrica 1960 aut rubrica monastica omittitur)
V. Turn us then, +++ O God, our saviour:
R. And let thy anger cease from us.
$Deus in adjutorium
&Alleluia

#Psalmi
&psalm(128)

&psalm(129)

&psalm(130)

@:Hymnus minor

#Capitulum
!Sir 24:24
v. I am mother of fair love, and fear, and knowledge, and holy hope.
$Deo gratias
_
V. Pray for us, O holy Mother of God.
R. That we may be made worthy of the promises of Christ.

#Canticum Nunc dimittis
Ant. O Queen of heaven * rejoice! alleluia: for He whom thou didst merit to bear, alleluia, hath arisen as he said, alleluia; pray for us to God, alleluia.
&canticum(3)
Ant. O Queen of heaven * rejoice! alleluia: for He whom thou didst merit to bear, alleluia, hath arisen as he said, alleluia; pray for us to God, alleluia.

@:Pre oratio
v. O Lord, we pray thee, that the glorious intercession of Mary, blessed, and glorious, and everlastingly Virgin, may shield us and bring us on toward eternal life.
$Per Dominum

#Conclusio
&Dominus_vobiscum
&Benedicamus_Domino
Benedictio. The almighty and merciful Lord, + the Father, the Son and the Holy Spirit, bless us and keep us.
R. Amen.

&antiphona_finalis
V. May the divine assistance + remain with us always.
R. Amen.

$Pater noster
$Ave Maria
$Credo
(sed rubrica 1955 aut rubrica 1960 aut rubrica monastica)
@Commune/C12::s/Ant. .*/Ant. O Queen of heaven, * rejoice! alleluia: For He whom thou didst merit to bear, alleluia, Hath arisen as he said, alleluia. Pray for us to God, alleluia./gm
2 changes: 1 addition & 1 deletion web/www/horas/English/Psalterium/Translate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
[#Canticum: Magnificat]
#Canticle: Magnificat

[#Canticum Nunc dimittis]
[#Canticum: Nunc dimittis]
#Canticle: Nunc dimittis

[#Preces Dominicales]
Expand Down
4 changes: 1 addition & 3 deletions web/www/horas/English/Tempora/Pasc0-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ Ant. Alleluia, alleluia, alleluia.
Ant. Alleluia, alleluia, alleluia.
_
Ant. And in the end of the sabbath, when it began to dawn towards the first day of the week, came Mary Magdalen and the other Mary, to see the sepulchre, alleluia.
&canticum(2)
&Gloria
{::}
&psalm(232)
Ant. And in the end of the sabbath, when it began to dawn towards the first day of the week, came Mary Magdalen and the other Mary, to see the sepulchre, alleluia.

&Dominus_vobiscum
Expand Down
9 changes: 4 additions & 5 deletions web/www/horas/Espanol/Commune/C12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $Oremus
#Incipit
_
$Ave Maria
(sed rubrica 1955 aut rubrica 1960 aut rubrica monastica omittitur)
(sed rubrica 1955 aut rubrica 196 omittitur)
V. Conviértenos, +++ oh Dios, Salvador nuestro.
R. Cesa en tu rencor contra nosotros.
$Deus in adjutorium
Expand All @@ -55,10 +55,9 @@ _
V. Ruega por nosotros, santa Madre de Dios.
R. Para que seamos dignos de las promesas de Cristo.

#Canticum Nunc dimittis
#Canticum: Nunc dimittis
Ant. Bajo tu amparo * nos ponemos, santa Madre de Dios: no desprecies las súplicas que te dirigimos en nuestras necesidades; más líbranos siempre de todo peligro, Virgen gloriosa y bendita.
&canticum(3)
&Gloria
&psalm(233)
Ant. Bajo tu amparo * nos ponemos, santa Madre de Dios: no desprecies las súplicas que te dirigimos en nuestras necesidades; más líbranos siempre de todo peligro, Virgen gloriosa y bendita.

@:Pre oratio
Expand All @@ -78,7 +77,7 @@ R. Amén.
$Pater noster
$Ave Maria
$Credo
(sed rubrica 1955 aut rubrica 1960 aut rubrica monastica omittitur)
(sed rubrica 1955 aut rubrica 196 omittitur)

[Ant Matutinum]
@Commune/C11::s/V\. .*/V. Derramada está la gracia en tus labios./g s/R\. .*/R. Por ello el Señor te bendecirá para siempre./g
Expand Down
2 changes: 1 addition & 1 deletion web/www/horas/Espanol/Psalterium/Translate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[#Canticum]
#Cántico

[#Canticum Nunc dimittis]
[#Canticum: Nunc dimittis]
#Cántico Nunc dimittis

[#Preces Dominicales]
Expand Down
4 changes: 1 addition & 3 deletions web/www/horas/Espanol/Tempora/Pasc0-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ Ant. Aleluya, aleluya, aleluya.
Ant. Aleluya, aleluya, aleluya.
_
Ant. Pasado el sábado, al alborear el primer día de la semana, fueron María la Magdalena y la otra María a ver el sepulcro, aleluya.
&canticum(2)
&Gloria
{::}
&psalm(232)
Ant. Pasado el sábado, al alborear el primer día de la semana, fueron María la Magdalena y la otra María a ver el sepulcro, aleluya.

&Dominus_vobiscum
Expand Down
2 changes: 1 addition & 1 deletion web/www/horas/Francais/Psalterium/Translate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[#Canticum: Magnificat]
#Cantique : Magnificat

[#Canticum Nunc dimittis]
[#Canticum: Nunc dimittis]
#Cantique : Nunc dimittis

[#Preces Dominicales]
Expand Down
Loading