The Straight Dope

Go Back   Straight Dope Message Board > Main > Cafe Society

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2011, 08:11 AM
ticker ticker is offline
Guest
 
Join Date: Apr 2000
Software for M-AUDIO KeyRig 49 keyboard?

I have just been given an M-AUDIO KeyRig 49 usb music (midi?) keyboard. I want it because I am trying to teach myself piano from this book and I wanted something to practice on when I can't get to my girlfriend's piano. What I don't have is any software to go with it - the donor has lost the disc it came with . It seems to have installed a driver ok when plugged in to my Windows 7 64 pc but I need some software to use with it - cheap or ideally free. I don't need anything fancy - just something which can make a reasonably piano-ish sound when I hit the keys. I have never used music software before so I don't really know what to expect.

Any suggestions or advice?
Reply With Quote
Advertisements  
  #2  
Old 04-15-2011, 12:53 AM
mikews99 mikews99 is offline
Guest
 
Join Date: Oct 2007
There aren't any few free or low cost stand-alone piano modules available. You will have to put together separate pieces of software and do some configuring and setup yourself, but once you've setup everything properly you should be able to load and go.

First, you'll need something that contains a piano sound. 4Front Piano is a VST instrument (VSTi) that's free and sounds good.

Next, you'll need something that can load this VSTi. The simplest Windows VSTi host is SAVIHost. You rename the SAVIHost executable to match the VSTi plugin name (with the 4Front piano for instance, it's "4Front Piano.exe") and it will automatically load the plugin when launched.

Finally, if you don't have a professional soundcard with ASIO drivers, go get ASIO4All which will create an ASIO driver wrapper around your Windows soundcard. This is necessary if you expect to play with low latency on your built-in-the-motherboard Windows soundcard.

Start the renamed SAVIHost, go to the Devices menu, select your keyboard for MIDI input, ASIO4All for Wave output, then select Asio Control Panel to bring up ASIO4All. Select only your main audio output (usually something like "High definition audio device") and set your latency for as low as possible without getting clicks/pops/distortion.

Once you get everything working, just load the renamed SAVIHost whenever you want to play.
Reply With Quote
  #3  
Old 04-15-2011, 04:22 AM
ticker ticker is offline
Guest
 
Join Date: Apr 2000
I found Anvil Studio, a restricted freeware app which does much more than I need right now. Despite a clunky interface I managed to do what I originally wanted - get it to play a piano-like sound when I hit the Midi keyboard - without recourse to the documentation.
Reply With Quote
  #4  
Old 04-15-2011, 06:35 AM
MC$E MC$E is offline
Guest
 
Join Date: Jun 2002
I was about to ask this exact question, thank you!
Reply With Quote
  #5  
Old 04-16-2011, 04:25 PM
Jaledin Jaledin is offline
BANNED
 
Join Date: Jun 2006
Posts: 2,061
I used to love SAVIHost when I was trying out softsynths. At the time I was using it, it was the simplest way to test whatever you wanted without bothering to load a full audio sequencer.

IIRC, there's a free VSTi called "MrRay73" (or once was) that was a pretty good Rhodes piano instrument.

If ASIO4All doesn't work, you will need to pay for a soundcard with ASIO drivers, IMHO. I've used an inexpensive M-Audio USB 1.1 (can't remember the model number -- UA1EX I think) with good results, on an old box. Even slow USB worked fine for the audio for me on an ancient PC with under 200MB of RAM.

Gotta get that audio latency way down if you don't want to play a fugue, sit back, and hear it come out of your monitors a second after finishing the entire piece.

ETA: didn't see your update, ticker. Sounds like you're all set!

Last edited by Jaledin; 04-16-2011 at 04:27 PM.
Reply With Quote
  #6  
Old 04-17-2011, 05:04 AM
ticker ticker is offline
Guest
 
Join Date: Apr 2000
I have found that the Java sound API is quite straightforward for java programmers. I was able to create a very simple app which connects my keyboard to a basic software synth in just a handful of line of code. Easier to use than the Anvil Studio and it should be fairly easy to extend to play other instruments other than the default piano.
Reply With Quote
  #7  
Old 04-17-2011, 08:47 PM
Anamorphic Anamorphic is offline
Guest
 
Join Date: Sep 2000
Quote:
Originally Posted by mikews99 View Post
There aren't any few free or low cost stand-alone piano modules available. You will have to put together separate pieces of software and do some configuring and setup yourself, but once you've setup everything properly you should be able to load and go.
I'm seriously not trying to turn this into a Mac/Windows debate thread (I hate those), and I realize this piece of advice is no help to the OP... but in case anyone else stumbles on to the thread with the same question, GarageBand is a pretty great piece of software that comes with every new Mac and works well with the M-Audio KeyRig.
Reply With Quote
  #8  
Old 04-19-2011, 12:11 PM
BigT BigT is offline
Guest
 
Join Date: Aug 2008
Quote:
Originally Posted by ticker View Post
I have found that the Java sound API is quite straightforward for java programmers. I was able to create a very simple app which connects my keyboard to a basic software synth in just a handful of line of code. Easier to use than the Anvil Studio and it should be fairly easy to extend to play other instruments other than the default piano.
Would you provide the source? I'd love to see it. I do better with working code than guides,

My dream is to have a program that can take my Midi input, make certain modifications and send it back. Seeing how a programming language handles midi would be useful if I wind up eventually having to roll my own.

I'm also bookmarking this thread for the sound font when I will eventually try hooking up my new (to me) keyboard to my new (to me) laptop. (Best birthday presents I've ever gotten.)

EDIT: PM me if you don't want to share it with the Internet at large.

Last edited by BigT; 04-19-2011 at 12:12 PM.
Reply With Quote
  #9  
Old 04-21-2011, 01:38 AM
ticker ticker is offline
Guest
 
Join Date: Apr 2000
Quote:
Originally Posted by BigT View Post
Would you provide the source? I'd love to see it. I do better with working code than guides,
Embarrassingly crude Java code to use Midi keyboard as simple piano:
Code:
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Synthesizer;
import javax.sound.midi.Transmitter;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class MiniMidi extends JFrame{
    
    private JLabel synthStatusText, transStatusText, connectionStatusText;
    private JButton connectButton, closeButton;

    private Synthesizer synth = null;
    private Transmitter transmitter = null;

    public MiniMidi(){
        super("Mini Midi Piano");
        buildWindow();
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        addWindowListener(new WindowAdapter(){
            @Override
            public void windowClosed(WindowEvent e) {
                tearDownMidi();
            }

        });

    }

    private void buildWindow(){

        setSize(200, 150);
        Container content = getContentPane();
        content.setLayout(new BorderLayout());

        //  Buttons
        connectButton = new JButton("Connect");
        closeButton = new JButton("Close");
        JPanel buttonBar = new JPanel();
        buttonBar.setLayout(new FlowLayout());
        buttonBar.add(connectButton);
        buttonBar.add(closeButton);
        content.add(buttonBar, BorderLayout.SOUTH);

        closeButton.addActionListener(new ActionListener(){
            @Override
            public void actionPerformed(ActionEvent e) {
                MiniMidi.this.setVisible(false);
                MiniMidi.this.dispose();
            }
        });

        connectButton.addActionListener(new ActionListener(){
            @Override
            public void actionPerformed(ActionEvent e) {
                setupMidi();
            }
        });

        // Status display

        JPanel statusPanel = new JPanel();
        statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.PAGE_AXIS));
        synthStatusText = new JLabel();
        transStatusText = new JLabel();
        connectionStatusText = new JLabel("no");
        statusPanel.add(statusLine("Synthesizer: ", synthStatusText));
        statusPanel.add(statusLine("Input device: ", transStatusText));
        statusPanel.add(statusLine("Connected: ", connectionStatusText));
        content.add(statusPanel, BorderLayout.CENTER);

    }

    private JPanel statusLine(String labelText, JLabel statusField){
        JPanel line = new JPanel();
        line.setLayout(new BoxLayout(line, BoxLayout.LINE_AXIS));
        line.add(new JLabel(labelText));
        line.add(statusField);
        return line;
    }

    private void setupMidi(){
        // Try to connect the keyboard to the default synth
        
        boolean devicesOk = true;

        // Check for a default synth
        try{
            synth = MidiSystem.getSynthesizer();
            synth.open();
            synthStatusText.setText("OK");
        }
        catch(MidiUnavailableException me){
            synthStatusText.setText("Not available");
            devicesOk = false;
        }

        // Check for a default transmitter - probably the keyboard
        try{
            transmitter = MidiSystem.getTransmitter();
            transStatusText.setText("OK");
        }
        catch(MidiUnavailableException me){
            transStatusText.setText("Not Available");
            devicesOk = false;
        }

        if(devicesOk){
            // Attempt to connect transmitter (keyboard) to synth
            try{
                transmitter.setReceiver(synth.getReceiver());
                connectionStatusText.setText("yes"); // That's it!!!
                connectButton.setEnabled(false);
            }
            catch(MidiUnavailableException me){
                connectionStatusText.setText("Unable to connect devices");
            }
        }
    }

    private void tearDownMidi(){
        if(synth != null)
            synth.close();
        if(transmitter != null)
            transmitter.close();
    }

    public static void main(String args[]){
        MiniMidi miniMidi = new MiniMidi();
        miniMidi.setVisible(true);
    }

}
Most of the code is concerned with the UI, only the functions setupMidi and tearDownMidi actually deal with the api at all. I am not sure how hardware dependant this is as it relies on there being a default synth available. Works on Windows 7 though.

There is fuller demo of the api - with source - here: http://java.sun.com/products/java-me...JavaSoundDemo/
Reply With Quote
  #10  
Old 04-21-2011, 05:46 PM
BigT BigT is offline
Guest
 
Join Date: Aug 2008
Thanks. I've got it saved to my computer. I'll take a look at it later when I have the mind power to devote to it.
Reply With Quote
  #11  
Old 05-20-2011, 07:48 AM
BigT BigT is offline
Guest
 
Join Date: Aug 2008
<oops>

Last edited by BigT; 05-20-2011 at 07:50 AM.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:21 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2013 Sun-Times Media, LLC.