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

View file

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