The present invention relates to sound processors, and more particularly, to the control of voice channels in sound processors
In today's sound processors, voice channels are used independently to initiate and control the fetching, interpretation, and processing of sound data which will ultimately be heard through speakers. Any given sound processor has a finite number of voices available.
Different voice channels are used to play different sounds, though not all voice channels are active at the same time. Most voice channels remain idle, and are pre-programmed to turn on (or “keyed on”) when needed in order for the sound that they are responsible for to be played. In many situations one or more voice channels are to be keyed (or “keyed off”) either immediately after another voice channel has completed or partway through that voice channel's processing.
One conventional approach is for the control software to poll status registers in the sound processor to determine the states of the voice channels. When the status registers indicate that a desired condition has been met, such as when a voice channel has completed, the software then instructs the next voice channel to key on. However, this approach requires heavy use of system bandwidth and clock cycles by constantly performing reads to the sound processor and then checking the returned result with a desire value. In addition, there is an inherent latency between the time the desired condition is met, and the time the control software polls the registers, discovers that the desired condition is met, and instructs the next voice channel.
Another convention approach sets up interrupt conditions so that the sound processor can send the central processing unit (CPU) an interrupt when the desired condition is met. The CPU then services the interrupt. However, this approach does not guarantee that the voice channels would be timed properly since interrupts are priority based. Other interrupts may have more importance than the sound processors, and thus latency still exists. In addition, the timing of the events is controlled by the CPU, and thus the programmer is still responsible for controlling the sound processor during operation.
The latency inherent in the convention approaches can result in undesired sound production or forces the programmer to use the sound processor in a different, possibly more time consuming way.
Accordingly, there exists a need for an improved method and apparatus for controlling the voice channels in sound processors. The improved method and apparatus should reduce latency in instructing a voice channel when a desired condition is met and should require fewer CPU resources. The present invention addresses such a need.
An improved method and apparatus for controlling the voice channels in sound processors includes: programming a first voice channel to instruct a second voice channel to execute an event when a trigger condition occurs; determining by the first voice channel that the trigger condition has occurred; and instructing the second voice channel to execute the event by the first voice channel. Thus, the need for the CPU to properly time the programmer's desired voice processing events is reduced by having the voice channels themselves be pre-instructed to control another voice channel(s) upon meeting a certain trigger condition. Chains of voice channels are possible and can be as simple or complex as desired. Accurate channel-to-channel event timing is thus possible. Since no interrupts or the polling of status registers is needed, the demands on CPU resources are reduced. System bus bandwidth is also freed for the use of other system components.
The present invention provides an improved method and apparatus for controlling the voice channels in sound processors. The following description is presented to enable one of ordinary skill in the art to make and use the invention and is provided in the context of a patent application and its requirements. Various modifications to the preferred embodiment will be readily apparent to those skilled in the art and the generic principles herein may be applied to other embodiments. Thus, the present invention is not intended to be limited to the embodiment shown but is to be accorded the widest scope consistent with the principles and features described herein.
For example,
In the preferred embodiment, the chains are defined by writing control data to specific control fields specified for each voice channel in the sound processor. In addition to any other control field for adequately fetching, processing, and playing a sound, the voice chaining further includes additional control fields:
1. Master flag: A flag specifying that the voice channel is a master and is responsible for controlling another voice channel.
2. Slave flag: A flag specifying that the voice channel is a slave and is allowed to receive instructions from another voice channel as part of a control chain.
3. Trigger type field: A field specifying a chain event trigger type. The sound processor's supported event trigger types can vary depending on what features it supports, and may include: (1) a frame/event count; (2) when a master voice channel is complete; (3) when a master voice channel is keyed on; (4) when a master voice channel is keyed off; (5) when a master voice's sound data fetch has reached a specific address; and (6) when a master voice channel has looped.
4. Trigger condition field: A field specifying the trigger condition based on the trigger type. This is relevant for trigger types (1) and (5) above. For example, when the trigger type is a frame count, the trigger condition is when this count reaches 0, the event is triggered. For another example, when the trigger type is the master channel sound data fetch reaching a specific address, the trigger condition is the address to compare to.
5. Affected voice channels field: A field specifying which voice channels are to be affected by the trigger. This field can vary in size based on either (a) how many voice channels the sound processor supports, or (b) how many voice channels are permitted to be chained. Each bit in the field controls one voice channel. For example, if the bit for voice channel 1 is set, then voice channel 1 is connected to the chain. If the bit is not set, then it is not connected to the chain.
6. Event field: Optionally, there can be a field specifying the event that is to occur for each voice channel that is controlled by this voice channel's trigger. The size of this field can vary based on (a) how many voice channels the sound processor supports; (b) how many voice channels are permitted to be chained; (c) if the voice channels in the chain can be controlled differently or are to be controlled in the same way, and/or (d) how many types of control options there are. In a typical sound processor, the voice channels can be “keyed on”, “restarted”, “keyed off”, “stopped”, “enabled”, “disabled”, “looped”, and/or “paused”. All of some of these control types can be specified in this field. This field is optional as the sound processor can be configured to only allow the chaining of one event type, such as “keyed on” control events.
7. Priority field: Optionally, there can be a field specifying the slave to master voice channel priority. If a voice channel is a slave to more than one master voice channels, and it is possible that the trigger condition can occur for more than one master voice channel at the same time, then the slave voice channel uses the priority set in this field to determine which master voice channel's trigger to execute.
As illustrated in
Optionally, in smaller sound processor architectures, only certain voice channels can be specified or permitted to be chainable. In addition, the fields specifying chaining behavior do not necessarily have to be tied to the specified voice channel control blocks. They can possibly be defined and held independently and/or stored in a global memory from which each voice channel can read its control data.
An improved method and apparatus for controlling the voice channels in sound processors have been disclosed. The method and apparatus reduces the need for the CPU to properly time the programmer's desired voice processing events by having the voice channels themselves be pre-instructed to control another voice channel(s) upon meeting a certain trigger condition. Chains of voice channels are possible and can be as simple or complex as desired. Accurate channel-to-channel event timing is thus possible. Since no interrupts or the polling of status registers is needed, the demands on CPU resources are reduced. System bus bandwidth is also freed for the use of other system components.
Although the present invention has been described in accordance with the embodiments shown, one of ordinary skill in the art will readily recognize that there could be variations to the embodiments and those variations would be within the spirit and scope of the present invention. Accordingly, many modifications may be made by one of ordinary skill in the art without departing from the spirit and scope of the appended claims.