Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
atsushieno opened this issue Jul 9, 2020 · 9 comments
Closed

Comments

@atsushieno
Copy link
Owner

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 atsushieno changed the title regression: most of MIDI synths do not generate audio output on hosts regression: most of MIDI synths do not generate valid audio output on hosts Jul 9, 2020
@atsushieno
Copy link
Owner Author

Magical8bitPlug2 now generates sound on aaphostsample.

@atsushieno
Copy link
Owner Author

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
Copy link
Owner Author

Magical8bitPlug2 generates sound on AudioPluginHost too.

The differences between aaphostsample and AudioPluginHost are:

  • aaphostsample is based on static audio generation with timestamped MIDI inputs. Therefore, if there is any issues around timestamping, the result will be bogus. Also, the default buffering slice is huge, like 44100 frames.
  • AudioPluginHost is based on real time inputs (on-screen MIDI keyboard). It does not involve timestamps. And buffering is "normal", like 1024 frames, so it involves more frequent audio processing.

@atsushieno atsushieno changed the title regression: most of MIDI synths do not generate valid audio output on hosts regression: some MIDI synths do not generate valid audio output on hosts Jul 10, 2020
@atsushieno
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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 added a commit that referenced this issue Jul 10, 2020
context: #14 (comment)

[This LV2Wrapper implementation](https://github.com/jpcima/JUCE/blob/develop%2Blv2/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp) also implements AudioPlayhead, and IIRC JUCE VST3Wrapper also does.
atsushieno added a commit that referenced this issue Jul 10, 2020
context: #14 (comment)

This fixes SARAH, Dexed, and OB-Xd i.e. everything started to generate sound.
It is because all those synths use juce::Synthesizer which calls
AudioBuffer.getWritePointer(0) (note this 0 part) i.e. it is order dependent.
@atsushieno
Copy link
Owner Author

atsushieno commented Jul 10, 2020

With af6d79d all those sample synths are working with aaphostsample!

@atsushieno
Copy link
Owner Author

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
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant