LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.15k stars 1.01k forks source link

Lb302 does not reset state before/after export #7234

Open michaelgregorius opened 6 months ago

michaelgregorius commented 6 months ago

Lb302 does not reset it's state before/after an export. Therefore if you export a project twice the Lb302 tracks will differ in phase.

Expected Behaviour

The exports should be identical.

Steps To Reproduce

  1. Decompress the attached file 7223-Lb302-Project.zip.
  2. Open the project.
  3. Export the project into First.wav.
  4. Export the project into Second.wav.
  5. Compare the files in an audio editor.

Please also refer to the comments starting from here for more details: https://github.com/LMMS/lmms/pull/7230#issuecomment-2081367349

firewall1110 commented 3 months ago

Not only Lb302 ... :

https://github.com/user-attachments/assets/48e7db17-100a-410a-950f-73193608e702

Is it bug ?

michaelgregorius commented 3 months ago

Might be. What are the affected instruments that do not null in the two exports? Can you do isolated tests with them, i.e. not in such a complex project?

firewall1110 commented 3 months ago

Produce only similar output: Kicker, Triple Oscilator, LB302, Organic, Vibed, ZynAddSubFx Some "stars": OpulenZ, VeSTige :: DSK Harmonica Little noise shadow: Nescaline

Tested also (produce the same result): Mallets, Monstro, Watsyn, PATMAN (095_Sweep_Pad), SID, Xpressivo, AUDIO FILE Processor, SF2 :: MSGM_Flute.sf2, LV2 :: MDA Piano Tested with lmms-1.3.0-alpha.1.102+g89fc6c9-linux-x86_64.AppImage

Project: st2004_08_05.mmpz.zip

firewall1110 commented 3 months ago

And this is why I think , that it is not a bug:

https://github.com/user-attachments/assets/0b59ea3d-a22f-4dd6-b24d-e0c16cd75641

Used PRO DAW, PRO ReWire and VST soft.synths ...

michaelgregorius commented 3 months ago

Produce only similar output: Kicker, Triple Oscilator, LB302, Organic, Vibed, ZynAddSubFx Some "stars": OpulenZ, VeSTige :: DSK Harmonica Little noise shadow: Nescaline

Tested also (produce the same result): Mallets, Monstro, Watsyn, PATMAN (095_Sweep_Pad), SID, Xpressivo, AUDIO FILE Processor, SF2 :: MSGM_Flute.sf2, LV2 :: MDA Piano Tested with lmms-1.3.0-alpha.1.102+g89fc6c9-linux-x86_64.AppImage

Project: st2004_08_05.mmpz.zip

So if I understand correctly the instruments in the top lists do not null and the ones in the list below do?

michaelgregorius commented 3 months ago

And this is why I think , that it is not a bug: prodaw_state.mp4

Used PRO DAW, PRO ReWire and VST soft.synths ...

I don't understand why it follows from that video that it is not a bug?

firewall1110 commented 3 months ago

Yes "Tested also (produce the same result): " are "good". (noise shadow, and "stars" - are small artifacts)

In last video I demonstrate, that the same thing is in other DAW&SoftSynth, that used in PRO purpose. In this case LMMS and LMMS synth are more accurate (in prodaw_state.mp4 near all instruments are "bad", and it depends on preset : except two solo (one is "good", but another "bad"), others are one 16 midi channel ReWire synth, and some (string, piano, base drums) sounds are "good" ).

Why sound is only similar? (1) Instruments are using LFO period generator, that often not triggered by note on, but "rotate" all the time. (2) Instrument using some kind of randomization - "human style" imitation.

michaelgregorius commented 3 months ago

Yes, it might indeed be a shortcoming of some of the LMMS synths. In VSTs and other synths you often have the option to enable or disable phase reset for the oscillators and LFOs. With phase reset enabled they should more or less sound the same on each rendering when the phase reset is triggered by notes.

firewall1110 commented 3 months ago

Quote: "more or less sound the same" My opinion is that all LMMS "bad" synths more or less sound the same on each rendering even now. So it is some kind of taste question.

And my opinion: if something even can be treated as taste question - it is not bug. Bug is something objective - not depending on any subjective opinion.

Now I try to formulate this as a programmer: "Lb302 does not reset state before/after export" - this is some kind convention violation. Is it written in Lb302 specification? Is in LMMS standards is written that all LMMS synths MUST reset state before/after export? If no - it is not bug.

P.S. My opinion is: DO NOT write something like this in any LMMS standard! Only after LMMS became top 10 professional DAW - than we can open discussion about this question.

michaelgregorius commented 3 months ago

@firewall1110, if you check comment https://github.com/LMMS/lmms/pull/7230#issuecomment-2081367349 you will find that Lb302 renders in a deterministic way on the first render. Once the render is through the instance stays in an "in between" state that IIRC also is not caused by the instruments being run all the time or something similar. So for me this has rather a bug character.

Now I try to formulate this as a programmer: "Lb302 does not reset state before/after export" - this is some kind convention violation. Is it written in Lb302 specification? Is in LMMS standards is written that all LMMS synths MUST reset state before/after export? If no - it is not bug.

As a software engineer I know that specifications can be quite useful. However, to my knowledge LMMS does not really have specifications for its software components. If I follow your logic then this means that LMMS does not have any bugs, either. :wink:

P.S. My opinion is: DO NOT write something like this in any LMMS standard! Only after LMMS became top 10 professional DAW - than we can open discussion about this question.

IMO a lot of things have to be fixed before LMMS can enter the top 10 of professional DAWs. So we should not make work on LMMS and agreeing on things without a specification dependent on that state.

firewall1110 commented 3 months ago

Quote: "if you check comment https://github.com/LMMS/lmms/pull/7230#issuecomment-2081367349 you will find that Lb302 renders in a deterministic way on the first render. Once the render is through the instance stays in an "in between" state"

Now I understand Your position - (Yes) this has rather a bug character. (Off topic: If Lb302 works in a deterministic way, except after render: may be something is not complete in rendering process - problem not in Lb302 code? Can we somehow test ("trace") what happens with synth when simply play , and when rendering happens (and compare)?)

Quote: " If I follow your logic then this means that LMMS does not have any bugs, either."

In this case LMMS does not have any bugs of "convention violation" type. But have functional bugs - in current master Lb302 has no sound at all ... , have regressions - SID has regression, I am not sure about sound, but XRun-s with Jack ...
Have GUI problems - there are no specifications in LMMS, but we have some common conventions, how good GUI should be ...

P.S. Probably my English is so bad but thinking is so complicated: sometimes You only partially understand, what I write ...

firewall1110 commented 3 months ago

Now I export in different way: open LMMS + project export close LMMS open LMMS + project export close LMMS (LMMS configured to load last project on start).

Results are:

Produce only similar output: Kicker, Triple Oscilator, Organic, Vibed Little noise shadow: Nescaline

Tested also (exact the same sound): Mallets, LB302, Monstro, OpulenZ, Watsyn, PATMAN (095_Sweep_Pad), SID, Xpressivo, ZynAddSubFx, AUDIO FILE Processor, SF2 :: MSGM_Flute.sf2, LV2 :: MDA Piano, VeSTige :: DSK Harmonica.

P.S. Now LB302 became "good" ... as You wrote ...