Example Diagram Configurations

A few example configurations are included, to give you an idea of what can be done with the MIDI modules. (The 'Test' set was deemed too limited to need any demos...)

The first example is a simple configuration that will drive the internal Synth from either a Midifile or external events. Another will derive two MIDI channels from one input in various ways: you can just play two instruments at once, or you can split your keyboard range into different combinations of the two channels. A third shows how the MidiDelay and TimeSort modules can be used to generate "echo" type effects. And there is a nice, complex one ('Switchable') to thoroughly confuse you!

Two examples have been added in this release. 'Sparkle' shows use of the VelAdjust and VelMarker elements. 'Switchable-2' is a rework of 'Switchable' using Composite Elements.

(Don't try loading more than one of the examples at once or you'll just get confused...!)

Note: The 4.0 BeOS drivers for most (all?) Intel audio cards have a bug that causes confused output in many situations (see the README). The drivers are fixed in BeOS 4.5, but without that your options are limited. In particular '2 Chan MIDI' and similar won't be satisfactory -- you'll get a lot of stuck notes. (The bug never existed on PPC systems.)


Synth Demo

This is a fairly small configuration that demonstrates some of the features of a MusicWeaver diagram. You can play with it with or without external MIDI equipment. Without external commections, you can play a Midifile (such as one of those supplied in the 'optional' folder on the BeOS CD) through the internal synth. As a trivial example of modification, you can shift tnotes up and down from their original pitch. If you connect an external MIDI source, presumably a keyboard (for which you of course need a MIDI interface), it will drive two channels of the internal BeOS Synth from your externally supplied events, and you can set the patches ('Programs') for those channels to the instruments you wish . For convenience, it also feeds external MIDI back out through the interface.

You can start the configuration up simply by double-clicking on its icon. Panels will open up for most of the elements in the diagram. Probably the first thing to try is to play a Midifile through the internal synth. The 'MidiPlay' panel is at top right. Click on 'Open' to get a FilePanel, and find a suitable Midifile. When you select a file from the panel it will be loaded, but will not start until you click the 'Play' button. (And remember if you want to play it a second time after it ends, you must click 'Rewind'.)

If you want to shift the pitch of the notes being played from the file, you need to open the panel for the 'Change Pitch' element (the one just to the left of the right-hand WvrSynth) -- press the right mouse-button over the centre of the element to bring up the menu, and select 'Panel'. You can shift up or down by octaves using the buttons at the top of the panel, or shift in semitones with the slider. Be aware that if you shift while any note is playing, the note-off that should match, won't! If you don't want 'stuck' notes, pause the file (with 'Stop') before transposing. (This element is also in one of the paths of events from external MIDI, so you can shift them too if you wish.)

If you want to input MIDI from some external device, you first have to tell the system which port to use (even if you only have one!). The panel for the 'MidiConn' element is at top left. Press on 'Select...' to pop up the menu of devices, and select the right one from it. If you save the diagram at this point, you won't have to do this step again. As described below, incoming MIDI is processed a bit before being sent to the internal synth, and is also looped back directly to the external output.

You don't need to touch the other panels at this point, but if you want paricular instruments on the Synth, you will have to select them from the 'Chan 1' or 'Chan 2' Program panels after the synth has finished loading. You can play around with their settings further as you feel like it.

Looking at the diagram in detail, the MiciConn link to an external port is at left. An immediate branch from the output path of this connects back to its input, so that incoming events are echoed back out. All events then continue on, and are simply branched in two. Each branch goes through a MidiChannel element: the top one sets events to Channel 1, the bottom one to Channel 2, so that the original single-channel stream now becomes two identical ones, each driving a separate channel of the Synth. Program elements feed these elements also, so you can select which instrument plays on each channel. From there the two paths feed the WvrSynth on the right -- with the top one also going through the Transpose element, A third connection comes directly from the MidiPlay to the same Transpose element and thence to the synth .

Be warned that it may take some time for the Synth to load. You can't do much until this is complete. In particular you can't set a program on either channel until the Synth is ready. You will have to select your progtram numbers (or click on the 'ReSend' buttons) at this time.

References:


2 Chan MIDI

This example is intended to be used with external MIDI equipment: a MIDI interface of course, a Synth module of some sort, and a keyboard controller (or whatever MIDI generator and player devices you happen to have). You can play Midifiles tthrough your external interface if you wish also, as It has a MIdiPlay element connected straight to the output. ...Or you can redesign it completely if you want to.

Only some of the elements have their panels initially displayed; you can open up others as you need them. However, you do need to set the correct I/O device for the MidiConn element (in the 'MidiPort' panel) before you can do anything useful. Among the others initially visible, the two Program panels at the bottom let you select which instrument is played by each channel. The Transpose panel to the right affects channel 1 only -- try shifting up or down an octave (or even some semitones if you don't mind some discord!). At top right is the 'Keyboard Split' panel, which we'll return to in a moment. The panels not initially visible are those for the MidiChannel elements that actually set the output channels, a Controller element that may be used to send Control Changes to channel 1, and the message markers and splitter that direct the events.

As first loaded, this configuration takes all events arriving at the MidiConn input, and transmits them back around to the MidiConn output on one or other or both of two MIDI channels (initially 1 and 2). A Splitter and some preceding 'Markers' determine which events get sent where. Initially, all Controller events are sent to both channels. Program Change events (from the external port) are diverted to channel 1 only. Other events -- particularly all note-ons and note-offs -- are also duplicated onto both channels.

At top right is the panel for the KeyRange that controls which notes go to which channel. (It works in conjuction with a following Splitter, whose panel is not initially visible.) As loaded, ithe range is "all notes" (1-128), and the mark it sets is '3'. The Splitter has been set to duplicate all events with this mark, so all notes will go to both channels. If you move one or both of the range sliders, notes outside the set range will not get marked, and so will only go out channel 2 (the undiverted one in this diagram).

If you want a more conventional keyboard split, with notes going to just one or other of the channels, simply use the drop-down 'Mark' menu on the KeyRange panel to select Mark 1; the Splitter is already set to divert this mark, so now in-range events will go to channel 1, the rest to channel 2. (You could alternatively open up the Splitter's panel, and change the function of Mark 3.)

The remaining initially open panel is the MidiPlay one at top left. If you have any handy Midifiles, you can play them through this. The operations should be fairly obvious. For fun, you can also drag a branch connection from the MidiPlay element to the beginning of the splitting chain to add some effects to the performance...(!)

Now to take the diagram itself to pieces...: Top left is the MidiPlay element; note how it is linked to the 'Midi Out' connector through a JoinPaths to merge events that go through the splitting chain. The 'From Midi In' line from the MidiConn element begins the splitting chain. The first element in this is a MsgMarker, set to tag Program Change events with Mark 1 (see the next paragraph for how the Splitter responds). Immediately following is another MsgMarker that sets Mark 2 on all Controller events. Finally in this section is the KeyRange element that we discussed above.

The Splitter itself comes next. If you open up its control panel, you'll see that it is set to 'Dupe' Marks 2 & 3, and 'Split' (i.e. 'divert') Mark 1. If you use the right button to check the connectors, you'll see that the top one is the 'Diverted' one. amd the bottom is 'Through'.

On each of the two parallel split paths, the first element is a MidiChannel, the top one set to Channel 1, the bottom to Channel 2 (which you can of course change any time you want). These are each also fed by a Program element, so that you can send desired selections to the channels individually. The top path has a Transpose element, so that you can shift this one without affecting Channel 2. Then both paths are merged back together and passed back to the Midi output.

Play around with this configuration -- there are lots of parameters to change, and don't forget you can drag things around to open up more space for inserting additional elements. Have fun!

References:


3 Note Gallop

This example is only really useful if you have an external MIDI setup: you can add WvrSynth for output if you like, but it will sound best with some live input -- most MIdifiles are too complex to give good results. (As usual, you will need to set MidiConn to your own particular I/O device before use.) As provided, it will add a double "gallop" echo to notes below middle-C, and provide a "choir" backing to the upper register notes.

A brief tour... Going left to right, the first element is a 'DeGlitch' (which we'll come back to the purpose of in a moment) that is one of two paths that feeds the MIDI output (through the 'JoinPaths'). The 'From MIDI In" connector of the MIDIConn element itself both feeds back to the DeGlitch, and on to the right through the network that produces the echoes. The first element in this is a Note Range Marker, set to tag all notes below middle-C; it immediately feeds a Splitter, the 'Through' output of which feeds back to MIDI output via a 'MIdiChannel', so that the upper notes (and non-note events) get a second channel (channel 2 for simplicity). The diverted (lower) notes go onward, first through a 'VelAdjust', then a 'MidiDelay', through another VelAdjust/MidiDelay pair, to a 'TimeSort'. There is a branched path that bypasses the first VelAdjust and MidiDelay, so in fact two streams with different delay values arrive at the TimeSort. The resultant output of the latter is a time-sorted combined stream of note events that is fed back to the DeGlitch and so to the MIDI output.

Observe, however, that we now have three streams (the original plus the two echoes) all interleaved and driving the same channel. (The fourth is driving another channel and so doesn't interfere.) As the delayed echoes are of the same note, if we did nothing else, out-of-order Note-Offs would cause ugly cutoffs of notes that should be sustained. Inserting a 'DeGlitch element at this point avoids this "Retriggering" problem. (Try replacing the DeGlitch with a JoinPaths and hitting a staccato note or two...!) (The VelAdjust elements here are only used to reduce the 'echo' level. For another application see the next example.)

The function of the two 'Program' elements -- so far unmentioned -- is probably obvious. The left-hand one sets the program for the main channel (whatever is coming from your keyboard via MIDI IN), and the other sets that of the second upper-register channel. Initially they are "Acoustic Bass" and "Choir Ahhs", because these sounded good to me...

References:



Sparkle

This demonstrates the capabilities of the revised VelAdjust and VelMarker modules. It adds "highlights" to the louder notes. The basic instrument (channel 1) is set to be 'Acoustic Guitar', but as the velocity increases above a certain threshold, 'FX Echoes" start to blend in. At the top end of the velocity scale, a "Glockenspiel" is (abruptly) added to the mix. (Other combinations work well too. Play around.)

The configuration is pretty simple. MIDI input from your keyboard is fed right back out through 'Chan A' (set to midi channel 1), and a Program element is attached to select the guitar. The input is simultaneously fed onward, through a VelMarker and Splitter. The 'Through' connection of the Splitter goes on through the VelAdjust to 'Chan B' (channnel 2), and the 'Diverted' line goes straight out 'Chan C' (channel 3). Each of these has its own Program element to set the instrument.

The VelMarker marks only high-velocity notes with 'Mark 2', which by default causes duplication in the Splitter. As a result, all notes go to 'Chan B'. The loud ones go to 'C' as well, and the Glockenspiel plays (at the same volume as 'Chan A'). Note that the new VelMarker marks matching note-offs as well, so these are handled without extra fussing.

Chan B is set up with a threshold on the VelAdjust, so that all the softer notes come through at minimum volume. Once the threshold is exceeded, the multiplier greater than 100% ensures that the highlight note becomes rapidly more pronounced.

References:


Switchable

... Otherwise known as the Kitchen Sink...

There are a lot of elements here, so it would be pointless to try and describe them individually. We'll just take an overview of the diagram's features, and leave you to fill in the details by exploration. (If you have problems with stuck-notes under R4 Intel, see the note at the head of this document.

Expand the window to full screen to see everything at once. Basically, this is just a doubled '2 Chan MIDI' with a few added options. There are two sets of elements arranged as in the '2 Chan MIDI' example, the first driving midi channels 1 and 2, the second doing the same for 3 and 4. New to this diagram, however, is the preceding 'Switcher' element, which determines whether the incoming MIDI stream drives the first set, the second, or both, This in turn gets its switching instructions from Program Change events in the incoming stream. It is set up so that 'Program 1' selects output to channels 1 and 2, 'Program 2' selects the second pair, and 'Program 3' will duplicate the stream onto all four channels at once. Other program change values are ignored, and none are fed through to any output channel.

If you trace things through the initial markers and splitters, you'll see that only note-on events are sent through the Switcher. (Actually a few others like aftertouch are too, but it shouldn't matter.) In particular, note-off and controller events bypass the Switcher so they are always sent everywhere. This prevents notes and pedals getting stuck 'on' if you change programs at the wrong time. Program Change events alone are sent to a 'UseIndex' element, which turns the program number into a control message for the Switcher.

Two other elements have been added at the top of the diagram. 'Fine Tune' is a 'SetRPN' elelemt that is configured to shift the tuning of your synth (if it supports this) -- perhaps useful if you're playing live with an acoustic instrument. 'Bend' will send pitch-bend signals to all enabled outputs. If you open this one's panel, you'll see that it's been stretched a bit! (The panel of a newly placed element is no bigger than usual.) The large size makes it a lot easier to grab with the mouse while you are playing with the other hand. Of course, if you already have a Pitch Wheel on your keyboard, forget it...

References:


Switchable-2

This is pretty much just the 'Switchable' diagram again, but this time cast as a hierarchical diagram, with the almost identical pair of subsections, containing the two possible versions of note processing, tucked away as composite elements.

The four Program element panels are the only ones initially open. The corresponding elements are of course inside the composite elements, whose panels are not open. Pop open one of these (with the element menu) to see how things are arranged inside.

You can see how there are three inputs (and corresponding BridgeIns) on each composite, one bringing in the note-ons if that path has been selected, another carrying the note-offs and other events that always go to both subsections. The third is used to merge output paths if appropriate. (It is only connected in 'chans 3/4'.) Once inside, the first two are simply merged. Everything, including the third input -- if used --, eventually feeds into one BridgeOut, which passes it back to the main diagram.

If you like, you can save off one of the subdiagrams under a new name as a composite element file. You can then place this in other diagrams, or even add it as a third choice in this one, if you are ready to add in appropriate additional selection logic as well.

References: