I decided to give my old sampler idea a new go with some new features last week and so have spent the last few days tossing it together.
It is controlled by a midi stream and hence would theoretically work well as an addon for the by now probably pretty well known QMidi tracker. Or any other program that can output a midi flow.
So what's the deal with a midi sampler?
Well, basically, we can see it as a program that is used to play back sound files (samples) depending on different commandos that it receives (midi messages).
In this way, you can efficiently get better sounding instruments than what is on your soundcard's built-in midi sample bank. But more interresting might be the fact that you can get any sound you want (as long as you have samples for it, of course); that is, you are not limited to the 128 general midi patches / instruments.
So, whats in my sampler then?
Well, for starters, no, this isn't by any means a perfect sampler. Its really basic and does mapping, accepts volume altering (along with the three envelopes attack, sustain and release). It is also capable of visually displaying the received noteOn / -Off messages on a keyboard.
The full feature list is as follows:
You can map sounds in
two layers using the integrated mapper editor; this one isn't very functional just yet (I haven't seen it as a top prioritary) - basically, you can assign wave sound files (samples) to each of the 128 midi keys / notes and stretch them up and down from their centre note; the sampler will then automatically calculate the required frequency changes to make all stretched copies sound in the right pitch.
You can however
not edit already mapped samples, or remove them as of yet, so you better make it right the first time about
Works by reading midiIn data. Currently only the three events noteOn, noteOff and controller -> modwheel are handled.
Volume envelopes for the three stages of a sounds life:
Attack repressents the begining of the sound; you can see it as a fade-in. When completely faded in, the sound switches its state to
Sustain. This state is maintained until the key is released.
If you want the sound to keep playing until you release the key, you set this value to maximum, otherwise the sound will fade out successively after the attack envelope has finished (the attack envelope can of course be set to zero, for no fading-in, by the way).
Release is the last envelope that takes place when the note is released. You have probably already guessed that this envelope is used to fade out the sound. It is almost always used to at least some extent, or the sound will be too abrubptly terminated. You can think of this as a sort of simple reverb effect.
Full channel support. You can have up to sixteen different patches loaded and playing simultaneously.
Layer mixing. This is a pretty nifty feature - by using the modwheel controller, you alter between the upper and lower layers of a patch (each layer can have two completely different sets of sounds). You can use this to for instance switch between soft and hard articulations on an instrument, or just make some fancy morphing effects (allthough it doesn't work quite perfectly for that purpose as of yet).
A nicer interface than my last attempt at a sampler had (if you ever tried that). Proper knob controls are in place which you can turn in a rather logical way. These will also visually update when their values are changed from a midi message, thus giving you a visual overview of what is happening.
On the note of that, as stated earlier, at the bottom of the screen you have a visual (piano) keyboard. Incoming notes will be marked by red dots overlaying the corresponding keys on this one. This is optional though, and can be disabled by unchecking the green button just above the octave transposing knob, ie. if you fear that it will drag your update frequency down.
Loading and saving of patches.
Notice that when editing / making a patch, you won't be able to play it until you save it.
Optionally, you can lock the velocity of the notes to maximum (in an eventual later release, you'll be able to edit this value yourself). By default, if you have a touch-responsive midi device, the volume of the playing sounds will be determined by the velocity value of the event (ie. how hard you played the note on your keyboard).
I might have forgot something, but its 1pm here and I'm really tired, so I'll have to fill that in tomorrow then.
A screenshot:
The sampler is pretty self explainatory; you select a midiIn port from the list on the left by clicking the blue button next to it (blue means that its idle and ready for use, green means that it is currently open and listened to).
To drag the knobs, just click and hold on them while dragging the mouse. Also note that while the volume knob is on the envelope panel, it isn't an envelope in itself, but rather the channel volume, which is applied to all sounds belonging to the current channel (the master volume knob at the top will likewise affect all channels, and thus all sounds).
The first button on the keyboard panel will, as described earlier, disable or enable the visual indication of notes on the keyboard.
The button next to it handles whether the note velocity will be overriden (the button glows orange) or not.
The red button in the master panel is a panic button; it will turn all sounds of (this shouldn't be needed anymore, but just in case its still there) and the button on the mapper panel simply previews / stops the selected sound in the file browser.
The only odd thing about the controls really is the mapper; you doubleclick on a sample (audio .wav file, but don't worry - it only displays wave files anyways) in the browser to load it. This will map it to a single slot (note / key) in the mapper editor. To move it to another slot, you hold the right mouse button down and drag the sample indicator over the mapper. To assign samples to the whole registry, you use the scrollbar below the mapper editor to set which octave it starts at. To stretch the sample, use the left and right arrowkeys. The up and down keys will likewise retract the sample together again. To finally lock the sample in place so that you can move on to the next or save your patch, you doubleclick on the sample (in the mapper editor, not the file browser).
_________________________________
Now, I'd like to hear your opinions on this. Ideas of improvements, bugs, etc. are welcome. If you could also make some patches and supply to the project, that would be great.
Download demo (including a few sample patches to play around with).
@chunks chunks: Sorry if I kind of "stole" your idea... no harm intended, and I'm looking forward to see your sampler attempt as well
"I kören hörs de brummande busarna Björnligan och Gondolen"