Multiple instances using multiple audio devices

I am trying to set up a multi-zone music player and just discovered MOC, but having had a play I discovered that only one instance can run at a time and it only outputs to the default device. Are there any ways to overcome these?

Thanks,
Ed
(Debian 4)

Half way there...

OK, the multiple instances part is sorted! How do I go about changing the sound card each one outputs to?

Thank you!
Ed

(Edit: OK, this really should be a reply to the first answer, not the question, but I didn't think of that at the time :-P)

Setting the output device

Setting the output device depends on your driver but is a simple process (did you have a look at the config.example file ?):

I'm using ALSA and have three devices: a SBLive, a VIA CT82XX based onboard sound chip and a USB soundcard. The system is set up so that the cards are asigned sound slots on the give order.
In order to select the cards I have following entries in my $HOME/.asoundrc:

pcm.!default {
  type hw
  card 0
}

ctl.!default {
  type hw           
  card 0
}

pcm.live {
  type hw
  card 0
}

ctl.live {
  type hw
  card 0
}

pcm.via {
  type hw
  card 1
}

ctl.via {
  type hw           
  card 1
}

pcm.usb {
  type hw
  card 2
}

ctl.usb {
  type hw           
  card 2
}

These entries map choosen names (live, via, usb) to the cards (0,1,2).

In MOCs config file I have:

# ALSA mixer device
AlsaMixer               = PCM                                                                                             

# Second ALSA mixer device
AlsaMixer2              = Master

# ALSA output device
AlsaDevice              = live

for the SBLive

and

# ALSA mixer device
AlsaMixer               = Speaker                                                                                         

# Second ALSA mixer device
AlsaMixer2              = Master

# ALSA output device
AlsaDevice              = usb

for the USB audio device.

(Check mixer-names with alsamixer or similar to match your devices)

For other drivers (JACK, OSS) the procedure varies but is not really any more complex.

You could specify a different

You could specify a different directory for MOC (-M option) to read its configuration from (and to store its socket in).
This way you can run as many server/client instances with different configurations as you want.
The output driver and device can be set via the config file.

Does this do what you want ?

*edit*
And additionally you can always run as many clients as you want to have multiple interfaces to the same server.