c# - Midi-dot-net playing notes simultaneously and to high delay -
after resolving problem noteon key event (thank justin) noticed 2 problems: high delay , impossible playing simultaneously.
firstable use if statment:
if (nutka == "a0" && msg.velocity != 0) { clock.schedule(new noteonmessage(outputdevice, channel.channel1, pitch.a0, 80, 2)); }
and works excelent, no delay, allows me use midi pitch not .wav files.
when use other possibility play note (from files added resources):
soundplayer notea0 = new soundplayer(properties.resources.a0); notea0.play();
looks , works ok soundplayer don't allow me play notes simultaneously.
another way trying wmp library:
var notea0 = new wmplib.windowsmediaplayer(); notea0.url = @"c:\sounds\piano\a0.wav";
ok... plays simultaneous kind funny thing happens, more notes play bigger delay (delay between press key , hear sound) have , programm stuck on playing (still got noteon messages)...looks memory buffer gone or that?
the last thing trying check directx library:
audio notea1 = new audio(@"c:\sounds\piano\a1.wav"); notea1.play();
build , compile - no problems, without errors, when pressed key on midi device, application returns message:
an unhandled exception of type 'system.badimageformatexception' occurred in midi.dll additional information: not load file or assembly 'microsoft.directx.audiovideoplayback.dll' or 1 of dependencies. not valid win32 application. (exception hresult: 0x800700c1)
my question is - possible add files (.wav) solution resources , play them simultaneously delay allow me play normal piano? normal piano mean low delay, unnoticeable delay.
Comments
Post a Comment