atsushieno / aap-juce

AAP (Audio Plugins For Android) JUCE integration.
GNU General Public License v3.0
15 stars 1 forks source link

regression: some MIDI synths do not generate valid audio output on hosts #14

Closed atsushieno closed 4 years ago

atsushieno commented 4 years ago

While JUCE AudioPluginHost generates some audio outputs for Andes, it only generates noises on OBXd and Magical8bitPlug2. And no synth generates valid sound on aaphostsample.

Since MDA pianos generate valid outputs on both hosts it is specific to JUCE based instruments. Weird is that Andes still generates audible sound on aaphostsample...

It is confirmed on juce6 branch.

atsushieno commented 4 years ago

Magical8bitPlug2 now generates sound on aaphostsample.

atsushieno commented 4 years ago

SARAH: the plugin indeed processes note events, but for the final float outpu for each cycle, it is aeg (amp EG) * osc but osc only goes up around 0.13 and aeg not likely much higher, so I assume the final wav output is almost quiet.

atsushieno commented 4 years ago

Magical8bitPlug2 generates sound on AudioPluginHost too.

The differences between aaphostsample and AudioPluginHost are:

atsushieno commented 4 years ago

I figured out why OB-Xd does not generate output - it expects AudioPlayHead (via getPlayHead()) exists. Without that it does not call synth.setPlayHead() and no synthesis results are given back.

atsushieno commented 4 years ago

OB-Xd still fails to generate audible results even after I implemented AudioPlayback for JuceAAPWrapper. But I think I figured out why it happens.

ObxdAudioProcessor::processMidiPerSample() handles all the midi inputs in the buffer at AudioProcessor.processBlock() and for current aaphostsample, that means those note-off messages are handled at the same time.

Therefore, what would "fix" the problem is, that we implement aaphostsample MIDI messaging to not send note-offs in the same packet. It should be fairly doable.

atsushieno commented 4 years ago

That was only part of the problem. Problem # 2 is that OBXdAudioProcessor (or any audio hprocessor?) expects output channels come first then input channels follow, whereas we handle the other way. Not sure if there is any indication on which pointer is which.

atsushieno commented 4 years ago

With af6d79d all those sample synths are working with aaphostsample!

atsushieno commented 4 years ago

juceaaphost is still weird. OB-Xd always crashes. Any other synths generate sound, but their key is weird. Also it frequently crashes. Needs further investigation.

atsushieno commented 4 years ago

Since juceaaphost issue smells like another kind of bug, I would close this issue and file new one.