<Sound Dev> MIDI to audio files

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Jan 7 20:55:01 UTC 2019


On 07/01/2019 12:29, Alan Snyder wrote:
> Your suggestion works and requires less code, but it is not the best fit for my use case.

Yes, in this case you will need to write data to something like ByteArrayOutputStream, and read it back by AudioSystem.
The code will be small comparing to AudioSynthesizer, is the coping of data is a really a big problem and does it play a role in slowness the program?


> 
> In my case, I have already constructed a Sequence. To use your suggestion, I must convert the sequence to MIDI data so that I can provide it as an InputStream to AudioSystem, where the first thing that happens is that the data is parsed back into a Sequence.
> 
> I see no public way to get a Sequence directly to SoftMidiAudioFileReader.
> 
>    Alan
> 
> 
> 
>> On Jan 7, 2019, at 11:20 AM, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:
>>
>> Hi, Alan.
>>
>> I guess it should work using AudioSystem, which for midi files
>> should work on top of com.sun.media.sound.SoftMidiAudioFileReader
>>
>> On 06/01/2019 18:19, Alan Snyder wrote:
>>> As far as I can tell, the ability to synthesize audio into files from MIDI was lost during the great Java modularization due to the failure to export the AudioSynthesizer interface.
>>> Is there some reason this has not been fixed?
>>> See JDK-8170518 <https://bugs.openjdk.java.net/browse/JDK-8170518>, which I filed in 2016.
>>>    Alan
>>
>>
>> -- 
>> Best regards, Sergey.
>>
> 


-- 
Best regards, Sergey.


More information about the sound-dev mailing list