Fix! note duration after triolet on midi

This commit is contained in:
Hasinjato 2026-08-11 11:06:40 +03:00
parent a883090d0f
commit aaee37d7f7
2 changed files with 9 additions and 17 deletions

View file

@ -2108,7 +2108,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
val lineChar = lineRepeated.toCharArray()
lineChar.forEach {
when (it) {
'|', ':', '!', '/', '&' -> {
'|', ':', '!', '/' -> {
if (it == '|' && lastIt == '[') {
// le séparateur split
} else if (lastIt == '|' || lastIt == ':' || lastIt == '!' || lastIt == '/') {
@ -2169,17 +2169,14 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
'D', 'R', 'F', 'S', 'T',
'-', 'Z', 'z'
-> {
if (trioletCount == 2) {
trioletCount = 1
midiDuration = nextTrioletDuration / 2
nextTrioletDuration = nextTrioletDuration - midiDuration
val isTripletNote = trioletCount >= 0
if (isTripletNote) {
midiDuration = 20
pushMidi()
nextDuration = nextTrioletDuration
} else if (trioletCount == 1) {
midiDuration = nextDuration
pushMidi()
trioletCount = 0
nextTrioletDuration = 0
trioletCount--
if (trioletCount < 0) {
nextDuration = 60
}
}
var noteString = it.toString().lowercase()
if (it == 'D' || it == 'R' || it == 'F' || it == 'S') {
@ -2194,7 +2191,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
newN.addItem(noteString)
when (noteString) {
"-" -> {
midiDuration += nextDuration
midiDuration += if (nextDuration > 0) nextDuration else 20
nextDuration = 0
}

View file

@ -735,11 +735,6 @@ actual class FMediaPlayer actual constructor(
.maxByOrNull { it.gridIndex }
?.dynamic ?: Dynamic.MF
currentDynamicFactor = lastDynamic.factor
navigationSteps.forEach { step ->
if (step.gridIndex > gridIndex) {
step.alreadyDone = false
}
}
applyVoiceStates()
}