sinshu / meltysynth

A SoundFont MIDI synthesizer for .NET
Other
130 stars 15 forks source link

Using NAudio with MeltySynth #39

Closed ImNicolasTheDev closed 1 year ago

ImNicolasTheDev commented 1 year ago

Hii ! I currently have a problem using your NAudio example. I'm using .NET 6.0, and when using NAudio.Wave, there is no WaveOut function. I'd like to play notes in real-time from a frequency (that I can convert to a note), and use a soundfont to play the note. Is this possible ? Is there any workaround ? Could you provide an example if possible ? I can't figure out how I can play the notes...

sinshu commented 1 year ago

If you are unable to use WaveOut even after installing NAudio from NuGet, it is highly likely that your project's settings are not correct. Since WaveOut is exclusive to Windows, please set the target OS to Windows in your project's settings.

It is possible to play notes in real-time with MeltySynth. However, the implementation depends on what kind of application you are envisioning. What kind of application are you considering? For instance, is it something like a virtual keyboard? Or is it something like a sequencer that automatically plays melodies?

ImNicolasTheDev commented 1 year ago

If you are unable to use WaveOut even after installing NAudio from NuGet, it is highly likely that your project's settings are not correct. Since WaveOut is exclusive to Windows, please set the target OS to Windows in your project's settings.

Thank you really much! Because WaveOut is exclusive to Windows, I just set the target OS to Windows, and it works! I was trying to find workarounds (which were not working), but now that I can use the sample properly, I can play notes with my keyboard.

It is possible to play notes in real-time with MeltySynth. However, the implementation depends on what kind of application you are envisioning. What kind of application are you considering? For instance, is it something like a virtual keyboard? Or is it something like a sequencer that automatically plays melodies?

I want to choose an instrument, and to be able to play the notes with my keyboard. It's indeed like a virtual piano :) Thank you again 👍