fedden / RenderMan

Command line C++ and Python VSTi Host library with MFCC, FFT, RMS and audio extraction and .wav writing.
The Unlicense
355 stars 44 forks source link

Update midi buffer #18

Open jorshi opened 4 years ago

jorshi commented 4 years ago

Thanks so much for your work on this project. I'm working on a master's degree right now and focusing on automatic synthesizer programming - so your work on this and the other work you have published on deep learning for synthesizer programming has been extremely helpful!

I tracked down a bit of an issue with the way that midi notes are being added to the buffer. Timestamps in MidiMessages are ignored in the MidiBuffer.addEvent method (this is true for v5.2.0 as well). This is causing midi notes to be triggered on every buffer iteration. This is also occurring for the note off MidiMessages once they begin to be triggered (less of an issue, but since the timestamp is being used, the message isn't being triggered on the correct sample).

This PR fixes that by ensuring that only one note on MidiMessage is sent during the first buffer, and then the note off MidiMessage is being set to the correct sample in the buffer.

Here is a waveform test rendering of a sine wave with no amplitude envelope:

before: output_4_1

after: download

fedden commented 4 years ago

Hey @jorshi thanks for the PR. I'm unable to support this project in a professional capacity, so I am wondering if you would like to become a collaborator to get this project in a state that is hopefully usable for yourself and others?

jorshi commented 4 years ago

Hey @fedden thanks for the response - I would be pleased to become a collaborator on the project. Thank you for offering.

turian commented 3 years ago

@fedden take his offer! Allow him to be a collaborator so he can merge it :)

fedden commented 3 years ago

Please excuse my inactivity on this - it's been a weird year - @jorshi you should have an invite. Thank you for your contributions