From 76a32c700f061fc8cc6129342bf49b3b260c28ec Mon Sep 17 00:00:00 2001 From: dotmg Date: Thu, 5 Mar 2026 13:28:44 +0100 Subject: [PATCH] Correction of some hymns --- .../composeResources/files/ews-100.txt | 2 +- .../composeResources/files/ews-48.txt | 2 +- .../composeResources/files/ews-81.txt | 2 +- .../composeResources/files/ffpm-25.txt | 2 +- .../composeResources/files/ffpm-501.txt | 6 +- .../composeResources/files/ffpm-819-1.txt | 18 +++-- .../composeResources/files/ffpm-819-2.txt | 29 +++----- .../mg/dot/feufaro/midi/MidiWriterKotlin-1.kt | 71 ------------------- 8 files changed, 27 insertions(+), 105 deletions(-) delete mode 100644 composeApp/src/desktopMain/kotlin/mg/dot/feufaro/midi/MidiWriterKotlin-1.kt diff --git a/composeApp/src/commonMain/composeResources/files/ews-100.txt b/composeApp/src/commonMain/composeResources/files/ews-100.txt index 02375df..a9096c2 100644 --- a/composeApp/src/commonMain/composeResources/files/ews-100.txt +++ b/composeApp/src/commonMain/composeResources/files/ews-100.txt @@ -1,3 +1,3 @@ I0:ews-324.txt:^(M|E) -M0:|c:D|m:4/4|t:EWS 48 - r:8878874848|a:Birgitte Katerine Boye 1742-1824 tr: George Taylor Rygh 1860-1942|h:WIE SCHÖN-LEUCHTET Philipp Nicolai 1556-1608 arr. Johann Sebastian Bach 1731|u:https://hymnary.org/page/fetch/CAH2000/448/high +M0:|c:D|m:4/4|t:EWS 100 He is arisen! Glorious Word!|r:8878874848|a:Birgitte Katerine Boye 1742-1824 tr: George Taylor Rygh 1860-1942|h:WIE SCHÖN-LEUCHTET Philipp Nicolai 1556-1608 arr. Johann Sebastian Bach 1731|u:https://hymnary.org/page/fetch/CAH2000/448/high E1:He is a_ri_sen! Glo_rious Word!/Now re_con_ciled is God, my Lord;/the gates of heav'n are o_pen./My Je_sus did tri_um_phant die,/and Sa_tan's ar_rows bro_ken lie,/des_troyed hell's fierc_est wea_pon./O hear what cheer!/Christ vic_to_rious, ri_sing glo_rious,/life is gi_ving./He was dead but now is li_ving! diff --git a/composeApp/src/commonMain/composeResources/files/ews-48.txt b/composeApp/src/commonMain/composeResources/files/ews-48.txt index 333f044..54d1378 100644 --- a/composeApp/src/commonMain/composeResources/files/ews-48.txt +++ b/composeApp/src/commonMain/composeResources/files/ews-48.txt @@ -1,3 +1,3 @@ I0:ews-324.txt:^(M|E) -M0:|c:D|m:4/4|t:EWS 48 - r:8878874848|a:Birgitte Katerine Boye 1742-1824 tr: Carl Døving (1867-1937)|h:WIE SCHÖN-LEUCHTET Philipp Nicolai 1556-1608 arr. Johann Sebastian Bach 1731|u:https://hymnary.org/page/fetch/CAH2000/448/high +M0:|c:D|m:4/4|t:EWS 48 - Rejoice, rejoice this happy morn|r:8878874848|a:Birgitte Katerine Boye 1742-1824 tr: Carl Døving (1867-1937)|h:WIE SCHÖN-LEUCHTET Philipp Nicolai 1556-1608 arr. Johann Sebastian Bach 1731|u:https://hymnary.org/page/fetch/CAH2000/448/high E1:Re_joice, re_joice this hap_py morn,/A Sa_vior un_to us is born,/The Christ, the Lord of glo_ry!/His low_ly birth in Beth_le_hem/The ang_els from on high pro_claim/And sing re_demp_tion's sto_ry!/My soul, ex_tol/God's great fa_vor;/Bless Him e_ver/For sal_va_tion;/Give Him praise and a_do_ra_tion!/ diff --git a/composeApp/src/commonMain/composeResources/files/ews-81.txt b/composeApp/src/commonMain/composeResources/files/ews-81.txt index a119039..f704bb9 100644 --- a/composeApp/src/commonMain/composeResources/files/ews-81.txt +++ b/composeApp/src/commonMain/composeResources/files/ews-81.txt @@ -1,7 +1,7 @@ M0:|c:F|m:3/4|t:EWS 81 The hour in dark Gethsemane|a:Edward Payson Hammond 1831-1910|h:Asa Hull (1828-1907)|r:CMD|u:https://hymnary.org/page/fetch/MPH1908/37/high U0:z8:4 2244 224/4 6222 8/4 2262 224/4 6222 ${DC}8/ N1: mmrrffmm ssmdmr mfslllss sssfrd -N2: ddttrrdd mmdddt dddddddd dttttd +N2:#t, ddttrrdd mmdddt dddddddd dttttd N3:#r ssssssss ddssss sfmfffmm mrrrfm N4:#f,dssssddd dddmds dlsffddd dssssd E1:The hour in dark Ge_thse_ma_ne/I ne_ver shall for_get,/When Christ a_lone the bat_tle fought,/In grief and bloo_dy sweat./${R=}${D:Ge_thse_ma_ne, Ge_thse_ma_ne,/I must re_mem_ber thee,/Where God’s e_ter_nal son I saw/In prayer on bend_ed knee.} diff --git a/composeApp/src/commonMain/composeResources/files/ffpm-25.txt b/composeApp/src/commonMain/composeResources/files/ffpm-25.txt index bd8033e..ddc5f24 100644 --- a/composeApp/src/commonMain/composeResources/files/ffpm-25.txt +++ b/composeApp/src/commonMain/composeResources/files/ffpm-25.txt @@ -2,7 +2,7 @@ M0:|t:FFPM 25 andriamanitra hendry|a:Maintimolaly|r:C.M.|h:(Union, 263)|c:G|m:4/ U0:z0:(y)22 (2112)2 4462 (22)(22)(22)(22) (22)(22)44 ${p}4462 622222 6222(11)(11) 622222 6262 222262 (y)(22)44 G N1: drmds---fmrd mrdt,drdrmfm fslsrFs dsfmrmfs -8 lsfmrm mlsfmrds lsfmfmrd N2:#s, s-sss---ddtd ss-s-.s-s-s- d-ddtlt dmrdtdrm -8 zzzzzz dddtdsdtd d--ddtd -N3: mfsmdzrmlsfm sfmr.mfsfmrd lsfssrr z5 l-sfmrm,fs,lt z6 sfssssFsr mfslsfm +N3: mfsmdzrmlsfm sfmr.mfsfmrd lsfssrr z5 l-sfmrmfslt z6 sfssssFsr mfslsfm N4:d-dd#d, m---fssd ds-s-#t, fmrdtdrmfmrr,s, z5d-mrds,drmfs fmrdtl, dfmrd#d, tlsfmrdfssd Y1:Andri_amanitra hendry/Loharanon-tsaina/Loharanon-tsaina/Ka manolo-pahendrena/_6‘Zay manaiky Azy/Ka manolo-pahendrena/‘Zay manaiky Azy Y2:Andriamanitra mahay/Izao rehetra izao/Izao rehetra izao/Ka Izy no akana saina/Hahahendry antsika/Ka Izy no akana saina/Hahahendry antsika diff --git a/composeApp/src/commonMain/composeResources/files/ffpm-501.txt b/composeApp/src/commonMain/composeResources/files/ffpm-501.txt index bc275b2..520407a 100644 --- a/composeApp/src/commonMain/composeResources/files/ffpm-501.txt +++ b/composeApp/src/commonMain/composeResources/files/ffpm-501.txt @@ -1,9 +1,9 @@ -M0:|c:E|m:3/4|r:L.M.|t:FFPM 501. Namely Mafy Loatra|a:William Edward Cousins 1840-1939|h:H.P. Smith, 1825-1898 +M0:|c:E|m:3/4|r:L.M.|t:FFPM 501. Namely Mafy Loatra|a:William Edward Cousins 1840-1939|h:Henry Percy Smith, 1825-1898 U0:z0:4448484C/44484(44)4C/44484(44)4(44)/48484(44)4C -N1:#rmmmfmrrr/ssfmddtls/slsdttlsf-/mrd, fmrltd, +N1:#rmmmfmrrr/ssfmddtls/slsdttlsf-/mrd, fmrl,t,d, N2:#s,d5llt/tdrdmmrdt/rrrddd-ddt/dtlrdl-ss N3:ssslslrs/s5F-Fs/tltssf-ss-/sfmssf-rm -N4:#f,d5fFs/sltdlr-rs/#dfffmmf-mr-/d#d,sltdfrsd' +N4:#f,d5fFs/sltdlr-rs/#dfffmmf-mr-/d#d,sltd'frsd' Y1:Namely mafy lo_atra/Ny henatra\ aman-tahotra,/Tsy afaka ny haizim-po/Fa mbola tao ny heloko Y2:Nandroso a\ho nivavaka/Ry Jeso ô, Mpanavotra,/Izao no angatahiko:/Mba mamelà ny heloko! Y3:Izaho tsy hi_ahotra,/Ny tenako atolotro,/Izay rehetra\ ananako/Anao, Mpamela heloka! diff --git a/composeApp/src/commonMain/composeResources/files/ffpm-819-1.txt b/composeApp/src/commonMain/composeResources/files/ffpm-819-1.txt index cd1f9ed..05cfa4a 100644 --- a/composeApp/src/commonMain/composeResources/files/ffpm-819-1.txt +++ b/composeApp/src/commonMain/composeResources/files/ffpm-819-1.txt @@ -1,11 +1,15 @@ -M0:|t:FFPM 819 (1) Andriamanitra Tompo ô ! Fizarana I|a:Anglikana (Litany for Children)|h:J.J. Dykes 1823-1876|c:D|m:4/4|r:7.7.7.7. -U0:z0:6244 4(22)8/ 4(22)44 628/ 62(22)4 44(422)/ ${p}4462 4(22)8 +M0:|t:FFPM 819 (1) Andriamanitra Tompo ô ! Fizarana I|a:Anglikana (Litany for Children)|h:John Bacchus Dykes 1823-1876|c:D|m:4/4|r:7.7.7.7. +U0:z0:6244 4(22)8/ 4(22)44 628/ 62(22)4 44(422)/ ${p}(44)62 4(22)8 N1: mmrmfsls slsmdmrr mrmfsld'tl- smsfm-rd N2:#t, dddddd-d dd-ddddt dtdrmff.tdr mdmrd-td N3:#r ssfslsfm dd-sssls sss-sfl.slt dsllsf-m N4: dddddd-d mfmdmsFs dfmrdf,ff-- dd#f, ffss-d -Y1:Andriamani\tra/Tompo ô!/Ray, Fanahy, Zanaka,/Mihainoa anay izao,/Ry_2Telo I\zay Iray. -Y2:Jeso Zanak'i Maria,/Naka endrik'olona/Tonga zaza toa anay:/Mihaino_a, Jeso ô! -Y3:Notafi_an-dreninao/Lamban-jaza Hi_anao/Tao anaty vilona:/Mihaino_a, Jeso ô! -Y4:Novangi_an'olona/I\zay ni_andry ondriny/Tao an-tsaham-Betlehe\ma;/Mihaino_a, Jeso ô! -Y5:Notezaina Hi_anao/Notrotroin'i Simeona,/Notompoin'i Ana koa;/Mihaino_a, Jeso ô! +Y1:Andriamani\tra/Tompo ô!/Ray, Fanahy, Zanaka,/Mihainoa anay izao,/Ry Telo I\zay Iray. +Y2:Jeso Zanak'i Maria,/Naka endrik'olona/Tonga zaza toa anay:/Mihainoa, Jeso ô! +Y3:Notafi_an-dreninao/Lamban-jaza Hi_anao/Tao anaty vilona:/Mihainoa, Jeso ô! +Y4:Novangi_an'olona/I\zay ni_andry ondriny/Tao an-tsaham-Betlehe\ma;/Mihainoa, Jeso ô! +Y5:Notezaina Hi_anao/Notrotroin'i Simeona,/Notompoin'i Ana koa;/Mihainoa, Jeso ô! +Y10:No\ho ny na\haterahanao/No\ho ny ranomasonao,/No\ho ny fahori_anao/Mamonje, ry Jeso! +Y11:No\ho ny satro-tsilonao,/No\ho ny ra nalatsakao,/No\ho ny nitsangananao/Mamonje, ry Jeso ! +Y12:No\ho ilay Anaranao/I_ondrehan’olona/Sy ny ao an-danitra/Mamonje, ry Jeso! +Y13:No\ho ny herinao tsito\ha/No\ho ny voninahitrao,/No\ho ny famindramponao;/Mamonje, ry Jeso!/ diff --git a/composeApp/src/commonMain/composeResources/files/ffpm-819-2.txt b/composeApp/src/commonMain/composeResources/files/ffpm-819-2.txt index 50a6ce9..64288e9 100644 --- a/composeApp/src/commonMain/composeResources/files/ffpm-819-2.txt +++ b/composeApp/src/commonMain/composeResources/files/ffpm-819-2.txt @@ -1,21 +1,10 @@ M0:|t:FFPM 819 (2) Andriamanitra Tompo ô ! Fizarana II|a:Anglikana (Litany for Children)|h:F.A.J. Hervey|c:D|m:3/4|r:7.7.7.7. -N1:mmmrmsffffmflsssFsdt,tld'tlsltls -N2:#t, dddrddtttttttmmrrrsrmdrmrdrdt -N3:sssssssssssssssslsmrfmlSltFFs -N4:dddt,dmrrrrDrfddt,dt,na,s,dl,t,drrrs, -Amin'ny avo-navona/Amin'ny faha teze-ras : –/Amin'ny fia-lonana;/Mamonje, ry/Jeso ! - -7. Amin'ny hevi-tsy madio, -Amin'ny teny ratsy koa, -Amin'ny faha sarotam-po -Mamonje, ry Jeso ! - -8. Hankatò ny didinao -Hankahala heloka, -Mba ho zanakao tokoa; -Mitariha, Jeso ! - -9. Mba hazoto izahay, -Tia fivavahana, -Tsy ho resin'i Satana ; -Mitariha, Jeso ! +U0:z8:22 y44 8/22 y44 (44)/22 y44 4/${f}4(22) ${dim.}8(y) 44 +N1: mmmrmsf fffmfls- sssFstl d'tlsltls +N2:#t, dddrddt ttttttdt mmrrrrm drmrdrdt +N3: sssssss sssssss- ssslsfm lSltF-Fs +N4:#s, dddtdmr rrrDrfmr ddtdtsd ltdrr-rs +Y6:Amin'ny\ avonavona/Ami\n'ny fa\hatezerana/Amin'ny fialonana;/Mamonje, ry Jeso! +Y7:Amin'ny\ hevi-tsy madio,/Ami\n'ny teny ratsy koa,/Ami\n'ny fa\hasarotam-po/Mamonje, ry Jeso! +Y8:Hankatò ny didinao/Hankahala heloka,/Mba ho zanakao tokoa;/Mitariha, Jeso! +Y9:Mba hazoto izahay,/Ti_a fivavahana,/Tsy\ ho resin'i Satana;/Mitariha, Jeso! diff --git a/composeApp/src/desktopMain/kotlin/mg/dot/feufaro/midi/MidiWriterKotlin-1.kt b/composeApp/src/desktopMain/kotlin/mg/dot/feufaro/midi/MidiWriterKotlin-1.kt deleted file mode 100644 index bed41be..0000000 --- a/composeApp/src/desktopMain/kotlin/mg/dot/feufaro/midi/MidiWriterKotlin-1.kt +++ /dev/null @@ -1,71 +0,0 @@ -package mg.dot.feufaro.midi - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import mg.dot.feufaro.FileRepository -import javax.sound.midi.* - -class `MidiWriterKotlin-1` (private val fileRepository: FileRepository) { - private val sequence = Sequence(Sequence.PPQ, 60) - private val track = sequence.createTrack() - private var tick: Long = 0 - private var nextTick: MutableList = mutableListOf() - private val noteOn = ShortMessage() - private val noteOff = ShortMessage() - private val lastPitch : MutableList = mutableListOf() - private val useChord : Boolean = true - fun addNote( voiceNumber: Int, note: Int, velocity: Int, tick: Long) { - var channel: Int = voiceNumber - 1 - if (useChord) { - channel = channel / 2 - } - var note = note - if (voiceNumber == 3 || voiceNumber == 4) { - note -= 12 - } - if (lastPitch.size > voiceNumber && lastPitch[voiceNumber] > 0) { - noteOff.setMessage(ShortMessage.NOTE_OFF, channel, lastPitch[voiceNumber], 0) - val n2 = noteOff.clone() as MidiMessage - track.add(MidiEvent(n2, tick)) - } - var velocity = velocity - if (note <= 0) { - note = 40 - velocity = 0 - } - noteOn.setMessage(ShortMessage.NOTE_ON, channel, note, velocity) - val n1: MidiMessage = noteOn.clone() as MidiMessage - track.add(MidiEvent(n1, tick)) - while(lastPitch.size <= voiceNumber) { - lastPitch.add(0) - } - lastPitch[voiceNumber] = note - } - fun save(filePath: String) { - val parseScope = CoroutineScope(Dispatchers.Default) - parseScope.launch { - val out = fileRepository.getOutputStream(filePath) - MidiSystem.write(sequence, 1, out) - out.close() - } - } - fun addMetaMessage(type: Int, tick: Int, nbData: Int, metaByteString: String) { - val byteArray = metaByteString.toByteArray() - val metaMessage = MetaMessage(type, byteArray, nbData) - track.add(MidiEvent(metaMessage, tick.toLong())) - } - fun process(pitches: List) { - val lastTick = 0 - nextTick.clear() - // addMetaMessage(0x59, 4, 2, 2,0) - tick = 0 - pitches.forEach { - if (it.metaType > 0) { - addMetaMessage(it.metaType, it.tick, it.metaByteSize, it.metaBytes) - } else if (it.pitch != "") { - addNote(it.voiceNumber, it.pitch.toInt(), 100, it.tick.toLong()) - } - } - } -} \ No newline at end of file