• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: DLS program change bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DLS program change bug?


  • Subject: Re: DLS program change bug?
  • From: Jeremy Sagan <email@hidden>
  • Date: Thu, 06 Oct 2005 23:29:03 -0400

Hello Andrew,

I just tried this in Metro under 10.4.2 and can recreate exactly what you are seeing. This seems to be a DLS bug.

Why not use the multi-channel capability of the DLS? You should be able to achieve 32 independent timbres that way.

Jeremy

On Oct 6, 2005, at 8:12 PM, Andrew Sorensen wrote:

Hi,

Does anyone know what might be wrong with the code example I posted a few days ago? I'm kinda stuck.

Cheers,
Andrew.


On 02/10/2005, at 6:08 PM, Andrew Sorensen wrote:


Hi,

If I create multiple independant DLS AU's I would expect that sending a program change to channel 0 of each DLS AU would be independent. It appears that the first DLS AU created is independent and works as expected but then all subsequent DLS AU's share the same program-change values. I've attached a contrived example so you can all tell me where I've made my fatal mistake :)

The first three notes (played on a single DLS using separate channels) play as expected - Violin, Glock then Sitar. The second three notes (each played on a separate DLS all using channel 0) play Violin, Sitar, Sitar (i.e. no Glock). Adding more DLS AUs continues this trend.


Cheers, Andrew.


#include <iostream> #include <AudioToolbox/AudioToolbox.h> #include "CAComponent.h"

int main (int argc, char * const argv[]) {
    AUGraph graph;
    AUNode outputNode, mixerNode, dlsNodeA, dlsNodeB, dlsNodeC;
    AudioUnit dlsA, dlsB, dlsC;

    //Setup Graph
    NewAUGraph(&graph);
    CAComponent output('auou','ahal','appl');
    AUGraphNewNode(graph,&(output.Desc()),0,NULL,&outputNode);
    AUGraphOpen(graph);
    AUGraphInitialize(graph);
    AUGraphStart(graph);

    //New NODES
    CAComponent dls('aumu','dls ','appl');
    AUGraphNewNode(graph,&(dls.Desc()),0,NULL,&dlsNodeA);
    AUGraphGetNodeInfo(graph,dlsNodeA,NULL,NULL,NULL,&dlsA);
    AUGraphNewNode(graph,&(dls.Desc()),0,NULL,&dlsNodeB);
    AUGraphGetNodeInfo(graph,dlsNodeB,NULL,NULL,NULL,&dlsB);
    AUGraphNewNode(graph,&(dls.Desc()),0,NULL,&dlsNodeC);
    AUGraphGetNodeInfo(graph,dlsNodeC,NULL,NULL,NULL,&dlsC);
    CAComponent mixer('aumx','smxr','appl');
    AUGraphNewNode(graph,&(mixer.Desc()),0,NULL,&mixerNode);
    //Connect NODES
    AUGraphConnectNodeInput(graph,mixerNode,0,outputNode,0);
    AUGraphConnectNodeInput(graph,dlsNodeA,0,mixerNode,0);
    AUGraphConnectNodeInput(graph,dlsNodeB,0,mixerNode,1);
    AUGraphConnectNodeInput(graph,dlsNodeC,0,mixerNode,2);
    //Update Graph
    AUGraphUpdate(graph,NULL);

    //send program changes and notes
    //only to DLS A using 3 different channels
    MusicDeviceMIDIEvent(dlsA, 0xC0, 40, 0, 0);
    MusicDeviceMIDIEvent(dlsA, 0xC1, 9, 0, 0);
    MusicDeviceMIDIEvent(dlsA, 0xC2, 104, 0, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsA, 0x90, 60, 80, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsA, 0x80, 60, 0, 0);
    MusicDeviceMIDIEvent(dlsA, 0x91, 60, 80, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsA, 0x81, 60, 0, 0);
    MusicDeviceMIDIEvent(dlsA, 0x92, 60, 80, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsA, 0x82, 60, 0, 0);

    //send program changes and notes
    //to each DLS on channel 0
    MusicDeviceMIDIEvent(dlsA, 0xC0, 40, 0, 0);
    MusicDeviceMIDIEvent(dlsB, 0xC0, 9, 0, 0);
    MusicDeviceMIDIEvent(dlsC, 0xC0, 104, 0, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsA, 0x90, 60, 80, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsA, 0x80, 60, 0, 0);
    MusicDeviceMIDIEvent(dlsB, 0x90, 60, 80, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsB, 0x80, 60, 0, 0);
    MusicDeviceMIDIEvent(dlsC, 0x90, 60, 80, 0);
    sleep(1);
    MusicDeviceMIDIEvent(dlsC, 0x80, 60, 0, 0);

    return 0;
}

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bigpond.com


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40verizon.net


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: DLS program change bug?
      • From: Andrew Sorensen <email@hidden>
References: 
 >DLS program change bug? (From: Andrew Sorensen <email@hidden>)
 >Re: DLS program change bug? (From: Andrew Sorensen <email@hidden>)

  • Prev by Date: Re: DLS program change bug?
  • Next by Date: mono output playing out left speaker only (10.2.8)
  • Previous by thread: Re: DLS program change bug?
  • Next by thread: Re: DLS program change bug?
  • Index(es):
    • Date
    • Thread