Copyright: Copyright® 1995 Hubert Winkler


Contents

for Hubi's Simple Sampler V. 1.0

Help is organized into the following categories:

Overview

Registration

Menu Commands

Tips and Tricks

Playing the Demo Song

Installation

Uninstall

Source Code

Thanks

This Help file is still under construction.
Send errors to winkler@cobra.gud.siemens.co.at


Overview

HWSimSam is a MIDI triggered Wave player with pitch-transpose. You can load a WAV file as MIDI instrument and play it with your MIDI keyboard.

Features

•	MIDI note pitch modifies playback-samplerate (middle C = unchanged).

•	MIDI program changes selects different WAV files (128 per File).

•	Note velocity affects loudness.

•	MIDI volume and expression controller affects loudness.

•	Damper (sustain) controller or modulation wheel can be used for looping sound.

•	Multiple instances possible

•	Triggering from a MIDI sequencer with Hubi's MIDI LoopBack driver possible (included).

•	Control Volume of all MIDI-Out, AUX and WAVE-Out devices from MIDI.

It is a Windows 3.1 program to play a WAV file as MIDI instrument.

The selection of the WAV-sounds is done with an edit-control as main element of the program. The program number

You can select different WAV files with MIDI program changes from your MIDI-keyboard, The middle C (=MIDI note number 60) plays the sound with the original samplerate, other notes transpose it accordingly. With a standard sound card, you can play only one sound at a time, and not all samplerates are playable. The sound card may round to the next possible hardware samplerate.

The sound can be played in LOOP-mode when the damper (sustain) pedal is pressed during note-on. The loudness of the sound can be controlled with note-velocity, volume, expression and pan controller.

For control from a sequencer, it is recommended to use MDLPBK20.ZIP (Freeware from the same author ) - a virtual MIDI port for Windows with multi client support.

The program uses few CPU time - so it should even work on a 286 with 2MB RAM and a sound card (if the soundcard drivers run on a 286). The size of the WAV files is limited to max 1MB in windows standard mode and to 16MB in Windows enhanced mode. The loading of a large WAV file is slow and blocks the system. Please use MCI.commands (HWMCICOM.ZIP) or something like Steinberg-Waveplayer for large files (WavePlayer cannot run simultaneous with HWSimSam).

HWSimSam can run multiple (multiple instances simultaneous). The different sounds loaded in these two instances can be played alternating without the load delays. Each instance must receive on a different MIDI channel (or port).

HWSimSam stands for Hubert Winklers Simple Sampler.

Thank you for your registration.


Registration

This program is copyrighted by Hubert Winkler.
Non profit distribution of this package via BBS, CDROM, ftp, or floppy is allowed.
You can test it for 30 days and 30 minutes.

If you like this program, please send me $10 or about the same amount in other currency ( please only west - european, canadian or australian only, and no coins please).
This will encourage me to distribute others of my programs, and to afford a modem for better support, and a Windows95 compiler for future enhancements.

Anonymous Registration

If you want, send me $10 without sender. That is OK and accepted.

Why register ?

The question is wrong. It must be "Why not register ?"
If you think It's not worth $10 then send less.
If you think you can hack the program to get it full working, then you are wrong, it is already full working. If you find a bug, please tell that I can correct it.

Send money to following address:

Dipl. Ing. Hubert Winkler
Neunkirchnerstraße 17
2732 Willendorf am Steinfelde
AUSTRIA

You can use special issues, my brother is philatelist.

Tel ++43 2620 2878 (home)

Contact me preferrably by email:
winkler@cobra.gud.siemens.co.at


Menu Commands

File Menu

File load and save operations.

Edit Menu

Edit the contents of the WAV list.

Sound Menu

controls the sound playback

Midi Menu

sets MIDI-Input and related options.

Volume Menu

sets Volume-control device and all related options.


File Menu

File
New
Open...
Save
Save as...
Exit

Does the usual things with the setup files *.HSS. All is saved, with exception of the currently selected program. HSS-files are text files and can be edited with notepad, too. Program 0, the first WAV file is loaded upon file load.

A hotlist of the last opened files is also seen and stored in win.ini.


Edit Menu

Edit
Add..
Replace..
Remove line

•	Add opens a standard Windows File Open dialog to insert a WAV file entry.

•	Replace opens a standard Windows File Open dialog to replace the cursor-line entry with the new WAV file entry.

•	Remove deletes the cursor line.

The standard Edit keys for Cut, Copy, Paste and Undo are supported too (see Notepad help)

Drag'n Drop:

Dropping '*.WAV' files adds these to the WAV-list, multiple WAV files can be dropped.
Dropping '*.HSS' files has the same effect as File-Open

Use File-Manager, select all (wav)-files (with #-key) and move them to the HWSimSam window. All '*.WAV' files are inserted at the current cursor location (best it stands at end of file)


Sound Menu

Sound
(Re-)Set Program
Find Current
Play
Stop
Loop

ReSet Program does the same as a MIDI procram change command, and loads the current WAV into memory.

Find Current selects the line with the current loaded wave file. Useful if you have moved the cursor into another line and want to find the currently loaded wave file.

Play loads the sound at cursor line and plays it with original sample rate. An error message is displayed on failure.

Stop stops any current playing sound.

Loop is like Play, but plays the sound in loop mode. Play another sound for stop.


Midi Menu

MIDI-In
Program Changes
Stop at NoteOff
Loop on Damp/Mod
---------
Midi Channel
1
2
...
16
--------
0 None
List of all MIDI ports

The MIDI-In menu let you select the MIDI port and channel, and to turn on and off MIDI -in related Options. The current selection is checked.

•	Program Changes turns on/off the receiption of MIDI-Program-Change messages. The zero based program number equals the line number 0..127.

•	Stop At Note-Off, when this is checked, then the sound is stopped when the key is released.

•	Loop on Damper/Modulation : When the damper pedal is pressed (MIDI controller #64 is setted to a value of 127 or greater than 63), or the modulation wheel is turned up (MIDI controller #1 is setted to a value greater than 63), then a Note-On will cause a looping sound. This is great for drum loop pattern. The sound will stop with damper or modulation release (MIDI Controller 1 or 64 setted to les than 64). Be careful with interaction of Note-Off events.


Volume Menu

Volume
Volume Control
Velocity
Pan
--------
0 None
List of all AUX,WAV and MIDI devices

Volume Control enables receipt of MIDI controllers 7(Volume) and 11(Expression). The 2 values are simply multiplied. The best usage is to place a single volume event at track start and use expression events for loudness control (values near 127). The overall track loudness can be setted now with the single volume control event. Full Range ~96dB (?). Be aware that moving the volume controller can give zippernig noise, depending on your sound-hardware. A SB16-mixer-channel has 32-steps with 2dB each.

Velocity gives the same effect as Volume/Expression. When turned on, the Note-On-Velocity scales the loudness. Volume Controller can be used for some kind of (noisy) amplitude modulation.

Pan enables receiption of MIDI controller #10 (Pan), if the soundcard supports stereot. The Pan effect is implemented by damping the other channel (the sound moves to right when you damp the left signal).

Mixer Channel lets you select the AUX-device for all that loudness setting. You should select the WAVE-channel, but You can also start multiple instances of HWSimSam receiving at different MIDI-channels and sending to different AUX-devices and so control all your Mixer channels with MIDI controllers. All Midi-Outputs and Wave-Outputs are also shown, devices without Volume-capability are greyed.


Tips and Tricks

Samplerate

Compression

Pitch precision

Multiple Drum Loops

Joystick Control

Twelve Tone Systems virtual Piano

Reset command failed


Samplerate

If your soundcard can playback up to 44kHz, then the best sample rate is 22kHz, allowing to transpose the sound in the range of -2 to +1 octave, that is from 5.5 kHz to 44 kHz.


Compression

You can use any compression the soundcard can handle directly (i.e. Creative ADPCM). This is the prefereable format.

Microsoft's Video for Windows 1.1 runtime, which is included with  most multimedia CDROMs, includes a decompression feature for playback of software compressed files (Truespeech, MS-ADPCM and IMA-ADPCM).
Software decompression can add a noticeable delay before the sound is played.


Pitch Precision

the pitch is calculated equal tempered, but the soundcards are mostly unable to play at exactly this sample rate and will use the next available frequency. A SB16 (driver V. 3.06) has problems with transposing up to G,G#,A..


Multiple Drum Loops

It is often necessary to switch between 2 sounds quickly without delay (load the WAV file). This must be done with 2 instances of HWSimSam receiving at different MIDIports/channels.
i.e:

Time	Channel	Event

1:1:000	1	Program Change 1
Load WAV

2:1:000	1	Note On C3, Vel=127
Starts Sound 1 of instance 1

2:2:000	2	Program Change 1
Load WAV sound 1 in instance 2

6:1:000	2	Note On C
Starts Sound 1 of instance 2

6:2:000 	1	Program Change 3
....

See the Demo Song for an example.


Playing the Demo Song

The demo song was created by extracting instruments sounds from a MOD-file, MAKEMOV.MOD, and inserted into a background MIDI pattern built from a Steinberg-Musicstation-Demo style.

Requirements:
GM-Synth (extended MIDI setup with drum channel 10)
Soundcard with Mixer (optional)
MIDI Sequencer (e.g. WinJammer)
Hubi' MIDI Loopback device (mentioned as "virtual Port" here)

1	Open MAKEMOV.MID in your sequencer. The ports are setted to
Port 1 = GM Synth (Tracks 1-5)
Port 2 = virtual Port (Tracks 6&7)
If your sequencer is unable to address different MIDI ports, then you must setup the Windows MIDI-Mapper so that it sends two MIDI channels to "virtual Port", and then use these channels for track 5 and 6 in the demo song.

2	Start HWSIMSAM.EXE
Open MAKEMOVE.HSS.
Change MIDI Input to "virtual Port"
Change Volume->Port to your Wave-Volume device. (e.g. "SB16 Aux: Wave"), save

3	Start a second instance of HWSIMSAM.EXE
Open MAKEMOV2.HSS.
Do the same as before. The only difference is that we use Midichannel 2 instead of 1.


Joystick Control

MDJSTK10-users should try following settings :

•	X: Pan; Event=Controller, Channel=1, Data1=10

•	Y: Volume; Event=Controller, Channel=1, Data1=7, reverse

•	Button A: Play; Event=Note, Channel=1, Data1=60, Dn=127, Up=0

•	Button B: Damper; Event=Controller, Channel=1, Data1=64, Dn=127, Up=0

•	output to a virtual MIDI port.

HWSimSam receives from a virtual MIDI port, channel 1, enable all options except StopAtNoteOff. Set mixer channel to something like "SB16 Aux: WAVE"  and select a WAV file. The sequence B-down A-down B-up A-up starts a looping sound (at A-down = note on with pressed damper) - it stops at the next B-up (damper-release).


Virtual Piano

Controlling with TTS virtual Piano (from Cakewalk 3.01 demo) works great, but take care which application has the input focus. Set Modulation to >=64 for looping sound, or use the Ctrl - key as damper pedal.


No Reset Command reached

This problem can occur if the used Sequencer sends Reset-commands, Damper Off and Modulation off at all channels (like Cubase), and so fast that HWSimSam cannot process it until its message qeue will overflow. To avoid this, use only Midi channels 1 (or 2).


Installation

Installation:
Copy HWSIMSAM.EXE and HWSIMSAM.HLP to a directory of your choice, Drag'N Drop it with file manager to a program manager group of your choice (faster then pressing 20 OK buttons in a setup program).


Uninstall

Why ?

OK, remove hwsimsam.exe and hwsimsam.hlp and remove the program group (or only the icons) from program manager. Remove all created .HSS files, and remove the section
 [Hubi's Simple Sampler]
from win.ini.]


Source Code

Here the complete audio source code (Turbo Pascal):

If (bCurDamper >= 64) And OptLoopDmp Then
  SndPlaySound (p_wave_data, SND_MEMORY Or SND_ASYNC Or SND_LOOP)
Else
  SndPlaySound (p_wave_data, SND_MEMORY Or SND_ASYNC  );

Simple, isn't it?


ADPCM

Adaptive Delta Pulse Code Modulation. The difference between samples is stored. Very effective for high samplerate. But very noisy on lower samplerates.


Austria

Austria is a very wonderful country in the middle of europe. Some of the greatest composers (Mozart, Haydn, Schubert, Strauß, and many others ) and the author of this program come from there


Damper

Midi Controller #64, named Damper or Sustain pedal is used for holding played notes. They stop when the Damper pedal  is released. A value of 0 (less than 64) means normal (damped) sound, 127 (greater than or equal 64) means sustained sound.


expression

MIDI controller #11 is used in the same manner as Volume (#7). Many synthesizers ignore expression, most multiply it with volume. If it is used, don't forget to reset it to 127 at end of playback,


Hubi' MIDI Loopback device

Is a freeware MIDI utility for Windows 3.x, It consists of a multi port, multi client virtual MIDI device driver and a MIDI thru application. Full SyEx support. You can build a powerful MIDI setup inside windows with simultaneous usage of Sequencer(s), Librarian(s) and other MIDI programs.


Hubi' MIDI Loopback


Hubi's MIDI LoopBack

Is a freeware program to connect multiple MIDI programs inside MSWindows, It features multi-port, multi-client and full SysEx implementations.


HWMCICOM

Another program from Hubert Winkler, which triggers MCI commands by MIDI.


kHz

1 kHz = 1000 samples per second. CD quality are 44100 samples per second, giving a high frequency limit of ~20kHz.


Modulation

Midi Controller #1, Modulation Wheel is usually used to modulate the sound, mostly with a vibrato. Many masterkeyboards have a separate Modulation Wheel.


Pan

Midi Controller #10 selects left-right panning of the sound. A value of 0 is full left, 64 is center and 127 is full right.


Program Changes

are MIDI commands to select different instrument sounds.


Thanks

for your registration.


Velocity

Note Velocity is how fast you press the keys at your MIDI keyboard. High velocity gives more loud sound.


virtual MIDI port

A virtual MIDI port is a software MIDI port with Input and Output.All MIDI data sent from one application to the Output can be received at the Input from another application.


Volume

MIDI Volume controller controls the volume. OK?


Volume-control device

Usally one channel of the soundcard signal mixer.


WAV

Wave files are sampled real sounds.


win.ini

Windows initialisation file in your Windows directory, usually C:\WINDOWS\WIN.INI


winkler@cobra.gud.siemens.co.at

This is my current email adress.