Next Previous Table of Contents
Arts has a whole bunch of concepts. Some of them are new in Arts-0.3.0, other have been there for quite a while now.
The important part is, that you probably will probably understand better how midi synthesis works if you know the concepts that drive Arts. You should also be able to do more with aRts knowing how it works.
The idea of aRts is, that synthesis can be done using small modules, which only do one thing, and then recombine them in complex structures. The small modules normally have inputs, where they can get some signals or parameters, and outputs, where they produce some signals.
One module (Synth_ADD) for instance just takes the two signals at it's input and adds them together. The result is available as output signal. The places where modules provide their input/output signals are called ports.
A structure is a combination of connected modules, some of which may have parameters coded directly to their input ports, others which may be connected, and others, which are not connected at all.
What you can do with ArtsBuilder is describing structures. You describe, which modules you want to be connected with which other modules. When you are done, you can save that structure description to a file, or tell Arts to create such a structure you described (Execute).
Then you'll probably hear some sound, if you did everything the right way.
If you like to do so, you can give your structure a name, which can be used to reference it. (Use File/Rename in artsbuilder).
Then, you can choose to publish your structure description on the Arts server. What will happen is that a copy of your descrition will be put into Arts and made available to other "users".
The purpose is to have modules, which can create structures as they are needed. For instance, you may design a structure which synthesizes a base drum. Then, some midi handler could create such a structure whenever a certain midi event is sent to the synthesizer. Then, on every incoming midi event you would hear your synthesized base drum.
Of course this requires, that your audio data is mixed with the other audio output and played. It also requires that your structure knows when to go away, otherwise you would have more and more structures being synthesized.
And finally you should have some way of getting more data about the midi event that arrived, such as volume or frequency, if you want to synthesize "real" instruments as well.
The next points treat these problems.
Buses are dynamically built connections that transfer audio. Basically, there are some uplinks and some downlinks. All signals from the uplinks are added and send to the downlinks.
Buses as currently implemented operate in stereo, so you can only transfer stereo data over buses. If you want mono data, well, transfer it only over one channel and set the other to zero or whatever. What you need to to, is to create one or more Synth_BUS_UPLINK objects and tell them a bus name, to which they should talk (e.g. "audio" or "drums"). Simply throw the data in there.
Then, you'll need to create one or more Synth_BUS_DOWNLINK objects, and tell them the bus name ("audio" or "drums" ... if it matches, the data will get through), and the mixed data will come out again.
The uplinks and downlinks can reside in different structures, you can even have different Artsbuilders running and start an uplink in one and receive the data from the other with a downlink.
What is nice about buses is, that they are fully dynamic. Clients can plug in and out on the fly. There should be no clicking or noise as this happens.
(Of course, you should not plug out a client playing a signal, since it will probably not be a zero level when plugged out the bus, and then it will click.)
Now the second point for advanced instruments is how to get rid of structures automagically. There is a Synth_STRUCT_KILL object for that purpose, which will remove the structure as soon as it gets an input signal > 0.5 (read: 1).
Of course other modules have been tuned to generate such signals in reasonable situations: Both, Synth_ENVELOPE_ADSR and Synth_PLAY_WAV have an output parameter done, which will be set to one as soon as they are ready.
This means, if you want an instrument (e.g. base drum), which is just a wav, it will probably be enough to have a Synth_PLAY_WAV, which plays the wav, and then connect the done parameter to a Synth_STRUCT_KILL.
The structure will be removed as soon as the wav is played (and no none zero output would be generated anymore anyway).
Interfaces are the way of getting data into structures. They are like modules, but they normally have only inputs (or only outputs). Their outputs come from the world outside the structure, and their inputs go back there.
A structure is said to provide an interface if it contains an interface module of that type.
For instance, midi routers expect instrument structures to provide an interface for midi data. Then, they can pass the midi data in, and the structure can use that data for synthesis.
The idea is that you have structures which provide an Interface_MIDI_NOTE. There will be a frequency, and a velocity (volume) and a parameter passed to you, wether this key is still pressed. Your structure should now synthesize exactly that note with that volume, and react on the pressed parameter (where pressed = 1 means the user still holds down that key and pressed = 0 means the user has released that key).
To create and use such a structure, you should do the following:
It is possible, to use a complex structure as module again. To make this even more interesting, you can give these structures ports, so that it can process signals like every other module. Say you have found a great way to produce a phantastic reverb. So you could put that reverb alone into a structure and give it some ports, like two (stereo) input ports, another one for the reverb depth, and two output ports, where the reverbiated signal comes out again.
Now you could give it a nice name, (such as Synth_COOL_REVERB), and publish it. At the same time, it appears as new module in the Modules menu, and you can use it as module in other structures.
Arts currently has no concept of keeping published structures in a library/ database/module directory, so you need to make sure that you have the Synth_COOL_REVERB module published when you work with structures that use it. A "convenient" way to do so is using artsshell and a shellscript to do publishing. There will be something better soon.
Next Previous Table of Contents