Page 1 of 7 123 ... LastLast
Results 1 to 10 of 68

Thread: HOWTO: Getting MIDI to work fully in Ubuntu

  1. #1
    Join Date
    Nov 2004
    Beans
    303

    HOWTO: Getting MIDI to work fully in Ubuntu

    MIDI: Getting to Create, Play, Anything with Ubuntu!

    Intro
    MIDI support has been asked for mostly musically involved people who use Linux, and it hasn't come easily. Most of the HOW-TOs for setting up MIDIs don't even work, and I'd know. So, today, after almost a month of working towards it, I've finally been able to listen, play, and create MIDIs with ease. It's actually not very difficult; you just need the right packages and a loaded GM Soundfont.

    Prerequisites
    - A MIDI enabled sound card (most people have a SoundBlaster Audigy or Live! card-- if you have onboard sound, meaning the motherboard does the MIDI work, you'll need to use FluidSynth, which I'll talk about later).
    - A fully working ALSA sound system.
    - A fully working OSS sound system. (in case the upper doesn't work, you can use this and then do a sudo modprobe snd-seq-oss)
    - The following ALSA packages installed (get these through apt-get/synaptic/aptitude): alsa-base, libasound, alsa-headers, libasound-dev, alsa-modules-2.4.26-1-686 (replace the 686 with 586, 386, k6, k7, etc. according to your system), alsa-oss, alsa-source.
    - A program that plays MIDI files. (KMid is a nice one)
    - The awesfx package if you are not using FluidSynth. (get this through apt-get)

    Blood, Sweat, and Tears time (not really)
    You've gotten past most of the work which took me the most time. Some of the packages you install may seem like overkill, but for people who use FluidSynth and have to compile it and other things, those packages are good to have just in case.

    Do an lsmod in the terminal. It should return something like this

    snd_seq_midi 8096 1
    snd_emu10k1_synth 6784 4
    snd_emux_synth 33408 5 snd_emu10k1_synth
    snd_seq_virmidi 7296 1 snd_emux_synth
    snd_seq_midi_emul 7680 1 snd_emux_synth
    snd_seq_oss 29440 0
    snd_seq_midi_event 7552 3 snd_seq_midi,snd_seq_virmidi,snd_seq_oss
    snd_seq 46608 19 snd_seq_midi,snd_emux_synth,snd_seq_virmidi,snd_se q_midi_emul,snd_seq_oss,snd_seq_midi_event
    nls_iso8859_1 4352 2
    nls_cp437 6016 2
    vfat 13312 2
    fat 41792 1 vfat
    i830 68644 6
    proc_intf 3968 0
    freq_table 4356 0
    cpufreq_userspace 5336 0
    cpufreq_powersave 2048 0
    button 6936 0
    ac 5132 0
    battery 9740 0
    ipv6 230020 8
    af_packet 20872 2
    8139too 23936 0
    8139cp 19072 0
    mii 4864 2 8139too,8139cp
    crc32 4608 2 8139too,8139cp
    emu10k1_gp 3840 0
    gameport 4736 1 emu10k1_gp
    snd_emu10k1 80776 11 snd_emu10k1_synth
    snd_rawmidi 23232 3 snd_seq_midi,snd_seq_virmidi,snd_emu10k1
    snd_pcm_oss 48168 0
    snd_mixer_oss 16640 3 snd_pcm_oss
    snd_pcm 85540 3 snd_emu10k1,snd_pcm_oss
    snd_timer 23172 2 snd_seq,snd_pcm
    snd_seq_device 7944 7 snd_seq_midi,snd_emu10k1_synth,snd_emux_synth,snd_ seq_oss,snd_seq,snd_emu10k1,snd_rawmidi
    snd_ac97_codec 59268 1 snd_emu10k1
    snd_page_alloc 11144 2 snd_emu10k1,snd_pcm
    snd_util_mem 4608 2 snd_emux_synth,snd_emu10k1
    snd_hwdep 9120 2 snd_emux_synth,snd_emu10k1
    snd 50660 27 snd_seq_midi,snd_emux_synth,snd_seq_virmidi,snd_se q_oss,snd_seq_midi_event,snd_seq,snd_emu10k1,snd_r awmidi,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer ,snd_seq_device,snd_ac97_codec,snd_util_mem,snd_hw dep
    soundcore 9824 3 snd
    pci_hotplug 30640 0
    ehci_hcd 27780 0
    uhci_hcd 29328 0
    usbcore 104292 4 ehci_hcd,uhci_hcd
    intel_agp 20512 1
    agpgart 31784 3 intel_agp
    pcspkr 3816 0
    rtc 12216 0
    floppy 54996 0
    md 44744 0
    dm_mod 51068 1
    capability 4872 0
    commoncap 7168 1 capability
    parport_pc 32064 1
    lp 10436 0
    parport 37320 2 parport_pc,lp
    tsdev 7168 0
    ide_cd 38276 0
    cdrom 35872 1 ide_cd
    evdev 9088 0
    mousedev 10124 1
    psmouse 17800 0
    ext3 109544 1
    jbd 54552 1 ext3
    ide_generic 1664 0
    piix 12576 1
    ide_disk 16768 5
    ide_core 125272 4 ide_cd,ide_generic,piix,ide_disk
    unix 25904 762
    fan 4236 0
    thermal 13200 0
    processor 17712 1 thermal
    font 8576 0
    vesafb 6688 0
    cfbcopyarea 3968 1 vesafb
    cfbimgblt 3200 1 vesafb
    cfbfillrect 3712 1 vesafb
    If you don't see any MIDI related modules (the important ones are snd_seq_midi,snd_emu10k1_synth,snd_emux_synth,snd_ seq_oss,snd_seq,snd_emu10k1,snd_rawmidi),
    then that means ALSA hasn't been configured properly. Try sudo modprobe for these modules, and see what results.

    Now, that you have MIDI devices working, go over to http://www.hammersound.net, go to Sounds -> Soundfont Library -> Collections (this is over at the bottom). Now, find a GM library which you think will sound good, etc. I am using the Ultimate GM/GS Soundfont collection, which can be downloaded through http://www.hammersound.net/cgi-bin/s...d=Ultimate.zip

    Now, download it to your home directory. This one should be in a ZIP file (note: if it is in sfArk form, continue reading), so simply unzip it and there should be a sf2 file inside it. Go to the terminal and do a sfxload thenameofthefile.sf2. It should return to a new $ line, and that is good. Go into KMid and open up a MIDI and it should work. You can use Rosegarden 4 (apt-get install rosegarden4) to create MIDIs with ease and a bit of musical knowledge.

    FLUIDSYNTH
    FluidSynth is a software synthesizer, meaning there is no hardware involved since your card doesn't support SoundFont synthesis (otherwise, you shouldn't be doing this, hehe). It obviously doesn't relay as much quality as hardware does, but that's a small price to pay. You can find their homepage at http://www.fluidsynth.org/.

    It can also be easily installed through apt-get. Once it is installed, open up your terminal and do this: fluidsynth -m alsa_seq ./thenameofthefilehere.sf2. This will load the soundfont into your computer's memory.

    Now, that wasn't difficult was it? Open up whatever MIDI program and you should be able to listen to your MIDIs.

    SFARK
    sfArk is a common compression method composers use to zip up their SoundFonts, and luckily, the company behind it has a Linux version of their utility. Download it at http://melodymachine.com/sfark.htm. It is a command-line based utility, but again, easy to use. Just do this: sfarkxtc ./thenameofthefilehere.sfArk

    That should decompress the sfArk and give you a .sf2 file. If it gives you any other kind (such as an EXE), that means you'll have to move onto another soundfont since this one won't be usable.

    CONCLUSION
    This hasn't been 100% tested, but it worked just fine for me and I hope it does for you as well. Post all of your errors, suggestions, comments, and I'll be happy to edit them into this. May your musical talent flourish with Ubuntu
    Last edited by Quest-Master; December 20th, 2004 at 08:41 PM.

  2. #2
    Join Date
    Dec 2004
    Beans
    75

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    Quote Originally Posted by Quest-Master
    MIDI: Getting to Create, Play, Anything with Ubuntu!

    Intro
    MIDI support has been asked for mostly musically involved people who use Linux, and it hasn't come easily. Most of the HOW-TOs for setting up MIDIs don't even work, and I'd know. So, today, after almost a month of working towards it, I've finally been able to listen, play, and create MIDIs with ease. It's actually not very difficult; you just need the right packages and a loaded GM Soundfont.

    Prerequisites
    - A MIDI enabled sound card (most people have a SoundBlaster Audigy or Live! card-- if you have onboard sound, meaning the motherboard does the MIDI work, you'll need to use FluidSynth, which I'll talk about later).
    - A fully working ALSA sound system.
    - A fully working OSS sound system. (in case the upper doesn't work, you can use this and then do a sudo modprobe snd-seq-oss)
    - The following ALSA packages installed (get these through apt-get/synaptic/aptitude): alsa-base, libasound, alsa-headers, libasound-dev, alsa-modules-2.4.26-1-686 (replace the 686 with 586, 386, k6, k7, etc. according to your system), alsa-oss, alsa-source.
    - A program that plays MIDI files. (KMid is a nice one)
    - The awesfx package if you are not using FluidSynth. (get this through apt-get)

    Blood, Sweat, and Tears time (not really)
    You've gotten past most of the work which took me the most time. Some of the packages you install may seem like overkill, but for people who use FluidSynth and have to compile it and other things, those packages are good to have just in case.

    Do an lsmod in the terminal. It should return something like this



    If you don't see any MIDI related modules (the important ones are snd_seq_midi,snd_emu10k1_synth,snd_emux_synth,snd_ seq_oss,snd_seq,snd_emu10k1,snd_rawmidi),
    then that means ALSA hasn't been configured properly. Try sudo modprobe for these modules, and see what results.

    Now, that you have MIDI devices working, go over to http://www.hammersound.net, go to Sounds -> Soundfont Library -> Collections (this is over at the bottom). Now, find a GM library which you think will sound good, etc. I am using the Ultimate GM/GS Soundfont collection, which can be downloaded through http://www.hammersound.net/cgi-bin/s...d=Ultimate.zip

    Now, download it to your home directory. This one should be in a ZIP file (note: if it is in sfArk form, continue reading), so simply unzip it and there should be a sf2 file inside it. Go to the terminal and do a sfxload thenameofthefile.sf2. It should return to a new $ line, and that is good. Go into KMid and open up a MIDI and it should work. You can use Rosegarden 4 (apt-get install rosegarden4) to create MIDIs with ease and a bit of musical knowledge.

    FLUIDSYNTH
    FluidSynth is a software synthesizer, meaning there is no hardware involved since your card doesn't support SoundFont synthesis (otherwise, you shouldn't be doing this, hehe). It obviously doesn't relay as much quality as hardware does, but that's a small price to pay. You can find their homepage at http://www.fluidsynth.org/.

    It can also be easily installed through apt-get. Once it is installed, open up your terminal and do this: fluidsynth -m alsa_seq ./thenameofthefilehere.sf2. This will load the soundfont into your computer's memory.

    Now, that wasn't difficult was it? Open up whatever MIDI program and you should be able to listen to your MIDIs.

    SFARK
    sfArk is a common compression method composers use to zip up their SoundFonts, and luckily, the company behind it has a Linux version of their utility. Download it at http://melodymachine.com/sfark.htm. It is a command-line based utility, but again, easy to use. Just do this: sfarkxtc ./thenameofthefilehere.sfArk

    That should decompress the sfArk and give you a .sf2 file. If it gives you any other kind (such as an EXE), that means you'll have to move onto another soundfont since this one won't be usable.

    CONCLUSION
    This hasn't been 100% tested, but it worked just fine for me and I hope it does for you as well. Post all of your errors, suggestions, comments, and I'll be happy to edit them into this. May your musical talent flourish with Ubuntu
    HI, bump!! Wow I have just found this, very useful for me. Iw ill try, and tell you if it works!

  3. #3
    Join Date
    Oct 2004
    Location
    Røyken, Norway
    Beans
    35
    Distro
    Ubuntu

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    FLUIDSYNTH
    Is what I have been looking for the last weeks. Will try when I come home.

  4. #4
    Join Date
    Nov 2004
    Beans
    303

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    Luckily, Fluidsynth is apparently a very easy to set up program. I have an SBLive! though, so no need for that.

    Also, many of you might have heard of Timidity, which is also a nice program, but for optimum quality, I suggest simply using the instructions provided if you have the proper soundcard, or use Fluidsynth as strips will be using.

  5. #5
    Join Date
    Nov 2004
    Location
    Ottawa, Canada
    Beans
    130
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    Something tells me that this isn't supposed to happen:

    jeramy@tuscany:~ $ lsmod |grep midi
    snd_seq_midi 8416 0
    snd_rawmidi 24704 1 snd_seq_midi
    snd_seq_midi_event 7552 2 snd_seq_oss,snd_seq_midi
    snd_seq 52176 5 snd_seq_oss,snd_seq_midi,snd_seq_midi_event
    snd_seq_device 8040 4 snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
    snd 55300 14 snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq_midi_ event,snd_seq,snd_seq_device,snd_maestro3,snd_ac97 _codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
    jeramy@tuscany:~ $ fluidsynth -m alsa_seq ./Ultimate.SF2
    cca_open_socket: could not connect to host 'localhost', service '14541'
    cca_init: could not connect to server 'localhost' - disabling ladcca
    fluidsynth: warning: Ignoring sample WhiteNoiseWave #03: can't use ROM samples
    fluidsynth: warning: Ignoring sample ColdGlass7Wave #04: can't use ROM samples
    fluidsynth: warning: Ignoring sample tbelld4wave: can't use ROM samples
    fluidsynth: warning: Ignoring sample SineWave #11: can't use ROM samples
    fluidsynth: warning: Ignoring sample FloorTomBrite #08: can't use ROM samples
    fluidsynth: warning: Ignoring sample AccordFx3 #02: can't use ROM samples
    fluidsynth: warning: Ignoring sample AccordAx2 #02: can't use ROM samples
    fluidsynth: warning: Ignoring sample AccordFx2 #02: can't use ROM samples
    fluidsynth: warning: Ignoring sample femalevoiceg2: can't use ROM samples
    fluidsynth: warning: Ignoring sample crash5: can't use ROM samples
    fluidsynth: warning: Ignoring sample xyloe4looped: can't use ROM samples
    fluidsynth: warning: Ignoring sample banjod3: can't use ROM samples
    fluidsynth: warning: Ignoring sample banjog2: can't use ROM samples
    fluidsynth: warning: Ignoring sample ocarinafx2: can't use ROM samples
    fluidsynth: warning: Ignoring sample organwavea3: can't use ROM samples
    fluidsynth: warning: Ignoring sample organwave: can't use ROM samples
    fluidsynth: warning: Ignoring sample octavewave: can't use ROM samples
    fluidsynth: warning: Ignoring sample chanterax1: can't use ROM samples
    fluidsynth: warning: Ignoring sample bagpipedrna: can't use ROM samples
    fluidsynth: warning: Ignoring sample pluckharp: can't use ROM samples
    fluidsynth: warning: Ignoring sample acbasse1: can't use ROM samples
    fluidsynth: warning: Ignoring sample pizzviolinc3: can't use ROM samples
    fluidsynth: warning: Ignoring sample brasssectf5: can't use ROM samples
    fluidsynth: warning: Ignoring sample brasssectc3: can't use ROM samples
    fluidsynth: warning: Ignoring sample bsawtoothwavea3: can't use ROM samples
    fluidsynth: warning: Ignoring sample sawstackwavems: can't use ROM samples
    fluidsynth: warning: Ignoring sample lefone: can't use ROM samples
    fluidsynth: warning: Ignoring sample ShakuA2: can't use ROM samples
    fluidsynth: warning: Ignoring sample SikuE2: can't use ROM samples
    fluidsynth: warning: Ignoring sample KPianoB5: can't use ROM samples
    fluidsynth: warning: Ignoring sample Timpani: can't use ROM samples
    ** Using format s16, rw, interleaved
    fluidsynth version 1.0.3
    Copyright (C) 2000-2002 Peter Hanappe and others.
    FLUID Synth comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it
    under certain conditions; see the COPYING file for details.
    SoundFont(R) is a registered trademark of E-mu Systems, Inc.

    Type 'help' to get information on the shell commands.

    >

    It's on an HP Omnibook 6000 with an AC97 sound card.

  6. #6
    Join Date
    Nov 2004
    Beans
    303

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    That's really weird. Did you try playing a MIDI after all of those warning stopped appearing? It appears that what will happen is that it'll only load some of the samples and use them. Probably because of how the soundfonts were created.

    I'd suggest looking for another soundfont collection over at http://www.hammersound.net/ and try to load it and see if it works.

  7. #7
    Join Date
    Dec 2004
    Beans
    75

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    Quote Originally Posted by CowPie
    HI, bump!! Wow I have just found this, very useful for me. Iw ill try, and tell you if it works!
    Hi, I try this yet no sound comes out?

    Luckily no more warnign about /dev/sequencer though

  8. #8
    Join Date
    Dec 2004
    Location
    Dublin, Ireland
    Beans
    21

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    I have a Soundblaster Digital 4.1 which AFAIK has sequencer hardware. The relevant modules are loaded as follows:
    Code:
    snd_seq_oss            29440  0
    snd_seq_midi_event      7552  2 snd_seq_midi,snd_seq_oss
    snd_seq                46608  6 snd_seq_midi,snd_seq_oss,snd_seq_midi_event
    snd_seq_device          7944  4 snd_seq_midi,snd_rawmidi,snd_seq_oss,snd_seq
    snd_pcm_oss            48168  0
    snd_pcm                85540  3 snd_bt87x,snd_ens1371,snd_pcm_oss
    snd_page_alloc         11144  2 snd_bt87x,snd_pcm
    snd_timer              23172  2 snd_seq,snd_pcm
    snd_mixer_oss          16640  1 snd_pcm_oss
    snd                    50660  16 snd_seq_midi,snd_bt87x,snd_ens1371,snd_rawmidi,snd_ac97_codec,snd_seq_oss,snd_seq_midi_event,snd_seq,snd_seq_device,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss
    soundcore               9824  2 bttv,snd
    Using Kmid appears to work - I can select the ALSA midi sequencer device, the "tempo" bar lights, but no sound plays. I have checked the volumes with alsamixer - nothing has any effect.

    Does anyone know if this card actually supports midi sequencer? Is the ensoniq module appropriate for this card? I can't locate the original docs, Creative's site is suprisingly general and the manual is unavailable online. According to Amazon it features:

    ...
    # 128-voice Wave-Table synthesiser for rich MIDI playback
    ...

    Attempting to get ScummVM to use the sequencer - with /dev/sequencer there is no error but no output either.

    Code:
    $ scummvm -ghq2x -eseq
    Switched to configuration /home/fuzzbucket/.scummvmrc
    Looking for tentacle
    Trying to start game 'Day Of The Tentacle'
    WARNING: IMuse doCommand(6) - setMasterVolume (74)!
    (the WARNING appears using the default emulated device too - it doesn't appear to have a negative effect)

    Code:
    Using ALSA:
    $ scummvm -ghq2x -ealsa
    Switched to configuration /home/fuzzbucket/.scummvmrc
    Looking for tentacle
    Trying to start game 'Day Of The Tentacle'
    (0:0:0x0): Can't subscribe to MIDI port (65:0)!
    Any help or suggestions at all appreciated!

    *edit* This page suggests a capable midi system.
    Last edited by fuzzix; December 27th, 2004 at 02:19 AM. Reason: Additional info.

  9. #9
    Join Date
    Dec 2004
    Location
    EU - Belgium
    Beans
    146

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    I managed to have Timidity working as a midi server and opening two midi ports, so that the command
    pmidi -p 128:0 mymusic.mid works
    See thread http://www.ubuntuforums.org/showthread.php?t=8286

    Alain

  10. #10
    Join Date
    Dec 2004
    Location
    Dublin, Ireland
    Beans
    21

    Re: HOWTO: Getting MIDI to work fully in Ubuntu

    Is that "emulated" - as in PCM data generated on the fly? The Timidity client doesn't perform very well here so I can only assume I'll have the same problems emulating a midi server (high CPU use, choppy output).

    Interesting functionality, though - if I had a faster machine I'd be right on it

Page 1 of 7 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •