Parcourir la source

Issue #309 export: one-step notes keep their length only on LYNX Samplers with an ADSR

An FL project's own Sampler (FL's voice, SamplerSettings::flChannel) keeps its step notes as
steps, so its .flp round trip stays FL's (gold: Treben RawFL's 32 step notes went out one step
long in c2901c6bd, unlike FL's file). The import side of FL's held steps on enveloped Samplers
is QUEUE-0.1.33 #24.
Ka1-S il y a 1 semaine
Parent
commit
bbabdbfea1
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      src/core/FlpExport.cpp

+ 4 - 2
src/core/FlpExport.cpp

@@ -1466,8 +1466,10 @@ struct Converter
                 // Only on a channel that plays a sample: FL holds a step note on a generator (3x Osc, a plugin)
                 // until something cuts it, so the voices pile up (FL render, round 171e)
                 // A slide note keeps its length (length 0 would move the notes at once) unless it has none (issue #272)
-                const auto step = (! n.slide && n.length == ticksPerStep && n.start % ticksPerStep == 0 && playsSample (n.channel)
-                                   && ! volumeEnvelopeOn (n.channel))
+                // (round 190rt: not on a LYNX Sampler whose ADSR turns FL's volume envelope on — FL would hold the step;
+                // an FL project's own Sampler keeps its steps as steps, so its round trip stays FL's: QUEUE-0.1.33 #24)
+                const auto lynxEnvelope = volumeEnvelopeOn (n.channel) && song.channels[(std::size_t) n.channel].sampler.flChannel.empty();
+                const auto step = (! n.slide && n.length == ticksPerStep && n.start % ticksPerStep == 0 && playsSample (n.channel) && ! lynxEnvelope)
                                   || n.heldStep() || stepslide::is (n);
                 f.length = step ? 0 : std::max<std::uint32_t> (1, ticks (n.length));
                 f.channel = (std::uint16_t) n.channel;