Example Diagram Configurations

Most of these examples (all but "Music Analysis") are pretty ancient, and have not particularly been updated in any way. For one thing they all use the old "MidiConn" I/O module, which has been essentially superseded by the more flexible "MidiLink" (you can make the replacement yourself if you wish). They do, however, incorporate the revised "MidiPlay", which is now a multiconnector element and so doesn't fit into older 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!

'Sparkle' shows use of the VelAdjust and VelMarker elements. 'Switchable-2' is a rework of 'Switchable' using Composite Elements.

The RePlay module is new for release 2.0, and a couple of examples of its use are also here ('Dual Recorder' and 'Dual Recorder 2').

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


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:

Dual Recorder

This demonstrates the fashion in which you can connect up the new RePlay elements to do "multi-track recording" — or something like it. Two of them are hooked up here so that each will record all the events passing through the configuration, including the output of the other if it is playing. [This configuration is set up for live input/output through a MidiConn element; you won't be able to do much without an external connection. And don't forget to select your MIDI device in the MidiConn's panel.] At left are some 'control' elements — a PitchBend, Program, and Controller — that you can play with as well.

As loaded, both RePlay elements have 'Trig on Midi' set as their record mode, so to start recording on one of them just click its RECORD button and start playing your keyboard. If you then click PLAY you should hear what you have just recorded on your connected synth.

Once you've recorded a passage on one of them, you can click RECORD on the other, start the first playing, and add a second part to the first. Both the original and the added material will be recorded as one track.. If you want, you can reverse the RECORD and PLAY functions to overlay yet another part, and continue in this way as long as you want. [If you're doing this seriously, you'll probably want to save off the good takes!]

If you look at the diagram, you'll notice that the path to the RePlays gets split off to go through a MsgMarker and a Splitter and then to the 'Control' inputs of the RePlays. This path is set up to extract Note-Ons from the stream and make them available to trigger either of the elements if it is set up appropriately. In fact as loaded the first Replay element (top panel) is set to trigger playback on control, so if you are not recording on it and it already contains a sequence, this will get triggered when you hit a note on your keyboard. (Remember of course that the sequence must be 'AT START' for triggering to be enabled.)

So, if you have recorded one part on the top RePlay, and hit RECORD on the second, you can simply start playing and the first part will chime in automatically. If you would rather it waited a short definite interval before actually starting, use the 'Start Delay' slider to adjust this. You can set the other RePlay to do the same if you like. I suggest you experiment.

Using Note-On as the trigger is convenient for demonstration, but of course you can set up the configuration to extract any specific event or event-type to do the triggering.

For a slightly different twist, open the top panel's 'Load...' File Panel, and find the folder called 'SEQUENCES' supplied with this package. Load the 'pitch_sweep_down' file, leaving the other RePlay settings as they were when first loaded. Now, every time you hit a note it should sweep down to its final value. (If you play slowly, that is. Closly spaced notes will just join in the sweep in progress.) Notice that timing is now in 'Ticks': you can change the sweep speed with the slider.

Not very practical as is, perhaps, but you can imgine triggering on specific events in a passage to get a desired effect. Try recording other short effects sequences, such as a fade (but don't forget to restore the volume afterward!).

References:

Dual Recorder 2

This is a slight variant on the previous configuration. Here, each element will not record the output of the other. They receive the events from the Midi interface and the three control elements at the left, but the output from the other element does not come their way. It does go to the Note-On extraction path, though, so one can trigger the other if desired.

With this configuration, you can record one part, then trigger both its playback and the recording of a second part at the same time. Notice that the top element is in 'Trig on Midi' record mode, while the lower is 'Trig on Control'. This means that when you record the 'top' track the first event is always at 'time zero'. If you start playback, that first event can then trigger recording on the second — if it is primed to 'READY REC' — via the control input path. (Assuming it is a note-on, of course; if you want to trigger on some other event you'll need to modify the configuration suitably.) If you prefer, playing a note on your keyboard will also start both elements, through the same Control path.

By the way, you can see that if you continue playing after the top track has finished, you are going to retrigger it! This may or may not be desirable. Set 'No Auto Rewind' if you want to avoid it.

The two recorded tracks can be played back in synchrony by the same procedure. You can't record the result with the configuration as is, nor can you reconrd more than two parts, but you can always add in more RePlay elements of your own.

References:
See above.


Music Analysis

This example has been added to demonstrate how you can use some of the newer modules. It can process a MIDI stream from either a MidiFile or live input, and can show various features of the stream in its display panels. There is an Analyze element that counts the various notes and chords, a KeySig that attempts to guess the current key signature of the stream, and a Notator that shows a staff representation of the current notes. All are fed their information by a single KeyTrack (which also shows the active notes of the scale). [The diagram itself is quickly obscured by all these panels(!) — just push one of them to the back to access it.]

Also in the diagram are a MidiMon that generates a text version of each event, and a SysExMon that will note any System Exclusive sequences that appear in a midifile. The associated StreamView elements that display this text don't have their panels visible initially, so if you want to see this information you'll have to open these. (Note that the SysExMon is connected directly to the MidiFile output, because downstream these messages may get dropped by diversion.)

There are two main paths in the diagram. One leads to the MIDI output elements, and — for variety — there are also Program and Controller elements connected here that can be used to change the sounds actually output. A SysReset is included too, in case you have to bring things back to normal in a hurry. There are two output elements: a WvrSynth that can be used without any external hardware, and a MidiLink that can feed external hardware or other apps. The MidiLink's input connects over to the analysis path so you can observe live performance.

The second, Analysis, path essentially has the KeyTrack followed by the Analyze, KeySig, and Notator elements, and terminated by the MidiMon/StreamView pair. Preceding this, though, (for the midifile branch) are a ChanMarker and Splitter that keep out percussion events on Channel-10, so these don't introduce confusion. There is another ChanMarker/Splitter pair (initially inactive) immediately after the MidiFile itself that you can use to cut out particular channels of the file if you wish.