Fix: adjust hold sustain timing 'D.D' templates and update template 'z22' to '•s'
This commit is contained in:
parent
8e18a8fcd7
commit
c9d6a09441
3 changed files with 14 additions and 7 deletions
|
|
@ -135,7 +135,7 @@ class ParseULine (var line: String, var measure: Int) {
|
||||||
val indexByFour = cursorX % 4
|
val indexByFour = cursorX % 4
|
||||||
var sequence = mapXLate[codeChar]!![indexByFour]!!
|
var sequence = mapXLate[codeChar]!![indexByFour]!!
|
||||||
if (charX == 'z') {
|
if (charX == 'z') {
|
||||||
sequence = sequence.replace('-', charX)
|
sequence = if (sequence == ".") "z." else sequence.replace('-', charX)
|
||||||
}
|
}
|
||||||
if (codeChar == 't') {
|
if (codeChar == 't') {
|
||||||
cursorX += 4
|
cursorX += 4
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,9 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
fun noteAt(voice: Int, idx: Int): String? = N.getOrNull(voice)?.oneVoiceNote?.getOrNull(idx)?.note
|
fun noteAt(voice: Int, idx: Int): String? = N.getOrNull(voice)?.oneVoiceNote?.getOrNull(idx)?.note
|
||||||
|
|
||||||
val allPrevSilent = N.indices.all { v -> isSilent(noteAt(v, nextNIndex)) }
|
val allPrevSilent = N.indices.all { v -> isSilent(noteAt(v, nextNIndex)) }
|
||||||
if (!allPrevSilent) {
|
val isExplicitDottedSilence = templateCharArray.getOrNull(index - 1)?.lowercaseChar() == 'z'
|
||||||
|
|
||||||
|
if (!allPrevSilent || isExplicitDottedSilence) {
|
||||||
if (unitObject.tuNotes.isEmpty()) {
|
if (unitObject.tuNotes.isEmpty()) {
|
||||||
unitObject.addMarker(it)
|
unitObject.addMarker(it)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ actual class FMediaPlayer actual constructor(
|
||||||
val tempoType: String = "",
|
val tempoType: String = "",
|
||||||
val endGridForTempo: Int = -1,
|
val endGridForTempo: Int = -1,
|
||||||
val targetTempoMultiplier: Float = 0.6f,
|
val targetTempoMultiplier: Float = 0.6f,
|
||||||
val newBpm: Float? = null
|
val newBpm: Float? = null,
|
||||||
|
val template: String = ""
|
||||||
)
|
)
|
||||||
private val navigationSteps = mutableListOf<NavigationStep>()
|
private val navigationSteps = mutableListOf<NavigationStep>()
|
||||||
|
|
||||||
|
|
@ -315,7 +315,8 @@ actual class FMediaPlayer actual constructor(
|
||||||
marker,
|
marker,
|
||||||
currentIndex,
|
currentIndex,
|
||||||
isHold = true,
|
isHold = true,
|
||||||
beatInDC = beat
|
beatInDC = beat,
|
||||||
|
template = midiMarker.template
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
println("Point d'orgue (\uD834\uDD10) mémorisée au grille n° ${midiMarker.gridIndex}")
|
println("Point d'orgue (\uD834\uDD10) mémorisée au grille n° ${midiMarker.gridIndex}")
|
||||||
|
|
@ -577,9 +578,13 @@ actual class FMediaPlayer actual constructor(
|
||||||
step.isHold -> {
|
step.isHold -> {
|
||||||
val currentBpm = sequencer?.tempoInBPM ?: targetBpm
|
val currentBpm = sequencer?.tempoInBPM ?: targetBpm
|
||||||
val beatMs = (60_000 / currentBpm).toLong()
|
val beatMs = (60_000 / currentBpm).toLong()
|
||||||
val holdDuration = if (step.beatInDC == 2) beatMs / 2 else beatMs * 2
|
val holdDuration = if (step.beatInDC == 2) beatMs / 1 else beatMs * 2
|
||||||
|
|
||||||
println("POINT D'ORGUE sur Grille $currentIndex | Durée: ${holdDuration}ms")
|
val qIndex = step.template.count { it == 'D' }
|
||||||
|
if (qIndex > 1) {
|
||||||
|
val firstPartDelay = beatMs / qIndex
|
||||||
|
delay(firstPartDelay)
|
||||||
|
}
|
||||||
|
|
||||||
synthetizer?.channels?.forEach { it?.controlChange(64, 127) }
|
synthetizer?.channels?.forEach { it?.controlChange(64, 127) }
|
||||||
val previousFactor = sequencer?.tempoFactor ?: 1.0f
|
val previousFactor = sequencer?.tempoFactor ?: 1.0f
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue