AZO234 / NP2kai

Neko Project II kai
http://domisan.sakura.ne.jp/article/np2kai/np2kai.html
MIT License
254 stars 62 forks source link

Is it appropriate to add ALSA midi support for X11 build? #34

Closed frank-deng closed 6 years ago

frank-deng commented 6 years ago

Is it appropriate to add ALSA midi support for X11 build, just like DOSBox does?

AZO234 commented 6 years ago

X11 build has MIDI Interface. ...But I don't know how to MIDI on Linux very much.

I study it.

AZO234 commented 6 years ago

I can use MIDI sound generator with UM-1 on X11 build.

  1. Connect UM-1
  2. Check you can see 'midi3' by '$ ls /dev' command
  3. Open xnp2kai
  4. Select xnp2kai's menu 'Device' -> 'MIDI option...'
    • Set '/dev/midi3' to 'MIDI-OUT' in ’Device' frame
    • Select 'MIDI-OUT device' to 'MIDI-OUT' in ’Assign' frame
  5. Press 'OK'

I tried with Touhou 2 (set MIDI option), I can listen MIDI sound.

Regard.

frank-deng commented 6 years ago

Thanks! And how to use timidity software synthesizer to play midi?

AZO234 commented 6 years ago

I tried timidity too. I could sound it. But sound is still a little strange.

It seems that timidity is incompatible with PulseAudio. By changing to ALSA output, I was able to play sound.

  1. install timidity
  2. $ aconnect -o This time, you can see Timidity port 128:0 to 128:3.
  3. $ timidity -iA -B2,8 -Os & Change output to ALSA. $ aconnect -o This time, you can see ALSAed Timidity port 129:0 to 129:3.
  4. $ sudo modprobe snd-virmidi Add virtual MIDI port module. $ aconnect -o This time, you can see VirMIDI 3-0 to 3-3 at 28:0 to 31:0. $ ls /dev/snd You can also see VirMIDI 3-0 to 3-3 at midiC3D0 to midiC3D3.
  5. $ aconnect 28:0 129:0 Connect VirMIDI 3-0 and ALSAed Timidity port 0.
  6. Finally set '/dev/snd/midiC3D0' to XNP2.

Adjusting timidity for SoundFonts and cfg files will make the sound even better.

frank-deng commented 6 years ago

Thanks! It works :+1: