File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_use_midi_devices_with_netbsd.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Sun Nov 20 20:55:21 2011 UTC (2 years, 4 months ago) by mspo
Branches: MAIN
CVS tags: HEAD
import all of the how-to articles from the pkgsrc.se wiki

**Contents**

[[!toc levels=2]]

#  Supported hardware 

##  Creative Music System 

Very old and rare synthesizer. 

See cms(4). 

##  PC speaker 

It has one-voice polyphony and sounds just awful. Useful only for testing MIDI input devices. 

See pcppi(4). 

##  Roland MPU-401 

MIDI interface by Roland. It became popular thanks to excessive cloning. 

Supported on many ISA cards, and following PCI cards: 

  * C-Media CMI8738 - cmpci(4) - support broken in NetBSD 4.0? 
  * ESS Solo-1 - eso(4) 
  * ForteMedia FM801 - fms(4) 
  * Yamaha DS-1 - yds(4) 

Usually MPU interfaces are conncted to MIDI/Joystick port on sound cards. You won't be able to play/receive anything unless you connect some external MIDI device to such port. Though, in some rare cases MPU interface is connected to on-board/daughterboard WaveTable MIDI engine. 

See mpu(4). 

##  Simple MIDI interfaces 

Simple MIDI interfaces are supported on many ISA cards, and following PCI cards: 

  * Cirrus Logic CS4280 - clcs(4) 
  * Creative Labs SoundBlaster PCI (Ensoniq AudioPCI based) - eap(4) 
  * Trident 4DWAVE and compatibles - autri(4) 

Usually simple MIDI interfaces are connected to MIDI/Joystick port on sound cards. You won't be able to play/receive anything unless you connect some external MIDI device to such port. 

Note: MIDI port and synth on SoundBlaster Live! and newer cards by Creative is unsupported. 

##  USB MIDI devices 

Many USB MIDI devices are supported. Synth modules, keyboards and MIDI interfaces are handled well. 

See umidi(4). 

##  Yamaha OPL2 and OPL3 

Popular single-chip FM synthesizer. Almost all ISA cards come with such chip. 

Some of the newer cards have compatbile FM engine too. PCI cards based on following chipsets have it: 

  * C-Media CMI8738 - cmpci(4) - opl support broken in NetBSD 4.0? 
  * ESS Solo-1 - eso(4) 
  * ForteMedia FM801 - fms(4) 
  * S3 SonicVibes - sv(4) 
  * Yamaha DS-1 - yds(4) 

NetBSD opl driver has built-in General MIDI instrument definitions, so your system is ready to play without additional configuration. 

Note: New PCI cards by Creative Labs do not have this chip. 

See opl(4). 

#  Identifying MIDI devices 

You can easily discover what kind of MIDI devices are available - try grepping dmesg: 
    
    dmesg | grep midi
    

Sample output: 
    
    midi0 at pcppi1: PC speaker (CPU-intensive output)
    midi1 at opl0: Yamaha OPL3 (CPU-intensive output)
    umidi0 at uhub1 port 2 configuration 1 interface 1
    umidi0: Evolution Electronics Ltd. USB Keystation 61es, rev 1.00/1.13, addr 2
    umidi0: (genuine USB-MIDI)
    umidi0: out=1, in=1
    midi2 at umidi0: <0 >0 on umidi0
    

In this case three MIDI devices are detected - PC speaker, Yamaha OPL3 and USB MIDI device (Keystation 61es keyboard in this case). 

#  Connecting MIDI devices 

Connecting MIDI devices is very simple. For example if you want to drive OPL3 using USB MIDI keyboard try: 
    
    cat /dev/rmidi2 > /dev/rmidi1
    

You can now play :). 

#  MIDI software for NetBSD 

Utility called **midiplay** comes with NetBSD. 


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb