pax_global_header00006660000000000000000000000064112522641420014511gustar00rootroot0000000000000052 comment=96cad4b8d6f0486c1a15e207be94c70ac1876b7d vkeybd-0.1.18d/000077500000000000000000000000001125226414200132305ustar00rootroot00000000000000vkeybd-0.1.18d/ChangeLog000066400000000000000000000035131125226414200150040ustar00rootroot000000000000002009-08-26 ver.0.1.18d * Two Debian fixes regarding keyboard inputs (527942, 527943) http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527942 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527943 2009-07-16 ver.0.1.18c * LASH support (deprecated LADCCA) by Samuli Suominen * Add the reference to $(LDFLAGS) to Makefile 2008-04-17 ver.0.1.18b * improved vkeybd.desktop (by Antonio Bonifati) 2008-01-14 ver.0.1.18a * fixed 0.1.18 packaging bug (missing pixmaps) 2007-08-28 ver.0.1.18 * add Spanish keymap by Pedro Lopez-Cabanillas * parse locale-sensitive keymap file for the system-wide config * slightly fix documents 2007-08-06 ver.0.1.17b * fix build without linux/awe_voice.h * add COPTFLAGS to Makefile 2005-01-13 ver.0.1.17a * added french keyboard mapping by Jose JORGE 2004-08-31 ver.0.1.17 * bind left and right keys to shift keybase. * removed 'q' key binding, added ctrl-q instead. * save keymap file separately in ~/.vkeybdmap. default file is load from /usr/share/vkeybd/vkeybdmap. * save octave value to the config file. 2004-03-03 ver.0.1.16 * added desktop file and icon png files (courtesy of Ivo Clarysse). * fixed fskip.c. 2003-11-20 ver.0.1.15 * fixed the compilation with ALSA 1.0.0. * fix for ladcca-0.4.0 by Jacob Meuser. 2003-08-19 ver.0.1.14 * added the support of standard "--x=y" style options. * send program change immediately in ALSA mode. * added --laddca option. set "no" as default. 2003-07-03 ver.0.1.13a * fixed for new LADCCA API * removed debug messages 2003-01-23 ver.0.1.13 * fixed compile warnings (with the recent tcl/tk) * LADCCA support * README clean up * added vkeybdrc_german example by Matthias Nagorni 2002-07-25 ver.0.1.12 * don't override default key-bindings if defined * fixed for the newer tcl/tk 2002-02-22 ver.0.1.11a * fixed mouse motion on black keys vkeybd-0.1.18d/Makefile000066400000000000000000000056541125226414200147020ustar00rootroot00000000000000# # Makefile for vkeybd # copyright (c) 1997-2000 by Takashi Iwai # VERSION = 0.1.18d # # installation directory # PREFIX = /usr/local # binary and Tcl script are put there BIN_DIR = $(PREFIX)/bin # man page MAN_SUFFIX = 1 MAN_DIR = $(PREFIX)/share/man # data directory (/usr/share) DATA_DIR = $(PREFIX)/share # # preset and keyboard file are put here # VKBLIB_DIR = $(DATA_DIR)/vkeybd # # device selections -- multiple avaialble # to disable the device, set value 0 (do not comment out!) # USE_AWE = 1 USE_MIDI = 1 USE_ALSA = 1 USE_LASH = 0 # # Tcl/Tk library -- depends on your distribution # TCL_VERSION = 8.4 TCLLIB = -ltcl$(TCL_VERSION) TCLINC = TKLIB = -ltk$(TCL_VERSION) TKINC = XLIB = -L/usr/X11R6/lib -lX11 XINC = -I/usr/X11R6/include EXTRALIB += -ldl #---------------------------------------------------------------- # device definitions #---------------------------------------------------------------- # AWE device ifeq (1,$(USE_AWE)) DEVICES += -DVKB_USE_AWE DEVOBJS += oper_awe.o endif # MIDI device ifeq (1,$(USE_MIDI)) DEVICES += -DVKB_USE_MIDI DEVOBJS += oper_midi.o endif # ALSA sequencer ifeq (1,$(USE_ALSA)) DEVICES += -DVKB_USE_ALSA DEVOBJS += oper_alsa.o EXTRALIB += -lasound endif # # LASH stuff # ifeq (1,$(USE_LASH)) LASHCFLAGS = $(shell pkg-config --cflags lash-1.0) \ $(shell pkg-config --exists lash-1.0 && echo "-DHAVE_LASH" ) LASHLIBS = $(shell pkg-config --libs lash-1.0) DEVICES += $(LASHCFLAGS) EXTRALIB += $(LASHLIBS) endif #---------------------------------------------------------------- # dependencies #---------------------------------------------------------------- VKB_TCLFILE = $(VKBLIB_DIR)/vkeybd.tcl COPTFLAGS = -Wall -O CFLAGS = $(COPTFLAGS) -DVKB_TCLFILE=\"$(VKB_TCLFILE)\" \ -DVKBLIB_DIR=\"$(VKBLIB_DIR)\"\ -DVERSION_STR=\"$(VERSION)\"\ $(DEVICES) $(XINC) $(TCLINC) $(TKINC) $(LASHCFLAGS) TARGETS = vkeybd sftovkb all: $(TARGETS) vkeybd: vkb.o vkb_device.o $(DEVOBJS) $(EXTRAOBJS) $(CC) $(LDFLAGS) -o $@ $^ $(TKLIB) $(TCLLIB) $(XLIB) $(EXTRALIB) -lm sftovkb: sftovkb.o sffile.o malloc.o fskip.o $(CC) $(LDFLAGS) -o $@ $^ -lm install: $(TARGETS) vkeybd.tcl vkeybd.list vkeybdmap* mkdir -p $(DESTDIR)$(BIN_DIR) install -c -m 755 vkeybd $(DESTDIR)$(BIN_DIR) install -c -m 755 sftovkb $(DESTDIR)$(BIN_DIR) rm -f $(DESTDIR)$(BIN_DIR)/vkeybd.tcl mkdir -p $(DESTDIR)$(VKBLIB_DIR) install -c -m 444 vkeybd.tcl $(DESTDIR)$(VKBLIB_DIR) install -c -m 444 vkeybd.list $(DESTDIR)$(VKBLIB_DIR) install -c -m 444 vkeybdmap* $(DESTDIR)$(VKBLIB_DIR) install-man: mkdir -p $(DESTDIR)$(MAN_DIR)/man$(MAN_SUFFIX) install -c -m 444 vkeybd.man $(DESTDIR)$(MAN_DIR)/man$(MAN_SUFFIX)/vkeybd.$(MAN_SUFFIX) install-desktop: mkdir -p $(DESTDIR)$(DATA_DIR)/applications install -c -m 644 vkeybd.desktop $(DESTDIR)$(DATA_DIR)/applications mkdir -p $(DESTDIR)$(DATA_DIR)/pixmaps install -c -m 644 pixmaps/*.png $(DESTDIR)$(DATA_DIR)/pixmaps install-all: install install-man install-desktop clean: rm -f *.o $(TARGETS) vkeybd-0.1.18d/README000066400000000000000000000223031125226414200141100ustar00rootroot00000000000000==================================================================== VIRTUAL KEYBOARD ver.0.1.18 Takashi Iwai ==================================================================== GENERAL NOTES ------------- This is a virtual keyboard for AWE, MIDI and ALSA drivers. It's a simple fake of a MIDI keyboard on X-windows system. Enjoy a music with your mouse and "computer" keyboard :-) The program requires Tcl7.5/Tk4.1 or newer libraries. This program supports: - ALSA sequencer (ver.0.5.x or 0.9.x) - AWE driver on OSS (ver.0.4.3) - MIDI device on OSS and ALSA Since the most of the part is written by Tcl/Tk script, it'll be not so difficult to apply this program to other systems. INSTALLATION ------------ 1. Edit Makefile You may need to modify Makefile for your system. The following values can be configurable: - PREFIX Destination directory prefix (e.g. /usr/local) - BIN_DIR Destination directory where the program will be installed. - VKLIB_DIR Directory where vkeybd Tcl file, key list and preset list files are stored. - MAN_DIR Man page prefix directory (e.g. /usr/local/man) - MAN_SUFFIX Man page prefix - USE_ALSA - USE_AWE - USE_MIDI Device selection. Multiple devices are available. To disable a device, set the value 0. Do not undefine it. At least one of them must have non-zero value. - USE_LADCCA Supports LADCCA (http://pkl.net/~node/software/) Set 1 to add the this support. - TCLLIB Tcl library for linking, given as "-lxxx" - TCLINC Tcl include path option for cc, given as "-Ixxx" - TKLIB, XLIB Tk and X libraries (-lxxx) - TKINC, XINC Tk and X include path option (-Ixxx) - EXTRALIB Other required library (-lxxx) 2. Run make. 3. Install via "make install". USAGE ----- Load the soundfont via sfxload utility before using this program. Then, just start vkeybd. The following command line options are accpted. Common Options: --device mode Use the specified mode for output device. The argument are "awe", "midi" or "alsa", for AWE/OSS, MIDI/OSS and ALSA devices, respectively. Default is alsa. --config file Use the specified file as config file (see below) --keymap file Use the specified file as keymap file (see below) --preset file Use the specified file as preset list file (see below) --channel num Specify the channel to be played for normal instruments. Valid only for MIDI and ALSA devices. Default is 0. --drum num Specify the channel to be played for drum instruments. Valid only for MIDI and ALSA devices. Default is 9. --octave num Specify the number of octaves to display keys. Default is 3. ALSA Device Option: --addr client:port or 's' Set ALSA client and port numbers to be connected. If argument begins with 's', the port is opened as subscription port, and events are sent to all subscribers. Otherwise, vkeybd connects directly to the specified port. Default is 's'. --name string Specify the name of client/port. Some applications like tk707 check the client/port name whether it is a valid MIDI device port. This options makes vkeybd possible to "fake" as a real MIDI device. --ladcca bool Specify the support of LADCCA. Give yes or no as the argument. The default value is no. OSS Sequencer Device Option: --seqdev file Specify the device file path for sequencer access. As default /dev/sequencer is used. --seqidx num Specify the synth device index for AWE32/64 WaveTable. If negative value is given, the device is auto-probed. Default value is -1. MIDI Device Option: --mididev file Speicfy the file path of MIDI device. Default value is /dev/midi. FILE MENU --------- "Connection" shows whether the vkeybd connects to the device. On OSS system, only one application is allowed to access sequencer device. Thus, if one wants to play another program even using another device, he needs to disconnect vkeybd once. On ALSA or OSS emulation on ALSA, you don't have to switch vkeybd off, since multiple access is allowed. With "Save Config", the current keymap and view configuration are saved on ~/.vkeybdrc config file. This file will be read at the next invoke. VIEW MENU --------- Thie menu shows the check buttons to toggle the display of control buttons. With "Key/Velocity" button, a key and a velocity scale bars are shown. The key scale indicates the lowest note value of the visible keyboard (as default 48 = C4). The velocity scale bar is used to change the velocity of each note-on. With "Control" button, controls for the current channel and for the MIDI continous-controls are enabled. The channel number is increased or decreased by clicking the right or left button around the shown channel number. The bank and preset are remembered for each channel. You may choose the CC to be adjusted by pull-down menu, which indicates "ModWheel" as default. Then change the parameter value with the scale bar at the right side. With "Pitch" button, you may adjust pitch wheel. The pitch goes back to the center position when you click the "Pitch Clear" button at the left. With "Program" button, the selection list of playing instrument is toggled. The shown presets are read from preset list file. KEYBOARD -------- Each visible key is mapped on your computer keyboard from 'z' to '\'. On the version 0.1.11, the key auto-repeat is filtered so that only one note is generated. Thus you no longer have to turn off auto repeat via "xset -r". The key assignment can be changed by editting the config file ~/.vkeybdmap. Once save the current configuration via File/Save Keymap menu. The config file is the Tcl source, and you may change the list of keymap as you wish. The keymap is a list of elements consisting on the key symbol and the corresponding note offset. The key symbol is the X key symbol for assigned key, and note offset is the shifted note number from note key of beginning of keyboard, which is changed by "Key" scalebar. See the next section for details. KEYMAP FILE ----------- The keymap file can be specified via the command line option --keymap. If not given, the default keymap file is searched from the home directory (~/vkeybdmap or ~/.vkeybdmap) and the system-wide directory (/etc/vkeybdmap). The system-wide keymap is locale-sensitive now. A file vkeybdmap-$LANG is searched in prior. For example, /etc/vkeybdmap-de can be used for the german locale. CHANGING THE KEYMAP ------------------- The step for changing the keymap manually is like this. 1. Save the current configuration by "File / Save Keymap" menu. You'll have ~/.vkeybdmap file. 2. Edit it using your favorite text editor. There is a list of keymap definitions such as set keymap { {a 8} {z 9} {s 10} {x 11} .... The first element of each keymap is the key-symbol of X11. you can get the key-symbol for your computer keyboard by xev: 2a. Start xev on a terminal. % xev You'll get a small window. 2b. Move the cursor pointer into the window. Many X11 events will be displayed in realtime on the terminal. Depending on the window manager, you'll need to click the window to choose focus. 2c. Push the key you want to use. The key-push/release event will be shown on the terminal like below. KeyRelease event, serial 26, synthetic NO, window 0x1600001, root 0x3f, subw 0x0, time 4352873, (88,98), root:(1185,149), state 0x0, keycode 49 (keysym 0xff1b, Escape), same_screen YES, XLookupString gives 1 bytes: " Then you know the key-symbol is "Escape" (see keysym entry). The second element of each keymap is the MIDI note offset from the base note. If the key is set to 48 on the vkeybd and if you have a keymap entry like {Escape 15}, the key 63 (15+48) will be played when you push Escape key. 3. Restart vkeybd. PRESET LIST FILE ---------------- The preset list file is used to describe the list of MIDI preset names. If the command line option is omitted, the default preset list file "~/vkeybd.list", "~/.vkeybd.list" and "$vkblib/vkeybd.list" are searched sequentially. The preset list will appear when "Program" toggle button is on, and you can select your favorite sound from the list. The preset list file can be converted from soundfont file via sftovkb utility included in this package. For example, % sftovkb /usr/local/lib/sfbank/synthgm.sbk > vkeybd.list The only command line argument is the soundfont file name. This must be a full path name. ACKNOWLEDGMENT -------------- The desktop pixmaps are by courtesy of Ivo Clarysse. COPYRIGHT --------- Copyright (C) 1997-2007 Takashi Iwai This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. vkeybd-0.1.18d/awe_voice.h000066400000000000000000000477521125226414200153610ustar00rootroot00000000000000/* * sound/awe_voice.h * * Voice information definitions for the low level driver for the * AWE32/SB32/AWE64 wave table synth. * version 0.4.4; Jan. 4, 2000 * * Copyright (C) 1996-2000 Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef AWE_VOICE_H #define AWE_VOICE_H #ifndef SAMPLE_TYPE_AWE32 #define SAMPLE_TYPE_AWE32 0x20 #endif #define _LINUX_PATCHKEY_H_INDIRECT #include #undef _LINUX_PATCHKEY_H_INDIRECT /*---------------------------------------------------------------- * patch information record *----------------------------------------------------------------*/ /* patch interface header: 16 bytes */ typedef struct awe_patch_info { short key; /* use AWE_PATCH here */ #define AWE_PATCH _PATCHKEY(0x07) short device_no; /* synthesizer number */ unsigned short sf_id; /* file id (should be zero) */ short optarg; /* optional argument */ int len; /* data length (without this header) */ short type; /* patch operation type */ #define AWE_LOAD_INFO 0 /* awe_voice_rec */ #define AWE_LOAD_DATA 1 /* awe_sample_info */ #define AWE_OPEN_PATCH 2 /* awe_open_parm */ #define AWE_CLOSE_PATCH 3 /* none */ #define AWE_UNLOAD_PATCH 4 /* none */ #define AWE_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/ #define AWE_MAP_PRESET 6 /* awe_voice_map */ /*#define AWE_PROBE_INFO 7*/ /* awe_voice_map (pat only) */ #define AWE_PROBE_DATA 8 /* optarg=sample */ #define AWE_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */ #define AWE_LOAD_CHORUS_FX 0x10 /* awe_chorus_fx_rec (optarg=mode) */ #define AWE_LOAD_REVERB_FX 0x11 /* awe_reverb_fx_rec (optarg=mode) */ short reserved; /* word alignment data */ /* the actual patch data begins after this */ #if defined(AWE_COMPAT_030) && AWE_COMPAT_030 char data[0]; #endif } awe_patch_info; /*#define AWE_PATCH_INFO_SIZE 16*/ #define AWE_PATCH_INFO_SIZE sizeof(awe_patch_info) /*---------------------------------------------------------------- * open patch *----------------------------------------------------------------*/ #define AWE_PATCH_NAME_LEN 32 typedef struct _awe_open_parm { unsigned short type; /* sample type */ #define AWE_PAT_TYPE_MISC 0 #define AWE_PAT_TYPE_GM 1 #define AWE_PAT_TYPE_GS 2 #define AWE_PAT_TYPE_MT32 3 #define AWE_PAT_TYPE_XG 4 #define AWE_PAT_TYPE_SFX 5 #define AWE_PAT_TYPE_GUS 6 #define AWE_PAT_TYPE_MAP 7 #define AWE_PAT_LOCKED 0x100 /* lock the samples */ #define AWE_PAT_SHARED 0x200 /* sample is shared */ short reserved; char name[AWE_PATCH_NAME_LEN]; } awe_open_parm; /*#define AWE_OPEN_PARM_SIZE 28*/ #define AWE_OPEN_PARM_SIZE sizeof(awe_open_parm) /*---------------------------------------------------------------- * raw voice information record *----------------------------------------------------------------*/ /* wave table envelope & effect parameters to control EMU8000 */ typedef struct _awe_voice_parm { unsigned short moddelay; /* modulation delay (0x8000) */ unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */ unsigned short modrelease; /* modulation release time (0x807f) */ short modkeyhold, modkeydecay; /* envelope change per key (not used) */ unsigned short voldelay; /* volume delay (0x8000) */ unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */ unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */ unsigned short volrelease; /* volume release time (0x807f) */ short volkeyhold, volkeydecay; /* envelope change per key (not used) */ unsigned short lfo1delay; /* LFO1 delay (0x8000) */ unsigned short lfo2delay; /* LFO2 delay (0x8000) */ unsigned short pefe; /* modulation pitch & cutoff (0x0000) */ unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */ unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */ unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */ unsigned char cutoff; /* initial cutoff (0xff) */ unsigned char filterQ; /* initial filter Q [0-15] (0x0) */ unsigned char chorus; /* chorus send (0x00) */ unsigned char reverb; /* reverb send (0x00) */ unsigned short reserved[4]; /* not used */ } awe_voice_parm; typedef struct _awe_voice_parm_block { unsigned short moddelay; /* modulation delay (0x8000) */ unsigned char modatk, modhld; unsigned char moddcy, modsus; unsigned char modrel, moddummy; short modkeyhold, modkeydecay; /* envelope change per key (not used) */ unsigned short voldelay; /* volume delay (0x8000) */ unsigned char volatk, volhld; unsigned char voldcy, volsus; unsigned char volrel, voldummy; short volkeyhold, volkeydecay; /* envelope change per key (not used) */ unsigned short lfo1delay; /* LFO1 delay (0x8000) */ unsigned short lfo2delay; /* LFO2 delay (0x8000) */ unsigned char env1fc, env1pit; unsigned char lfo1fc, lfo1pit; unsigned char lfo1freq, lfo1vol; unsigned char lfo2freq, lfo2pit; unsigned char cutoff; /* initial cutoff (0xff) */ unsigned char filterQ; /* initial filter Q [0-15] (0x0) */ unsigned char chorus; /* chorus send (0x00) */ unsigned char reverb; /* reverb send (0x00) */ unsigned short reserved[4]; /* not used */ } awe_voice_parm_block; #define AWE_VOICE_PARM_SIZE 48 /* wave table parameters: 92 bytes */ typedef struct _awe_voice_info { unsigned short sf_id; /* file id (should be zero) */ unsigned short sample; /* sample id */ int start, end; /* sample offset correction */ int loopstart, loopend; /* loop offset correction */ short rate_offset; /* sample rate pitch offset */ unsigned short mode; /* sample mode */ #define AWE_MODE_ROMSOUND 0x8000 #define AWE_MODE_STEREO 1 #define AWE_MODE_LOOPING 2 #define AWE_MODE_NORELEASE 4 /* obsolete */ #define AWE_MODE_INIT_PARM 8 short root; /* midi root key */ short tune; /* pitch tuning (in cents) */ signed char low, high; /* key note range */ signed char vellow, velhigh; /* velocity range */ signed char fixkey, fixvel; /* fixed key, velocity */ signed char pan, fixpan; /* panning, fixed panning */ short exclusiveClass; /* exclusive class (0 = none) */ unsigned char amplitude; /* sample volume (127 max) */ unsigned char attenuation; /* attenuation (0.375dB) */ short scaleTuning; /* pitch scale tuning(%), normally 100 */ awe_voice_parm parm; /* voice envelope parameters */ short index; /* internal index (set by driver) */ } awe_voice_info; /*#define AWE_VOICE_INFO_SIZE 92*/ #define AWE_VOICE_INFO_SIZE sizeof(awe_voice_info) /*----------------------------------------------------------------*/ /* The info entry of awe_voice_rec is changed from 0 to 1 * for some compilers refusing zero size array. * Due to this change, sizeof(awe_voice_rec) becomes different * from older versions. * Use AWE_VOICE_REC_SIZE instead. */ /* instrument info header: 4 bytes */ typedef struct _awe_voice_rec_hdr { unsigned char bank; /* midi bank number */ unsigned char instr; /* midi preset number */ char nvoices; /* number of voices */ char write_mode; /* write mode; normally 0 */ #define AWE_WR_APPEND 0 /* append anyway */ #define AWE_WR_EXCLUSIVE 1 /* skip if already exists */ #define AWE_WR_REPLACE 2 /* replace if already exists */ } awe_voice_rec_hdr; /*#define AWE_VOICE_REC_SIZE 4*/ #define AWE_VOICE_REC_SIZE sizeof(awe_voice_rec_hdr) /* the standard patch structure for one sample */ typedef struct _awe_voice_rec_patch { awe_patch_info patch; awe_voice_rec_hdr hdr; awe_voice_info info; } awe_voice_rec_patch; /* obsolete data type */ #if defined(AWE_COMPAT_030) && AWE_COMPAT_030 #define AWE_INFOARRAY_SIZE 0 #else #define AWE_INFOARRAY_SIZE 1 #endif typedef struct _awe_voice_rec { unsigned char bank; /* midi bank number */ unsigned char instr; /* midi preset number */ short nvoices; /* number of voices */ /* voice information follows here */ awe_voice_info info[AWE_INFOARRAY_SIZE]; } awe_voice_rec; /*---------------------------------------------------------------- * sample wave information *----------------------------------------------------------------*/ /* wave table sample header: 32 bytes */ typedef struct awe_sample_info { unsigned short sf_id; /* file id (should be zero) */ unsigned short sample; /* sample id */ int start, end; /* start & end offset */ int loopstart, loopend; /* loop start & end offset */ int size; /* size (0 = ROM) */ short checksum_flag; /* use check sum = 1 */ unsigned short mode_flags; /* mode flags */ #define AWE_SAMPLE_8BITS 1 /* wave data is 8bits */ #define AWE_SAMPLE_UNSIGNED 2 /* wave data is unsigned */ #define AWE_SAMPLE_NO_BLANK 4 /* no blank loop is attached */ #define AWE_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */ #define AWE_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */ #define AWE_SAMPLE_STEREO_LEFT 32 /* stereo left sound */ #define AWE_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */ #define AWE_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ unsigned int checksum; /* check sum */ #if defined(AWE_COMPAT_030) && AWE_COMPAT_030 unsigned short data[0]; /* sample data follows here */ #endif } awe_sample_info; /*#define AWE_SAMPLE_INFO_SIZE 32*/ #define AWE_SAMPLE_INFO_SIZE sizeof(awe_sample_info) /*---------------------------------------------------------------- * voice preset mapping *----------------------------------------------------------------*/ typedef struct awe_voice_map { int map_bank, map_instr, map_key; /* key = -1 means all keys */ int src_bank, src_instr, src_key; } awe_voice_map; #define AWE_VOICE_MAP_SIZE sizeof(awe_voice_map) /*---------------------------------------------------------------- * awe hardware controls *----------------------------------------------------------------*/ #define _AWE_DEBUG_MODE 0x00 #define _AWE_REVERB_MODE 0x01 #define _AWE_CHORUS_MODE 0x02 #define _AWE_REMOVE_LAST_SAMPLES 0x03 #define _AWE_INITIALIZE_CHIP 0x04 #define _AWE_SEND_EFFECT 0x05 #define _AWE_TERMINATE_CHANNEL 0x06 #define _AWE_TERMINATE_ALL 0x07 #define _AWE_INITIAL_VOLUME 0x08 #define _AWE_INITIAL_ATTEN _AWE_INITIAL_VOLUME #define _AWE_RESET_CHANNEL 0x09 #define _AWE_CHANNEL_MODE 0x0a #define _AWE_DRUM_CHANNELS 0x0b #define _AWE_MISC_MODE 0x0c #define _AWE_RELEASE_ALL 0x0d #define _AWE_NOTEOFF_ALL 0x0e #define _AWE_CHN_PRESSURE 0x0f /*#define _AWE_GET_CURRENT_MODE 0x10*/ #define _AWE_EQUALIZER 0x11 /*#define _AWE_GET_MISC_MODE 0x12*/ /*#define _AWE_GET_FONTINFO 0x13*/ #define _AWE_MODE_FLAG 0x80 #define _AWE_COOKED_FLAG 0x40 /* not supported */ #define _AWE_MODE_VALUE_MASK 0x3F /*----------------------------------------------------------------*/ #define _AWE_SET_CMD(p,dev,voice,cmd,p1,p2) \ {((char*)(p))[0] = SEQ_PRIVATE;\ ((char*)(p))[1] = dev;\ ((char*)(p))[2] = _AWE_MODE_FLAG|(cmd);\ ((char*)(p))[3] = voice;\ ((unsigned short*)(p))[2] = p1;\ ((unsigned short*)(p))[3] = p2;} /* buffered access */ #define _AWE_CMD(dev, voice, cmd, p1, p2) \ {_SEQ_NEEDBUF(8);\ _AWE_SET_CMD(_seqbuf + _seqbufptr, dev, voice, cmd, p1, p2);\ _SEQ_ADVBUF(8);} /* direct access */ #define _AWE_CMD_NOW(seqfd,dev,voice,cmd,p1,p2) \ {struct seq_event_rec tmp;\ _AWE_SET_CMD(&tmp, dev, voice, cmd, p1, p2);\ ioctl(seqfd, SNDCTL_SEQ_OUTOFBAND, &tmp);} /*----------------------------------------------------------------*/ /* set debugging mode */ #define AWE_DEBUG_MODE(dev,p1) _AWE_CMD(dev, 0, _AWE_DEBUG_MODE, p1, 0) /* set reverb mode; from 0 to 7 */ #define AWE_REVERB_MODE(dev,p1) _AWE_CMD(dev, 0, _AWE_REVERB_MODE, p1, 0) /* set chorus mode; from 0 to 7 */ #define AWE_CHORUS_MODE(dev,p1) _AWE_CMD(dev, 0, _AWE_CHORUS_MODE, p1, 0) /* reset channel */ #define AWE_RESET_CHANNEL(dev,ch) _AWE_CMD(dev, ch, _AWE_RESET_CHANNEL, 0, 0) #define AWE_RESET_CONTROL(dev,ch) _AWE_CMD(dev, ch, _AWE_RESET_CHANNEL, 1, 0) /* send an effect to all layers */ #define AWE_SEND_EFFECT(dev,voice,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,type,value) #define AWE_ADD_EFFECT(dev,voice,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((type)|0x80),value) #define AWE_UNSET_EFFECT(dev,voice,type) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((type)|0x40),0) /* send an effect to a layer */ #define AWE_SEND_LAYER_EFFECT(dev,voice,layer,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((layer+1)<<8|(type)),value) #define AWE_ADD_LAYER_EFFECT(dev,voice,layer,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((layer+1)<<8|(type)|0x80),value) #define AWE_UNSET_LAYER_EFFECT(dev,voice,layer,type) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((layer+1)<<8|(type)|0x40),0) /* terminate sound on the channel/voice */ #define AWE_TERMINATE_CHANNEL(dev,voice) _AWE_CMD(dev,voice,_AWE_TERMINATE_CHANNEL,0,0) /* terminate all sounds */ #define AWE_TERMINATE_ALL(dev) _AWE_CMD(dev, 0, _AWE_TERMINATE_ALL, 0, 0) /* release all sounds (w/o sustain effect) */ #define AWE_RELEASE_ALL(dev) _AWE_CMD(dev, 0, _AWE_RELEASE_ALL, 0, 0) /* note off all sounds (w sustain effect) */ #define AWE_NOTEOFF_ALL(dev) _AWE_CMD(dev, 0, _AWE_NOTEOFF_ALL, 0, 0) /* set initial attenuation */ #define AWE_INITIAL_VOLUME(dev,atten) _AWE_CMD(dev, 0, _AWE_INITIAL_VOLUME, atten, 0) #define AWE_INITIAL_ATTEN AWE_INITIAL_VOLUME /* relative attenuation */ #define AWE_SET_ATTEN(dev,atten) _AWE_CMD(dev, 0, _AWE_INITIAL_VOLUME, atten, 1) /* set channel playing mode; mode=0/1/2 */ #define AWE_SET_CHANNEL_MODE(dev,mode) _AWE_CMD(dev, 0, _AWE_CHANNEL_MODE, mode, 0) #define AWE_PLAY_INDIRECT 0 /* indirect voice mode (default) */ #define AWE_PLAY_MULTI 1 /* multi note voice mode */ #define AWE_PLAY_DIRECT 2 /* direct single voice mode */ #define AWE_PLAY_MULTI2 3 /* sequencer2 mode; used internally */ /* set drum channel mask; channels is 32bit long value */ #define AWE_DRUM_CHANNELS(dev,channels) _AWE_CMD(dev, 0, _AWE_DRUM_CHANNELS, ((channels) & 0xffff), ((channels) >> 16)) /* set bass and treble control; values are from 0 to 11 */ #define AWE_EQUALIZER(dev,bass,treble) _AWE_CMD(dev, 0, _AWE_EQUALIZER, bass, treble) /* remove last loaded samples */ #define AWE_REMOVE_LAST_SAMPLES(seqfd,dev) _AWE_CMD_NOW(seqfd, dev, 0, _AWE_REMOVE_LAST_SAMPLES, 0, 0) /* initialize emu8000 chip */ #define AWE_INITIALIZE_CHIP(seqfd,dev) _AWE_CMD_NOW(seqfd, dev, 0, _AWE_INITIALIZE_CHIP, 0, 0) /* set miscellaneous modes; meta command */ #define AWE_MISC_MODE(dev,mode,value) _AWE_CMD(dev, 0, _AWE_MISC_MODE, mode, value) /* exclusive sound off; 1=off */ #define AWE_EXCLUSIVE_SOUND(dev,mode) AWE_MISC_MODE(dev,AWE_MD_EXCLUSIVE_SOUND,mode) /* default GUS bank number */ #define AWE_SET_GUS_BANK(dev,bank) AWE_MISC_MODE(dev,AWE_MD_GUS_BANK,bank) /* change panning position in realtime; 0=don't 1=do */ #define AWE_REALTIME_PAN(dev,mode) AWE_MISC_MODE(dev,AWE_MD_REALTIME_PAN,mode) /* extended pressure controls; not portable with other sound drivers */ #define AWE_KEY_PRESSURE(dev,ch,note,vel) SEQ_START_NOTE(dev,ch,(note)+128,vel) #define AWE_CHN_PRESSURE(dev,ch,vel) _AWE_CMD(dev,ch,_AWE_CHN_PRESSURE,vel,0) /*----------------------------------------------------------------*/ /* reverb mode parameters */ #define AWE_REVERB_ROOM1 0 #define AWE_REVERB_ROOM2 1 #define AWE_REVERB_ROOM3 2 #define AWE_REVERB_HALL1 3 #define AWE_REVERB_HALL2 4 #define AWE_REVERB_PLATE 5 #define AWE_REVERB_DELAY 6 #define AWE_REVERB_PANNINGDELAY 7 #define AWE_REVERB_PREDEFINED 8 /* user can define reverb modes up to 32 */ #define AWE_REVERB_NUMBERS 32 typedef struct awe_reverb_fx_rec { unsigned short parms[28]; } awe_reverb_fx_rec; /*----------------------------------------------------------------*/ /* chorus mode parameters */ #define AWE_CHORUS_1 0 #define AWE_CHORUS_2 1 #define AWE_CHORUS_3 2 #define AWE_CHORUS_4 3 #define AWE_CHORUS_FEEDBACK 4 #define AWE_CHORUS_FLANGER 5 #define AWE_CHORUS_SHORTDELAY 6 #define AWE_CHORUS_SHORTDELAY2 7 #define AWE_CHORUS_PREDEFINED 8 /* user can define chorus modes up to 32 */ #define AWE_CHORUS_NUMBERS 32 typedef struct awe_chorus_fx_rec { unsigned short feedback; /* feedback level (0xE600-0xE6FF) */ unsigned short delay_offset; /* delay (0-0x0DA3) [1/44100 sec] */ unsigned short lfo_depth; /* LFO depth (0xBC00-0xBCFF) */ unsigned int delay; /* right delay (0-0xFFFFFFFF) [1/256/44100 sec] */ unsigned int lfo_freq; /* LFO freq LFO freq (0-0xFFFFFFFF) */ } awe_chorus_fx_rec; /*----------------------------------------------------------------*/ /* misc mode types */ enum { /* 0*/ AWE_MD_EXCLUSIVE_OFF, /* obsolete */ /* 1*/ AWE_MD_EXCLUSIVE_ON, /* obsolete */ /* 2*/ AWE_MD_VERSION, /* read only */ /* 3*/ AWE_MD_EXCLUSIVE_SOUND, /* 0/1: exclusive note on (default=1) */ /* 4*/ AWE_MD_REALTIME_PAN, /* 0/1: do realtime pan change (default=1) */ /* 5*/ AWE_MD_GUS_BANK, /* bank number for GUS patches (default=0) */ /* 6*/ AWE_MD_KEEP_EFFECT, /* 0/1: keep effect values, (default=0) */ /* 7*/ AWE_MD_ZERO_ATTEN, /* attenuation of max volume (default=32) */ /* 8*/ AWE_MD_CHN_PRIOR, /* 0/1: set MIDI channel priority mode (default=1) */ /* 9*/ AWE_MD_MOD_SENSE, /* integer: modwheel sensitivity (def=18) */ /*10*/ AWE_MD_DEF_PRESET, /* integer: default preset number (def=0) */ /*11*/ AWE_MD_DEF_BANK, /* integer: default bank number (def=0) */ /*12*/ AWE_MD_DEF_DRUM, /* integer: default drumset number (def=0) */ /*13*/ AWE_MD_TOGGLE_DRUM_BANK, /* 0/1: toggle drum flag with bank# (def=0) */ /*14*/ AWE_MD_NEW_VOLUME_CALC, /* 0/1: volume calculation mode (def=1) */ /*15*/ AWE_MD_CHORUS_MODE, /* integer: chorus mode (def=2) */ /*16*/ AWE_MD_REVERB_MODE, /* integer: chorus mode (def=4) */ /*17*/ AWE_MD_BASS_LEVEL, /* integer: bass level (def=5) */ /*18*/ AWE_MD_TREBLE_LEVEL, /* integer: treble level (def=9) */ /*19*/ AWE_MD_DEBUG_MODE, /* integer: debug level (def=0) */ /*20*/ AWE_MD_PAN_EXCHANGE, /* 0/1: exchange panning direction (def=0) */ AWE_MD_END, }; /*----------------------------------------------------------------*/ /* effect parameters */ enum { /* modulation envelope parameters */ /* 0*/ AWE_FX_ENV1_DELAY, /* WORD: ENVVAL */ /* 1*/ AWE_FX_ENV1_ATTACK, /* BYTE: up ATKHLD */ /* 2*/ AWE_FX_ENV1_HOLD, /* BYTE: lw ATKHLD */ /* 3*/ AWE_FX_ENV1_DECAY, /* BYTE: lw DCYSUS */ /* 4*/ AWE_FX_ENV1_RELEASE, /* BYTE: lw DCYSUS */ /* 5*/ AWE_FX_ENV1_SUSTAIN, /* BYTE: up DCYSUS */ /* 6*/ AWE_FX_ENV1_PITCH, /* BYTE: up PEFE */ /* 7*/ AWE_FX_ENV1_CUTOFF, /* BYTE: lw PEFE */ /* volume envelope parameters */ /* 8*/ AWE_FX_ENV2_DELAY, /* WORD: ENVVOL */ /* 9*/ AWE_FX_ENV2_ATTACK, /* BYTE: up ATKHLDV */ /*10*/ AWE_FX_ENV2_HOLD, /* BYTE: lw ATKHLDV */ /*11*/ AWE_FX_ENV2_DECAY, /* BYTE: lw DCYSUSV */ /*12*/ AWE_FX_ENV2_RELEASE, /* BYTE: lw DCYSUSV */ /*13*/ AWE_FX_ENV2_SUSTAIN, /* BYTE: up DCYSUSV */ /* LFO1 (tremolo & vibrato) parameters */ /*14*/ AWE_FX_LFO1_DELAY, /* WORD: LFO1VAL */ /*15*/ AWE_FX_LFO1_FREQ, /* BYTE: lo TREMFRQ */ /*16*/ AWE_FX_LFO1_VOLUME, /* BYTE: up TREMFRQ */ /*17*/ AWE_FX_LFO1_PITCH, /* BYTE: up FMMOD */ /*18*/ AWE_FX_LFO1_CUTOFF, /* BYTE: lo FMMOD */ /* LFO2 (vibrato) parameters */ /*19*/ AWE_FX_LFO2_DELAY, /* WORD: LFO2VAL */ /*20*/ AWE_FX_LFO2_FREQ, /* BYTE: lo FM2FRQ2 */ /*21*/ AWE_FX_LFO2_PITCH, /* BYTE: up FM2FRQ2 */ /* Other overall effect parameters */ /*22*/ AWE_FX_INIT_PITCH, /* SHORT: pitch offset */ /*23*/ AWE_FX_CHORUS, /* BYTE: chorus effects send (0-255) */ /*24*/ AWE_FX_REVERB, /* BYTE: reverb effects send (0-255) */ /*25*/ AWE_FX_CUTOFF, /* BYTE: up IFATN */ /*26*/ AWE_FX_FILTERQ, /* BYTE: up CCCA */ /* Sample / loop offset changes */ /*27*/ AWE_FX_SAMPLE_START, /* SHORT: offset */ /*28*/ AWE_FX_LOOP_START, /* SHORT: offset */ /*29*/ AWE_FX_LOOP_END, /* SHORT: offset */ /*30*/ AWE_FX_COARSE_SAMPLE_START, /* SHORT: upper word offset */ /*31*/ AWE_FX_COARSE_LOOP_START, /* SHORT: upper word offset */ /*32*/ AWE_FX_COARSE_LOOP_END, /* SHORT: upper word offset */ /*33*/ AWE_FX_ATTEN, /* BYTE: lo IFATN */ AWE_FX_END, }; #endif /* AWE_VOICE_H */ vkeybd-0.1.18d/fskip.c000066400000000000000000000006731125226414200145160ustar00rootroot00000000000000/*---------------------------------------------------------------- * skip file position *----------------------------------------------------------------*/ #include void fskip(int size, FILE *fd, int seekable) { if (seekable) fseek(fd, size, SEEK_CUR); else { char tmp[1024]; while (size >= (int)sizeof(tmp)) { size -= fread(tmp, 1, sizeof(tmp), fd); } while (size > 0) size -= fread(tmp, 1, size, fd); } } vkeybd-0.1.18d/itypes.h000066400000000000000000000015021125226414200147140ustar00rootroot00000000000000/*================================================================ * integer types *================================================================*/ #ifndef ITYPES_H_DEF #define ITYPES_H_DEF /* 8bit bytes */ typedef unsigned char byte; /* 16bit integers */ typedef unsigned short uint16; typedef short int16; /* 32bit long integers */ typedef unsigned int uint32; typedef int int32; /**/ typedef union uint32rec { byte b8[4]; uint16 b16[4]; uint32 b32; } uint32rec; /* vp=uint32rec, cp=char* */ #define get32rec(vp,cp) memcpy(vp, cp, 4) #if 1 /* little endian */ #define swapi(x) x #define swapl(x) x #else /* big endian */ #define swapi(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) #define swapl(x) ((((x)&0xFF)<<24) | \ (((x)&0xFF00)<<8) | \ (((x)&0xFF0000)>>8) | \ (((x)>>24)&0xFF)) #endif #endif vkeybd-0.1.18d/malloc.c000066400000000000000000000005001125226414200146360ustar00rootroot00000000000000/* */ #include #include #include #include void *safe_malloc(int size) { void *p; p = (void*)calloc(size, 1); if (p == NULL) { fprintf(stderr, "can't malloc buffer for size %d!!\n", size); exit(1); } return p; } void safe_free(void *buf) { if (buf) free(buf); } vkeybd-0.1.18d/oper_alsa.c000066400000000000000000000167031125226414200153500ustar00rootroot00000000000000/* * operator for ALSA sequencer * * Virtual Tiny Keyboard * * Copyright (c) 1997-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "vkb.h" #include #include #include #include #include #include #ifdef USE_OLD_ALSA #include #else #include #endif #if SND_LIB_MAJOR > 0 || SND_LIB_MINOR >= 6 #define snd_seq_flush_output(x) snd_seq_drain_output(x) #define snd_seq_set_client_group(x,name) /*nop*/ #define my_snd_seq_open(seqp) snd_seq_open(seqp, "hw", SND_SEQ_OPEN_OUTPUT, 0) #else /* SND_SEQ_OPEN_OUT causes oops on early version of ALSA */ #define my_snd_seq_open(seqp) snd_seq_open(seqp, SND_SEQ_OPEN) #endif /* * functions */ static int seq_open(Tcl_Interp *ip, void **private_return); static void seq_close(Tcl_Interp *ip, void *private); static void note_on(Tcl_Interp *ip, void *private, int note, int vel); static void note_off(Tcl_Interp *ip, void *private, int note, int vel); static void control(Tcl_Interp *ip, void *private, int type, int val); static void program(Tcl_Interp *ip, void *private, int bank, int type); static void bender(Tcl_Interp *ip, void *private, int bend); static void chorus_mode(Tcl_Interp *ip, void *private, int mode); static void reverb_mode(Tcl_Interp *ip, void *private, int mode); static void send_event(int do_flush); #define DEFAULT_NAME "Virtual Keyboard" /* * definition of device information */ static vkb_oper_t alsa_oper = { seq_open, seq_close, program, note_on, note_off, control, bender, chorus_mode, reverb_mode, }; static vkb_optarg_t alsa_opts[] = { {"addr", "subscriber", "--addr client:port or 'subscriber' : ALSA sequencer destination"}, {"name", DEFAULT_NAME, "--name string : use the specified string as client/port names"}, #ifdef HAVE_LASH {"lash", "no", "--lash : support LASH (default = no)"}, #endif {NULL}, }; vkb_devinfo_t alsa_devinfo = { "alsa", /* device id */ "ALSA sequencer", /* name */ 0, /* delayed open */ &alsa_oper, /* operators */ alsa_opts, /* command line options */ }; /* */ static snd_seq_t *seq_handle = NULL; static int my_client, my_port; static int seq_client, seq_port; static int chan_no; #ifdef HAVE_LASH static lash_client_t * lash_client = NULL; #endif /* * parse address string */ #define ADDR_DELIM ".:" static int parse_addr(const char *arg, int *client, int *port) { char *p; if (isdigit(*arg)) { if ((p = strpbrk(arg, ADDR_DELIM)) == NULL) return -1; *client = atoi(arg); *port = atoi(p + 1); } else { if (*arg == 's' || *arg == 'S') { *client = SND_SEQ_ADDRESS_SUBSCRIBERS; *port = 0; } else return -1; } return 0; } /* * open device */ static int seq_open(Tcl_Interp *ip, void **private_return) { const char *var, *name; unsigned int caps; /* copy from Tcl variables */ if ((var = Tcl_GetVar2(ip, "optvar", "addr", TCL_GLOBAL_ONLY)) != NULL) { if (parse_addr(var, &seq_client, &seq_port) < 0) { vkb_error(ip, "invalid argument --addr %s\n", var); return 0; } } if (my_snd_seq_open(&seq_handle) < 0) { vkb_error(ip, "can't open sequencer device"); return 0; } /* get my client id */ my_client = snd_seq_client_id(seq_handle); /* tell the lash server our client id */ #ifdef HAVE_LASH if ((var = Tcl_GetVar2(ip, "optvar", "lash", TCL_GLOBAL_ONLY)) != NULL) { if (*var == 'y' || *var == 'Y' || *var == '1') { lash_client = lash_init (lash_args, "vkeybd", my_client, LASH_PROTOCOL_VERSION); if (lash_enabled (lash_client)) { lash_event_t * event; unsigned char id[2]; event = lash_event_new_with_type (LASH_Alsa_Client_ID); id[0] = snd_seq_client_id (seq_handle); id[1] = '\0'; lash_event_set_string (event, id); lash_send_event (lash_client, event); } } } #endif /* HAVE_LASH */ /* set client info */ if ((var = Tcl_GetVar2(ip, "optvar", "name", TCL_GLOBAL_ONLY)) != NULL) snd_seq_set_client_name(seq_handle, var); else snd_seq_set_client_name(seq_handle, DEFAULT_NAME); snd_seq_set_client_group(seq_handle, "input"); /* create port */ caps = SND_SEQ_PORT_CAP_READ; if (seq_client == SND_SEQ_ADDRESS_SUBSCRIBERS) caps |= SND_SEQ_PORT_CAP_SUBS_READ; if ((var = Tcl_GetVar2(ip, "optvar", "name", TCL_GLOBAL_ONLY)) != NULL) name = var; else name = DEFAULT_NAME; my_port = snd_seq_create_simple_port(seq_handle, name, caps, SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION); if (my_port < 0) { vkb_error(ip, "can't create port\n"); snd_seq_close(seq_handle); return 0; } if (seq_client != SND_SEQ_ADDRESS_SUBSCRIBERS) { /* subscribe to MIDI port */ if ( #ifdef HAVE_LASH !lash_enabled (lash_client) && #endif snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) { vkb_error(ip, "can't subscribe to MIDI port (%d:%d)\n", seq_client, seq_port); snd_seq_close(seq_handle); return 0; } } { char tmp[128]; sprintf(tmp, "wm title . \"Virtual Keyboard ver.1.9 \\[%d:%d\\]\"", my_client, my_port); Tcl_Eval(ip, tmp); } return 1; } static void seq_close(Tcl_Interp *ip, void *private) { snd_seq_close(seq_handle); } /* */ static snd_seq_event_t ev; static void send_event(int do_flush) { snd_seq_ev_set_direct(&ev); snd_seq_ev_set_source(&ev, my_port); snd_seq_ev_set_dest(&ev, seq_client, seq_port); snd_seq_event_output(seq_handle, &ev); if (do_flush) snd_seq_flush_output(seq_handle); } static void note_on(Tcl_Interp *ip, void *private, int note, int vel) { snd_seq_ev_set_noteon(&ev, chan_no, note, vel); send_event(1); } static void note_off(Tcl_Interp *ip, void *private, int note, int vel) { snd_seq_ev_set_noteoff(&ev, chan_no, note, vel); send_event(1); } static void control(Tcl_Interp *ip, void *private, int type, int val) { snd_seq_ev_set_controller(&ev, chan_no, type, val); send_event(1); } static void program(Tcl_Interp *ip, void *private, int bank, int preset) { vkb_get_int(ip, "channel", &chan_no); if (bank == 128) vkb_get_int(ip, "drum", &chan_no); else { snd_seq_ev_set_controller(&ev, 0, 0, bank); send_event(0); } snd_seq_ev_set_pgmchange(&ev, chan_no, preset); send_event(1); } static void bender(Tcl_Interp *ip, void *private, int bend) { snd_seq_ev_set_pitchbend(&ev, chan_no, bend); send_event(1); } static void chorus_mode(Tcl_Interp *ip, void *private, int mode) { static unsigned char sysex[11] = { 0xf0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x01, 0x38, 0, 0, 0xf7, }; sysex[8] = mode; snd_seq_ev_set_sysex(&ev, 11, sysex); send_event(1); snd_seq_ev_set_fixed(&ev); /* reset */ } static void reverb_mode(Tcl_Interp *ip, void *private, int mode) { static unsigned char sysex[11] = { 0xf0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x01, 0x30, 0, 0, 0xf7, }; sysex[8] = mode; snd_seq_ev_set_sysex(&ev, 11, sysex); send_event(1); snd_seq_ev_set_fixed(&ev); /* reset */ } vkeybd-0.1.18d/oper_awe.c000066400000000000000000000122651125226414200152030ustar00rootroot00000000000000/* * operator for AWE32/64 on OSS * * Virtual Tiny Keyboard * * Copyright (c) 1997-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define USE_NO_CONST #include "vkb.h" #include #include #include #include #ifdef __FreeBSD__ # include #elif defined(linux) # include #endif #include "awe_voice.h" /* * functions */ static int seq_open(Tcl_Interp *ip, void **private_return); static void seq_close(Tcl_Interp *ip, void *private); static void program(Tcl_Interp *ip, void *private, int bank, int preset); static void note_on(Tcl_Interp *ip, void *private, int note, int vel); static void note_off(Tcl_Interp *ip, void *private, int note, int vel); static void control(Tcl_Interp *ip, void *private, int type, int val); static void bender(Tcl_Interp *ip, void *private, int bend); static void chorus_mode(Tcl_Interp *ip, void *private, int mode); static void reverb_mode(Tcl_Interp *ip, void *private, int mode); /* * OSS sequencer stuff */ int seqfd; SEQ_DEFINEBUF(128); void seqbuf_dump(void) { if (_seqbufptr) { if (write(seqfd, _seqbuf, _seqbufptr) == -1) { perror("write sequencer"); exit(1); } } _seqbufptr = 0; } /* * definition of device information */ static vkb_oper_t awe_oper = { seq_open, seq_close, program, note_on, note_off, control, bender, chorus_mode, reverb_mode, }; #define SEQUENCER_DEV "/dev/sequencer" static vkb_optarg_t awe_opts[] = { {"seqdev", SEQUENCER_DEV, "--seqdev device : OSS sequencer device file"}, {"seqidx", "-1", "--seqidx device : speicfy synth index"}, {NULL}, }; vkb_devinfo_t awe_devinfo = { "awe", /* id */ "OSS AWE32/64 Synth", /* name */ 1, /* delayed open */ &awe_oper, /* operators */ awe_opts, /* options */ }; /* * for OSS interface */ SEQ_USE_EXTBUF(); extern int seqfd; static int awe_dev; /* * open device */ static int seq_open(Tcl_Interp *ip, void **private_return) { const char *var; const char *seqdev = SEQUENCER_DEV; int nrsynths; struct synth_info card_info; int i; if ((var = Tcl_GetVar2(ip, "optvar", "seqdev", TCL_GLOBAL_ONLY)) != NULL && *var) seqdev = var; if ((seqfd = open(seqdev, O_WRONLY, 0)) < 0) { vkb_error(ip, "can't open sequencer device '%s'", seqdev); return 0; } if (ioctl(seqfd, SNDCTL_SEQ_NRSYNTHS, &nrsynths) == -1) { vkb_error(ip, "there is no soundcard installed"); close(seqfd); return 0; } awe_dev = -1; vkb_get_int(ip, "seqidx", &awe_dev); if (awe_dev >= 0) { card_info.device = awe_dev; if (ioctl(seqfd, SNDCTL_SYNTH_INFO, &card_info) == -1) { vkb_error(ip, "cannot get info on soundcard %d", awe_dev); close(seqfd); return 0; } if (card_info.synth_type != SYNTH_TYPE_SAMPLE || card_info.synth_subtype != SAMPLE_TYPE_AWE32) { vkb_error(ip, "invalid synth device number %d\n", awe_dev); close(seqfd); return 0; } } else { /* auto-probe */ for (i = 0; i < nrsynths; i++) { card_info.device = i; if (ioctl(seqfd, SNDCTL_SYNTH_INFO, &card_info) == -1) { vkb_error(ip, "cannot get info on soundcard %d", i); close(seqfd); return 0; } if (card_info.synth_type == SYNTH_TYPE_SAMPLE && card_info.synth_subtype == SAMPLE_TYPE_AWE32) { awe_dev = i; break; } } if (awe_dev < 0) { vkb_error(ip, "No AWE synth device is found\n"); close(seqfd); return 0; } } /* use MIDI channel mode */ AWE_SET_CHANNEL_MODE(awe_dev, AWE_PLAY_MULTI); /* toggle drum flag if bank #128 is received */ AWE_MISC_MODE(awe_dev, AWE_MD_TOGGLE_DRUM_BANK, 1); return 1; } /* * close device */ static void seq_close(Tcl_Interp *ip, void *private) { close(seqfd); } static void program(Tcl_Interp *ip, void *private, int bank, int preset) { SEQ_CONTROL(awe_dev, 0, CTL_BANK_SELECT, bank); SEQ_SET_PATCH(awe_dev, 0, preset); /* no dumpbuf */ } static void note_on(Tcl_Interp *ip, void *private, int note, int vel) { SEQ_START_NOTE(awe_dev, 0, note, vel); SEQ_DUMPBUF(); } static void note_off(Tcl_Interp *ip, void *private, int note, int vel) { SEQ_STOP_NOTE(awe_dev, 0, note, vel); SEQ_DUMPBUF(); } static void control(Tcl_Interp *ip, void *private, int type, int val) { SEQ_CONTROL(awe_dev, 0, type, val); SEQ_DUMPBUF(); } static void bender(Tcl_Interp *ip, void *private, int bend) { SEQ_BENDER(awe_dev, 0, bend + 8192); SEQ_DUMPBUF(); } static void chorus_mode(Tcl_Interp *ip, void *private, int mode) { AWE_CHORUS_MODE(awe_dev, mode); SEQ_DUMPBUF(); } static void reverb_mode(Tcl_Interp *ip, void *private, int mode) { AWE_REVERB_MODE(awe_dev, mode); SEQ_DUMPBUF(); } vkeybd-0.1.18d/oper_midi.c000066400000000000000000000100721125226414200153430ustar00rootroot00000000000000/* * operator for MIDI device * * Virtual Tiny Keyboard * * Copyright (c) 1997-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define USE_NO_CONST #include "vkb.h" #include #include #include #ifdef __FreeBSD__ # include #elif defined(linux) # include #endif /* * functions */ static int seq_open(Tcl_Interp *ip, void **private_return); static void seq_close(Tcl_Interp *ip, void *private); static void note_on(Tcl_Interp *ip, void *private, int note, int vel); static void note_off(Tcl_Interp *ip, void *private, int note, int vel); static void program(Tcl_Interp *ip, void *private, int bank, int preset); static void control(Tcl_Interp *ip, void *private, int type, int val); static void bender(Tcl_Interp *ip, void *private, int bend); static void chorus_mode(Tcl_Interp *ip, void *private, int mode); static void reverb_mode(Tcl_Interp *ip, void *private, int mode); /* * definition of device information */ static vkb_oper_t midi_oper = { seq_open, seq_close, program, note_on, note_off, control, bender, chorus_mode, reverb_mode, }; #define MIDI_DEV "/dev/midi" static vkb_optarg_t midi_opts[] = { {"mididev", MIDI_DEV, "--mididev device : OSS midi device file"}, {NULL}, }; vkb_devinfo_t midi_devinfo = { "midi", /* id */ "MIDI device", /* name */ 1, /* delayed open */ &midi_oper, /* operators */ midi_opts, /* options */ }; /* * for OSS interface */ static FILE *fp; static int chan_no; /* */ static int seq_open(Tcl_Interp *ip, void **private_return) { const char *mididev = MIDI_DEV; const char *var; var = Tcl_GetVar2(ip, "optvar", "mididev", TCL_GLOBAL_ONLY); if (var != NULL && *var) mididev = var; if ((fp = fopen(mididev, "w")) == NULL) { vkb_error(ip, "can't open midi device file '%s'\n", mididev); return 0; } return 1; } static void seq_close(Tcl_Interp *ip, void *private) { fclose(fp); } /* */ static void note_on(Tcl_Interp *ip, void *private, int note, int vel) { putc(MIDI_NOTEON | chan_no, fp); putc(note, fp); putc(vel, fp); fflush(fp); } static void note_off(Tcl_Interp *ip, void *private, int note, int vel) { putc(MIDI_NOTEOFF | chan_no, fp); putc(0xf8, fp); putc(note, fp); putc(vel, fp); fflush(fp); } static void program(Tcl_Interp *ip, void *private, int bank, int preset) { vkb_get_int(ip, "channel", &chan_no); if (bank == 128) vkb_get_int(ip, "drum", &chan_no); else { putc(MIDI_CTL_CHANGE | chan_no, fp); putc(CTL_BANK_SELECT, fp); putc(bank, fp); } putc(MIDI_PGM_CHANGE | chan_no, fp); putc(preset, fp); /* no dumpbuf here */ } static void control(Tcl_Interp *ip, void *private, int type, int val) { putc(MIDI_CTL_CHANGE | chan_no, fp); putc(type, fp); putc(val, fp); fflush(fp); } static void bender(Tcl_Interp *ip, void *private, int bend) { bend += 8192; putc(MIDI_PITCH_BEND | chan_no, fp); putc(bend & 0x7f, fp); putc((bend >> 7) & 0x7f, fp); fflush(fp); } static void chorus_mode(Tcl_Interp *ip, void *private, int mode) { static unsigned char sysex[11] = { 0xf0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x01, 0x38, 0, 0, 0xf7, }; int i; sysex[8] = mode; for (i = 0; i < 11; i++) putc(sysex[i], fp); } static void reverb_mode(Tcl_Interp *ip, void *private, int mode) { static unsigned char sysex[11] = { 0xf0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x01, 0x30, 0, 0, 0xf7, }; int i; sysex[8] = mode; for (i = 0; i < 11; i++) putc(sysex[i], fp); } vkeybd-0.1.18d/pixmaps/000077500000000000000000000000001125226414200147115ustar00rootroot00000000000000vkeybd-0.1.18d/pixmaps/vkeybd_16x16.png000066400000000000000000000011031125226414200175430ustar00rootroot00000000000000PNG  IHDRabKGD pHYs  tIME uIDATxR͋q}㬫6~"bPź.l@/R4޼GtM:xò!$D]s qcLqMƆSA.{A0Sٌv8zm J1 q]ϗ EټoƇA;Na=e3 y\pV bSxLqwH$moo{<`4 L^e!AQqdYtjޖ~N}iDQF# QQ*0LDP(Z^Uq>1mP,I&xnAA.i (̦SUW2Uز5M{fƓrL\.ض[-ȒM$y~qqt:9Zf `*1J<!duy|rv|XK7T(J{)!$ _=]| IENDB`vkeybd-0.1.18d/pixmaps/vkeybd_32x32.png000066400000000000000000000030261125226414200175450ustar00rootroot00000000000000PNG  IHDR szzbKGD pHYs  tIME .fYIDATxMl30q@3Q#7i GIj퓈 x)RJ"n벻u E.RjHmc;db'fq?wJȮIwus?[lw'ORjkkr>[d2h4RN=zt GGG(0,j5|>DQQUU@ R: r6/x#]TOF{e(L0DOOVVV0:: ^[nl+++(`YPT . *~@@BX,DQDQ"T*A׃nXV\.t:hZB 2$IJdzMbifVRMMMqn7FFFNt:AQ<N8 ˅aԩS0͠i555e,C$<`|y150xKYgt:L&_iz7q111.ܼyFPJhnn`Y OmE=5V\<>/f~YZ?^Z O344D?ee]y}dV˲'TmEg{/(nj[lGxRC[gIIENDB`vkeybd-0.1.18d/pixmaps/vkeybd_48x48.png000066400000000000000000000055441125226414200175720ustar00rootroot00000000000000PNG  IHDR00WbKGD pHYs  tIME 1_ IDATxOgƟB!l7`0&!) U^UIhrѨUӫIj4LIf4ӄ`S x-\ҴU.$˲,Ks=>fmf_oI|Ma277~CB?СCԔ@"`bbpWEQ,g&hjjkVzQUUU6 ٬,NرPMMMB*۷o?F,~qW^fYM"BpeeD"eu[XW&雚:;;DJ XYY2sڵ>"x\"`Yruufuu&wd2n{wTfT2bv;ꫯ"LbzzO?x.`_;vFU x<ޙbQT755;wL&D"bfCcc#FGGߏ@ T*'OH&x;m6f 466eYDu#EQƒF)UTΝ; VW_Aܹs`W^D"Fz=4~?z-8q4Mcbb-Bȿ~r=P(???gYzPOOO{___Mmm8HPF 7@QZ[[q=D">|zHRhoojECC066l6vt:aɓ'~1qz˗E:(EII~_H$ι}tʺ:ў={AFt0HR0͐Jؽ{7f3qtuuall tzSSS(--Blq0`zp8ڌJR%H߇?}jO߿p__߮ڲݻw łwuuuZrطoaa0`2 `XP]] V-zXYY믿Պd2ZPYY XLwvv'+++XUf;8k2LGU `0HWTT`pp7o ?Vvvf al6d2h48nd2ѣGPTP(qD[[\.o===صkB!0 3 *s\fLNNjP*p:lEuu5j56 4Mr!& 333… @P(dB]];ZJ+[9eY, AY}`Qp)U,d2;ZZZ&T*nܻwBG*BOOJ%8"fgg{p`~~'N@0FOO4 zzz ގGi(4 B֋6Gfa`~;0-AT*ecXH$ ADAWWn7(N<98d2466>KKK `hh(++ùsP(`4QUUT={Em4 q[fwoAObL}yT*- ?aEQV&H$}]x^f7_|ׯCCR?KP__*hZ<'iP~FcY aiq~Baأ%rl Μ9#d2| K$LF*rNT*2, }b1,,,ZT*\.GUUՖ`bL. wFF71r? N3E=ZoggDdY)AM[ne*N, <ł1b1={FbǡE㸭 oVyMX__<-,yf42,‹.Ǿn0+ ; rN((d2amm D"h`Y"0 @Hpݰ\@v}'\ȤҒ#MD";MBdt[5LRBkvv,M%5 4VجyBB`ssxd!b}mq \XHGE\,0 r\CCY>t:j֚.^(GGGV\6+i(y,--Y"0X,&>;F;0yTL}o,izW<?ǽ{ʆh4eDǁ-Y{1hm.}NOO/B-yBT1ɔgieŞdEBs5P(|%UVRRSYQ$Kn=D_lT@VEJl~/ ؂_[6l6lKh\BIENDB`vkeybd-0.1.18d/sffile.c000066400000000000000000000373461125226414200146610ustar00rootroot00000000000000/*================================================================ * sffile.c * read SoundFont file (SBK/SF2) and store the layer lists * * Copyright (C) 1996,1997 Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *================================================================*/ #include #include #include #include "sffile.h" #include "util.h" /*================================================================ * preset / instrument bag record *================================================================*/ typedef struct _SFBags { int nbags; uint16 *bag; int ngens; SFGenRec *gen; } SFBags; static SFBags prbags, inbags; /*---------------------------------------------------------------- * function prototypes *----------------------------------------------------------------*/ #define NEW(type,nums) (type*)safe_malloc(sizeof(type) * (nums)) #define READCHUNK(var,fd) fread(&var, 8, 1, fd) #define READID(var,fd) fread(var, 4, 1, fd) #define READSTR(var,fd) fread(var, 20, 1, fd) #define READDW(var,fd) fread(&var, 4, 1, fd) #define READW(var,fd) fread(&var, 2, 1, fd) #define READB(var,fd) fread(&var, 1, 1, fd) #define SKIPB(fd) {char dummy; fread(&dummy, 1, 1, fd);} #define SKIPW(fd) {short dummy; fread(&dummy, 2, 1, fd);} #define SKIPDW(fd) {int dummy; fread(&dummy, 4, 1, fd);} static int seekable; #define FSKIP(size,fd) fskip(size, fd, seekable) /*----------------------------------------------------------------*/ static int chunkid(char *id); static int process_list(int size, SFInfo *sf, FILE *fd); static int process_info(int size, SFInfo *sf, FILE *fd); static int process_sdta(int size, SFInfo *sf, FILE *fd); static int process_pdta(int size, SFInfo *sf, FILE *fd); static void load_sample_names(int size, SFInfo *sf, FILE *fd); static void load_preset_header(int size, SFInfo *sf, FILE *fd); static void load_inst_header(int size, SFInfo *sf, FILE *fd); static void load_bag(int size, SFBags *bagp, FILE *fd); static void load_gen(int size, SFBags *bagp, FILE *fd); static void load_sample_info(int size, SFInfo *sf, FILE *fd); static void convert_layers(SFInfo *sf); static void generate_layers(SFHeader *hdr, SFHeader *next, SFBags *bags); static void free_layer(SFHeader *hdr); /*---------------------------------------------------------------- * id numbers *----------------------------------------------------------------*/ enum { /* level 0; chunk */ UNKN_ID, RIFF_ID, LIST_ID, SFBK_ID, /* level 1; id only */ INFO_ID, SDTA_ID, PDTA_ID, /* info stuff; chunk */ IFIL_ID, ISNG_ID, IROM_ID, INAM_ID, IVER_ID, IPRD_ID, ICOP_ID, /* sample data stuff; chunk */ SNAM_ID, SMPL_ID, /* preset stuff; chunk */ PHDR_ID, PBAG_ID, PMOD_ID, PGEN_ID, /* inst stuff; chunk */ INST_ID, IBAG_ID, IMOD_ID, IGEN_ID, /* sample header; chunk */ SHDR_ID, }; /*================================================================ * load a soundfont file *================================================================*/ int load_soundfont(SFInfo *sf, FILE *fd, int is_seekable) { SFChunk chunk; seekable = is_seekable; sf->preset = NULL; sf->sample = NULL; sf->inst = NULL; sf->sf_name = NULL; prbags.bag = inbags.bag = NULL; prbags.gen = inbags.gen = NULL; /* check RIFF file header */ READCHUNK(chunk, fd); if (chunkid(chunk.id) != RIFF_ID) { fprintf(stderr, "*** not a RIFF file\n"); return -1; } /* check file id */ READID(chunk.id, fd); if (chunkid(chunk.id) != SFBK_ID) { fprintf(stderr, "*** not a SoundFont file\n"); return -1; } for (;;) { READCHUNK(chunk, fd); if (feof(fd)) break; else if (chunkid(chunk.id) == LIST_ID) { if (process_list(chunk.size, sf, fd)) break; } else { fprintf(stderr, "*** illegal id in level 0: %4.4s %4d\n", chunk.id, chunk.size); FSKIP(chunk.size, fd); } } /* parse layer structure */ convert_layers(sf); /* free private tables */ if (prbags.bag) free(prbags.bag); if (prbags.gen) free(prbags.gen); if (inbags.bag) free(inbags.bag); if (inbags.gen) free(inbags.gen); return 0; } /*================================================================ * free buffer *================================================================*/ void free_soundfont(SFInfo *sf) { int i; if (sf->preset) { for (i = 0; i < sf->npresets; i++) free_layer(&sf->preset[i].hdr); free(sf->preset); } if (sf->inst) { for (i = 0; i < sf->ninsts; i++) free_layer(&sf->inst[i].hdr); free(sf->inst); } if (sf->sample) free(sf->sample); if (sf->sf_name) free(sf->sf_name); } /*---------------------------------------------------------------- * get id value from 4bytes ID string *----------------------------------------------------------------*/ static int chunkid(char *id) { static struct idstring { char *str; int id; } idlist[] = { {"RIFF", RIFF_ID}, {"LIST", LIST_ID}, {"sfbk", SFBK_ID}, {"INFO", INFO_ID}, {"sdta", SDTA_ID}, {"snam", SNAM_ID}, {"smpl", SMPL_ID}, {"pdta", PDTA_ID}, {"phdr", PHDR_ID}, {"pbag", PBAG_ID}, {"pmod", PMOD_ID}, {"pgen", PGEN_ID}, {"inst", INST_ID}, {"ibag", IBAG_ID}, {"imod", IMOD_ID}, {"igen", IGEN_ID}, {"shdr", SHDR_ID}, {"ifil", IFIL_ID}, {"isng", ISNG_ID}, {"irom", IROM_ID}, {"iver", IVER_ID}, {"INAM", INAM_ID}, {"IPRD", IPRD_ID}, {"ICOP", ICOP_ID}, }; int i; for (i = 0; i < sizeof(idlist)/sizeof(idlist[0]); i++) { if (strncmp(id, idlist[i].str, 4) == 0) return idlist[i].id; } return UNKN_ID; } /*================================================================ * process a list chunk *================================================================*/ static int process_list(int size, SFInfo *sf, FILE *fd) { SFChunk chunk; /* read the following id string */ READID(chunk.id, fd); size -= 4; switch (chunkid(chunk.id)) { case INFO_ID: return process_info(size, sf, fd); case SDTA_ID: return process_sdta(size, sf, fd); case PDTA_ID: return process_pdta(size, sf, fd); default: fprintf(stderr, "*** illegal id in level 1: %4.4s\n", chunk.id); FSKIP(size, fd); /* skip it */ return 0; } } /*================================================================ * process info list *================================================================*/ static int process_info(int size, SFInfo *sf, FILE *fd) { sf->infopos = ftell(fd); sf->infosize = size; /* parse the buffer */ while (size > 0) { SFChunk chunk; /* read a sub chunk */ READCHUNK(chunk, fd); size -= 8; if (feof(fd)) return -1; switch (chunkid(chunk.id)) { case IFIL_ID: /* soundfont file version */ READW(sf->version, fd); READW(sf->minorversion, fd); break; case INAM_ID: /* name of the font */ sf->sf_name = (char*)safe_malloc(chunk.size + 1); fread(sf->sf_name, 1, chunk.size, fd); sf->sf_name[chunk.size] = 0; break; default: FSKIP(chunk.size, fd); break; } size -= chunk.size; } return 0; } /*================================================================ * process sample data list *================================================================*/ static int process_sdta(int size, SFInfo *sf, FILE *fd) { while (size > 0) { SFChunk chunk; /* read a sub chunk */ READCHUNK(chunk, fd); size -= 8; if (feof(fd)) return -1; switch (chunkid(chunk.id)) { case SNAM_ID: /* sample name list */ load_sample_names(chunk.size, sf, fd); break; case SMPL_ID: /* sample data starts from here */ sf->samplepos = ftell(fd); sf->samplesize = chunk.size; FSKIP(chunk.size, fd); break; default: FSKIP(chunk.size, fd); break; } size -= chunk.size; } return 0; } /*================================================================ * process preset data list *================================================================*/ static int process_pdta(int size, SFInfo *sf, FILE *fd) { while (size > 0) { SFChunk chunk; /* read a subchunk */ READCHUNK(chunk, fd); size -= 8; if (feof(fd)) return -1; switch (chunkid(chunk.id)) { case PHDR_ID: load_preset_header(chunk.size, sf, fd); break; case PBAG_ID: load_bag(chunk.size, &prbags, fd); break; case PGEN_ID: load_gen(chunk.size, &prbags, fd); break; case INST_ID: load_inst_header(chunk.size, sf, fd); break; case IBAG_ID: load_bag(chunk.size, &inbags, fd); break; case IGEN_ID: load_gen(chunk.size, &inbags, fd); break; case SHDR_ID: load_sample_info(chunk.size, sf, fd); break; case PMOD_ID: /* ignored */ case IMOD_ID: /* ingored */ default: FSKIP(chunk.size, fd); break; } size -= chunk.size; } return 0; } /*---------------------------------------------------------------- * store sample name list; sf1 only *----------------------------------------------------------------*/ static void load_sample_names(int size, SFInfo *sf, FILE *fd) { int i, nsamples; if (sf->version > 1) { fprintf(stderr, "*** version 2 has obsolete format??\n"); FSKIP(size, fd); return; } /* each sample name has a fixed lentgh (20 bytes) */ nsamples = size / 20; if (sf->sample == NULL) { sf->nsamples = nsamples; sf->sample = NEW(SFSampleInfo, sf->nsamples); } else if (sf->nsamples != nsamples) { fprintf(stderr, "*** different # of samples ?? (%d : %d)\n", sf->nsamples, nsamples); FSKIP(size, fd); return; } /* read each name from file */ for (i = 0; i < sf->nsamples; i++) { READSTR(sf->sample[i].name, fd); } } /*---------------------------------------------------------------- * preset header list *----------------------------------------------------------------*/ static void load_preset_header(int size, SFInfo *sf, FILE *fd) { int i; sf->npresets = size / 38; sf->preset = NEW(SFPresetHdr, sf->npresets); for (i = 0; i < sf->npresets; i++) { READSTR(sf->preset[i].hdr.name, fd); READW(sf->preset[i].preset, fd); READW(sf->preset[i].bank, fd); READW(sf->preset[i].hdr.bagNdx, fd); SKIPDW(fd); /* lib; ignored*/ SKIPDW(fd); /* genre; ignored */ SKIPDW(fd); /* morph; ignored */ /* initialize layer table; it'll be parsed later */ sf->preset[i].hdr.nlayers = 0; sf->preset[i].hdr.layer = NULL; } } /*---------------------------------------------------------------- * instrument header list *----------------------------------------------------------------*/ static void load_inst_header(int size, SFInfo *sf, FILE *fd) { int i; sf->ninsts = size / 22; sf->inst = NEW(SFInstHdr, sf->ninsts); for (i = 0; i < sf->ninsts; i++) { READSTR(sf->inst[i].hdr.name, fd); READW(sf->inst[i].hdr.bagNdx, fd); /* iniitialize layer table; it'll be parsed later */ sf->inst[i].hdr.nlayers = 0; sf->inst[i].hdr.layer = NULL; } } /*---------------------------------------------------------------- * load preset/instrument bag list on the private table *----------------------------------------------------------------*/ static void load_bag(int size, SFBags *bagp, FILE *fd) { int i; size /= 4; bagp->bag = NEW(uint16, size); for (i = 0; i < size; i++) { READW(bagp->bag[i], fd); SKIPW(fd); /* mod; ignored */ } bagp->nbags = size; } /*---------------------------------------------------------------- * load preset/instrument generator list on the private table *----------------------------------------------------------------*/ static void load_gen(int size, SFBags *bagp, FILE *fd) { int i; size /= 4; bagp->gen = NEW(SFGenRec, size); for (i = 0; i < size; i++) { READW(bagp->gen[i].oper, fd); READW(bagp->gen[i].amount, fd); } bagp->ngens = size; } /*---------------------------------------------------------------- * load sample info list *----------------------------------------------------------------*/ static void load_sample_info(int size, SFInfo *sf, FILE *fd) { int i; int in_rom; /* the record size depends on the soundfont version */ if (sf->version > 1) { /* SF2 includes sample name and other infos */ sf->nsamples = size / 46; sf->sample = NEW(SFSampleInfo, sf->nsamples); } else { /* SBK; sample name may be read already */ int nsamples = size / 16; if (sf->sample == NULL) { sf->nsamples = nsamples; sf->sample = NEW(SFSampleInfo, sf->nsamples); } else if (sf->nsamples != nsamples) { #if 0 fprintf(stderr, "*** different # of infos ?? (%d : %d)\n", sf->nsamples, nsamples); FSKIP(size, fd); return; #endif /* overwrite it */ sf->nsamples = nsamples; } } in_rom = 1; /* data may start from ROM samples */ for (i = 0; i < sf->nsamples; i++) { if (sf->version > 1) /* SF2 only */ READSTR(sf->sample[i].name, fd); READDW(sf->sample[i].startsample, fd); READDW(sf->sample[i].endsample, fd); READDW(sf->sample[i].startloop, fd); READDW(sf->sample[i].endloop, fd); if (sf->version > 1) { /* SF2 only */ READDW(sf->sample[i].samplerate, fd); READB(sf->sample[i].originalPitch, fd); READB(sf->sample[i].pitchCorrection, fd); READW(sf->sample[i].samplelink, fd); READW(sf->sample[i].sampletype, fd); } else { /* for SBK; set missing infos */ sf->sample[i].samplerate = 44100; sf->sample[i].originalPitch = 60; sf->sample[i].pitchCorrection = 0; sf->sample[i].samplelink = 0; /* the first RAM data starts from address 0 */ if (sf->sample[i].startsample == 0) in_rom = 0; if (in_rom) sf->sample[i].sampletype = 0x8001; else sf->sample[i].sampletype = 1; } } } /*================================================================ * convert from bags to layers *================================================================*/ static void convert_layers(SFInfo *sf) { int i; if (prbags.bag == NULL || prbags.gen == NULL || inbags.bag == NULL || inbags.gen == NULL) { fprintf(stderr, "*** illegal bags / gens\n"); return; } for (i = 0; i < sf->npresets - 1; i++) { generate_layers(&sf->preset[i].hdr, &sf->preset[i+1].hdr, &prbags); } for (i = 0; i < sf->ninsts - 1; i++) { generate_layers(&sf->inst[i].hdr, &sf->inst[i+1].hdr, &inbags); } } /*---------------------------------------------------------------- * generate layer lists from stored bags *----------------------------------------------------------------*/ static void generate_layers(SFHeader *hdr, SFHeader *next, SFBags *bags) { int i; SFGenLayer *layp; hdr->nlayers = next->bagNdx - hdr->bagNdx; if (hdr->nlayers < 0) { fprintf(stderr, "illegal layer numbers %d\n", hdr->nlayers); return; } if (hdr->nlayers == 0) return; hdr->layer = (SFGenLayer*)safe_malloc(sizeof(SFGenLayer) * hdr->nlayers); layp = hdr->layer; for (layp = hdr->layer, i = hdr->bagNdx; i < next->bagNdx; layp++, i++) { int genNdx = bags->bag[i]; layp->nlists = bags->bag[i+1] - genNdx; if (layp->nlists < 0) { fprintf(stderr, "illegal list numbers %d\n", layp->nlists); return; } layp->list = (SFGenRec*)safe_malloc(sizeof(SFGenRec) * layp->nlists); memcpy(layp->list, &bags->gen[genNdx], sizeof(SFGenRec) * layp->nlists); } } /*---------------------------------------------------------------- * free a layer *----------------------------------------------------------------*/ static void free_layer(SFHeader *hdr) { int i; for (i = 0; i < hdr->nlayers; i++) { SFGenLayer *layp = &hdr->layer[i]; if (layp->nlists > 0) free(layp->list); } if (hdr->nlayers > 0) free(hdr->layer); } vkeybd-0.1.18d/sffile.h000066400000000000000000000064421125226414200146570ustar00rootroot00000000000000/*================================================================ * sffile.h * SoundFont file (SBK/SF2) format defintions * * Copyright (C) 1996,1997 Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *================================================================*/ #ifndef SFFILE_H_DEF #define SFFILE_H_DEF #include #include "itypes.h" /* chunk record header */ typedef struct _SFChunk { char id[4]; int32 size; } SFChunk; /* generator record */ typedef struct _SFGenRec { int16 oper; int16 amount; } SFGenRec; /* layered generators record */ typedef struct _SFGenLayer { int nlists; SFGenRec *list; } SFGenLayer; /* header record */ typedef struct _SFHeader { char name[20]; uint16 bagNdx; /* layered stuff */ int nlayers; SFGenLayer *layer; } SFHeader; /* preset header record */ typedef struct _SFPresetHdr { SFHeader hdr; uint16 preset, bank; /*int32 lib, genre, morphology;*/ /* not used */ } SFPresetHdr; /* instrument header record */ typedef struct _SFInstHdr { SFHeader hdr; } SFInstHdr; /* sample info record */ typedef struct _SFSampleInfo { char name[20]; int32 startsample, endsample; int32 startloop, endloop; /* ver.2 additional info */ int32 samplerate; byte originalPitch; byte pitchCorrection; uint16 samplelink; uint16 sampletype; /*1=mono, 2=right, 4=left, 8=linked, $8000=ROM*/ /* optional info */ int32 size; /* sample size */ int32 loopshot; /* short-shot loop size */ } SFSampleInfo; /*---------------------------------------------------------------- * soundfont file info record *----------------------------------------------------------------*/ typedef struct _SFInfo { /* file name */ char *sf_name; /* version of this file */ int16 version, minorversion; /* sample position (from origin) & total size (in bytes) */ long samplepos; int32 samplesize; /* raw INFO chunk list */ long infopos, infosize; /* preset headers */ int npresets; SFPresetHdr *preset; /* sample infos */ int nsamples; SFSampleInfo *sample; /* instrument headers */ int ninsts; SFInstHdr *inst; } SFInfo; /*---------------------------------------------------------------- * functions *----------------------------------------------------------------*/ /* sffile.c */ int load_soundfont(SFInfo *sf, FILE *fp, int is_seekable); void free_soundfont(SFInfo *sf); void save_soundfont(SFInfo *sf, FILE *fin, FILE *fout); void load_textinfo(SFInfo *sf, FILE *fp); /* sample.c */ void correct_samples(SFInfo *sf); extern int auto_add_blank; /* parsesf.c */ int convert_soundfont(SFInfo *sf, int check_samples); extern int default_bank; extern int default_chorus, default_reverb; extern int default_volume; #endif vkeybd-0.1.18d/sftovkb.c000066400000000000000000000035131125226414200150540ustar00rootroot00000000000000/* * convert from SoundFont file to vkeybd preset list file * * Copyright (c) 1999-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include "util.h" #include "sffile.h" /* parse soundfont file and give the preset list */ int main(int argc, char **argv) { FILE *fp; SFInfo sf; int i; if (argc < 2) { fprintf(stderr, "usage: sftovkb soundfont\n"); exit(1); } /*fprintf(stderr, "opening %s..\n", argv[1]);*/ if ((fp = fopen(argv[1], "r")) == NULL) { fprintf(stderr, "can't open soundfont file\n"); exit(1); } if (load_soundfont(&sf, fp, TRUE)) { fprintf(stderr, "fail to read soundfont file\n"); exit(1); } fclose(fp); for (i = 0; i < sf.npresets-1; i++) { char *p; /* convert illegal characters */ for (p = sf.preset[i].hdr.name; *p; p++) { if (!isprint(*p) || *p == '{' || *p == '}') *p = ' '; else if (*p == '[') *p = '('; else if (*p == ']') *p = ')'; } printf("%d %d %s\n", sf.preset[i].bank, sf.preset[i].preset, sf.preset[i].hdr.name); } free_soundfont(&sf); return 0; } vkeybd-0.1.18d/util.h000066400000000000000000000020001125226414200143460ustar00rootroot00000000000000/*================================================================ * utility routines *================================================================*/ #ifndef UTIL_H_DEF #define UTIL_H_DEF #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define numberof(ary) (sizeof(ary)/sizeof(ary[0])) #ifndef offsetof #define offsetof(s_type,field) ((int)(((char*)(&(((s_type*)NULL)->field)))-((char*)NULL))) #endif #define BITON(var,flag) ((var) |= (flag)) #define BITOFF(var,flag) ((var) &= ~(flag)) #define BITSWT(var,flag) ((var) ^= (flag)) extern int verbose, debug; #define DEBUG(LVL,XXX) {if (verbose > LVL) { XXX; }} /* cmpopen.c */ int CmpSearchFile(char *name); char *CmpExtension(int type); FILE *CmpOpenFile(char *name, int *flag); void CmpCloseFile(FILE *fp, int flag); /* malloc.c */ void *safe_malloc(int size); void safe_free(void *ptr); /* signal.c */ void add_signal(int sig, void (*handler)(), int exit_after); /* fskip.c */ void fskip(int size, FILE *fd, int seekable); #endif vkeybd-0.1.18d/vkb.c000066400000000000000000000232751125226414200141670ustar00rootroot00000000000000/* * main routine * * Virtual Tiny Keyboard * * Copyright (c) 1997-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "vkb.h" #include #include #include #include #include #ifndef Tk_Main #define Tk_Main(argc, argv, proc) \ Tk_MainEx(argc, argv, proc, Tcl_CreateInterp()) #endif /* */ #define DEF_INST_CHAN_NO "0" #define DEF_DRUM_CHAN_NO "9" #define DEF_OCTAVES "3" /* * prototypes */ static int usage(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_on(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_off(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_start_note(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_stop_note(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_control(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_program(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_bender(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_chorus_mode(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int seq_reverb_mode(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]); static int vkb_app_init(Tcl_Interp *interp); /* * local common variables */ static void *private; static int seq_opened = 0; static int seq_bank = 0, seq_preset = 0; static int seq_bend = 0; static vkb_oper_t *oper; #ifdef HAVE_LASH lash_args_t * lash_args = NULL; #endif /* * main routine */ int main(int argc, char **argv) { char **nargv; int c, nargc; #ifdef HAVE_LASH lash_args = lash_extract_args(&argc, &argv); #endif /* HAVE_LASH */ nargc = argc + 1; if ((nargv = (char**)malloc(sizeof(char*) * nargc)) == NULL) { fprintf(stderr, "vkeybd: can't malloc\n"); exit(1); } nargv[0] = "-f"; nargv[1] = VKB_TCLFILE; for (c = 1; c < argc; c++) nargv[c+1] = argv[c]; /* copy the default device operator */ if (vkb_num_devices <= 0) { fprintf(stderr, "vkeybd: no device is defined\n"); exit(1); } /* call Tk main routine */ Tk_Main(nargc, nargv, vkb_app_init); return 0; } /* * print usage */ static int usage(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { int i; fprintf(stderr, "vkeybd -- virtual keyboard\n"); fprintf(stderr, " version %s\n", VERSION_STR); fprintf(stderr, "Copyright (c) 1997-2000 Takashi Iwai\n"); fprintf(stderr, "usage: vkeybd [-options]\n"); fprintf(stderr, "* general options:\n"); fprintf(stderr, " --device mode : specify output device (default = %s)\n", vkb_device[0]->name); fprintf(stderr, " --keymap file : use own keymap file\n"); fprintf(stderr, " --preset file : use preset list file\n"); fprintf(stderr, " --channel number : specify instrument channel (0-15) (default = %s)\n", DEF_INST_CHAN_NO); fprintf(stderr, " --drum number : specify drum channel (0-15) (default = %s)\n", DEF_DRUM_CHAN_NO); fprintf(stderr, " --octave number : specify octaves of displaying keys (default = %s)\n", DEF_OCTAVES); fprintf(stderr, "* output devices:\n"); for (i = 0; i < vkb_num_devices; i++) { vkb_optarg_t *p; fprintf(stderr, " %s = %s\n", vkb_device[i]->name, vkb_device[i]->desc); if (! (p = vkb_device[i]->opts)) continue; for (; p->name; p++) fprintf(stderr, " %s (default = %s)\n", p->desc, p->defval); } return TCL_OK; } /* * Tcl commands to sequencer device */ /* open device */ static int seq_on(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { int i; const char *var; if (seq_opened) return TCL_OK; if (! (var = Tcl_GetVar2(interp, "optvar", "device", TCL_GLOBAL_ONLY))) { vkb_error(interp, "no output device defined"); return TCL_ERROR; } oper = NULL; for (i = 0; i < vkb_num_devices && vkb_device[i]; i++) { if (strcmp(vkb_device[i]->name, var) == 0) { oper = vkb_device[i]->oper; break; } } if (! oper) { vkb_error(interp, "no output device defined"); return TCL_ERROR; } if (argc > 1 && vkb_device[i]->delayed_open) return TCL_OK; if (oper->open(interp, &private)) { seq_opened = 1; Tcl_SetVar(interp, "seqswitch", "1", TCL_GLOBAL_ONLY); if (oper->program) oper->program(interp, private, seq_bank, seq_preset); if (oper->bender) oper->bender(interp, private, seq_bend); } return TCL_OK; } /* close device */ static int seq_off(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { if (seq_opened) { oper->close(interp, private); seq_opened = 0; Tcl_SetVar(interp, "seqswitch", "0", TCL_GLOBAL_ONLY); } return TCL_OK; } static int seq_start_note(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { int note, vel; if (argc < 3) return TCL_ERROR; if (! seq_opened) return TCL_OK; note = atoi(argv[1]); vel = atoi(argv[2]); if (oper->noteon) oper->noteon(interp, private, note, vel); return TCL_OK; } static int seq_stop_note(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { int note, vel; if (argc < 3) return TCL_ERROR; if (! seq_opened) return TCL_OK; note = atoi(argv[1]); vel = atoi(argv[2]); if (oper->noteoff) oper->noteoff(interp, private, note, vel); return TCL_OK; } static int seq_control(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { int type, val; if (argc < 3) return TCL_ERROR; if (! seq_opened) return TCL_OK; type = atoi(argv[1]); val = atoi(argv[2]); if (oper->control) oper->control(interp, private, type, val); return TCL_OK; } static int seq_program(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { if (argc < 3) return TCL_ERROR; seq_bank = atoi(argv[1]); seq_preset = atoi(argv[2]); if (! seq_opened) return TCL_OK; if (oper->program) oper->program(interp, private, seq_bank, seq_preset); return TCL_OK; } static int seq_bender(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { if (argc < 2) return TCL_ERROR; seq_bend = atoi(argv[1]); if (! seq_opened) return TCL_OK; if (oper->bender) oper->bender(interp, private, seq_bend); return TCL_OK; } static int seq_chorus_mode(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { if (argc < 2) return TCL_ERROR; if (seq_on(clientData, interp, argc, argv) != TCL_OK) return TCL_ERROR; if (oper->chorus_mode) oper->chorus_mode(interp, private, atoi(argv[1])); return TCL_OK; } static int seq_reverb_mode(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { if (argc < 2) return TCL_ERROR; if (seq_on(clientData, interp, argc, argv) != TCL_OK) return TCL_ERROR; if (oper->reverb_mode) oper->reverb_mode(interp, private, atoi(argv[1])); return TCL_OK; } /* * Misc. functions */ void vkb_error(Tcl_Interp *ip, char *fmt, ...) { va_list ap; va_start(ap, fmt); fputs("ERROR: ", stderr); vfprintf(stderr, fmt, ap); putc('\n', stderr); va_end(ap); } int vkb_get_int(Tcl_Interp *ip, char *opt, int *ret) { const char *var; if ((var = Tcl_GetVar2(ip, "optvar", opt, TCL_GLOBAL_ONLY)) != NULL && *var) { *ret = atoi(var); return 1; } return 0; } /* * Initialize Tcl/Tk components */ static int vkb_app_init(Tcl_Interp *interp) { int i; if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_CreateCommand(interp, "usage", usage, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqOn", seq_on, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqOff", seq_off, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqStartNote", seq_start_note, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqStopNote", seq_stop_note, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqControl", seq_control, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqProgram", seq_program, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqBender", seq_bender, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqChorusMode", seq_chorus_mode, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "SeqReverbMode", seq_reverb_mode, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); for (i = 0; i < vkb_num_devices; i++) { vkb_optarg_t *p; if (! (p = vkb_device[i]->opts)) continue; for (; p->name; p++) { Tcl_SetVar2(interp, "optvar", p->name, p->defval, TCL_GLOBAL_ONLY); } } Tcl_SetVar2(interp, "optvar", "device", vkb_device[0]->name, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "optvar", "libpath", VKBLIB_DIR, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "optvar", "channel", DEF_INST_CHAN_NO, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "optvar", "drum", DEF_DRUM_CHAN_NO, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "optvar", "octave", DEF_OCTAVES, TCL_GLOBAL_ONLY); return TCL_OK; } vkeybd-0.1.18d/vkb.h000066400000000000000000000041371125226414200141700ustar00rootroot00000000000000/* * Virtual Tiny Keyboard * * Copyright (c) 1997-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef VKB_H_DEF #define VKB_H_DEF #include #ifdef HAVE_LASH #include #endif #ifndef VKB_TCLFILE #define VKB_TCLFILE "/usr/local/bin/vkeybd.tcl" #endif /* * device operator */ typedef struct vkb_oper_t { int (*open)(Tcl_Interp *ip, void **private_return); void (*close)(Tcl_Interp *ip, void *private); void (*program)(Tcl_Interp *ip, void *private, int bank, int prg); /* bank=128: drum */ void (*noteon)(Tcl_Interp *ip, void *private, int note, int vel); void (*noteoff)(Tcl_Interp *ip, void *private, int note, int vel); void (*control)(Tcl_Interp *ip, void *private, int type, int val); void (*bender)(Tcl_Interp *ip, void *private, int bend); /* -8192 to 8192 */ void (*chorus_mode)(Tcl_Interp *ip, void *private, int mode); void (*reverb_mode)(Tcl_Interp *ip, void *private, int mode); } vkb_oper_t; /* * Tcl global option variables */ typedef struct vkb_optarg_t { char *name; char *defval; char *desc; } vkb_optarg_t; /* * device information */ typedef struct vkb_devinfo_t { char *name; char *desc; int delayed_open; vkb_oper_t *oper; vkb_optarg_t *opts; } vkb_devinfo_t; extern int vkb_num_devices; extern vkb_devinfo_t *vkb_device[]; void vkb_error(Tcl_Interp *ip, char *fmt, ...); int vkb_get_int(Tcl_Interp *ip, char *opt, int *ret); #ifdef HAVE_LASH extern lash_args_t *lash_args; #endif #endif vkeybd-0.1.18d/vkb_device.c000066400000000000000000000024221125226414200154750ustar00rootroot00000000000000/* * definition of operation table * * Virtual Tiny Keyboard * * Copyright (c) 1999-2000 by Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "vkb.h" #define numberof(ary) (sizeof(ary)/sizeof(ary[0])) #ifdef VKB_USE_ALSA extern vkb_devinfo_t alsa_devinfo; #endif #ifdef VKB_USE_AWE extern vkb_devinfo_t awe_devinfo; #endif #ifdef VKB_USE_MIDI extern vkb_devinfo_t midi_devinfo; #endif vkb_devinfo_t *vkb_device[] = { #ifdef VKB_USE_ALSA &alsa_devinfo, #endif #ifdef VKB_USE_AWE &awe_devinfo, #endif #ifdef VKB_USE_MIDI &midi_devinfo, #endif }; int vkb_num_devices = numberof(vkb_device); vkeybd-0.1.18d/vkeybd.desktop000066400000000000000000000035421125226414200161130ustar00rootroot00000000000000[Desktop Entry] Encoding=UTF-8 Name=vkeybd Name[xh]=i-vkeybd Name[ta]=பெயர்(vkeybd.டெஸ்க்டாப்): vkeybd Comment=A virtual MIDI keyboard Comment[da]=Et virtuel MIDI tastatur Comment[pt_BR]=Um teclado MIDI virtual Comment[ru]=Виртуальная клавиатура MIDI Comment[km]=ក្ដារចុច​មីឌីនិម្មិត Comment[pl]=Wirtualna klawiatura MIDI Comment[bg]=Виртуална MIDI клавиатура Comment[zh_CN]=虚拟 MIDI 键盘 Comment[cs]=Virtuální MIDI klávesy Comment[uk]=Віртуальна клавіатура MIDI Comment[fi]=Virtuaaliset MIDI-koskettimet Comment[de]=Virtuelles MIDI-Keyboard Comment[sv]=Ett virtuellt MIDI-tangentbord Comment[pt]=Teclado MIDI virtual Comment[ja]=仮想 MIDI キーボード Comment[el]=Ένα εικονικό πληκτρολόγιο MIDI Comment[lt]=Virtuali MIDI klaviatūra Comment[nb]=Et virtuelt MIDI-tangentbord Comment[mr]=व्हर्च्युअल MIDI कीबोर्ड Comment[wa]=Ene forveyowe taprece MIDI Comment[ar]=لوحة مفاتيح MIDI ظاهرية Comment[xh]=Ibhodi yamaqhosha yenene ye-MIDI Comment[hu]=Virtuális MIDI-billentyűzet Comment[es]=Un teclado MIDI virtual Comment[nl]=Een virtueel MIDI toetsenbord Comment[ca]=Un teclat de MIDI virtual Comment[sk]=Virtuálne MIDI klávesy Comment[af]=’n Skyn-MIDI-sleutelbord Comment[zh_TW]=虛擬 MIDI 鍵盤 Comment[it]=Tastiera MIDI virtuale Comment[et]=Virtuaalne MIDI klaviatuur Comment[fr]=Un clavier MIDI virtuel Comment[ta]=கருத்துரை(vkeybd.டெஸ்க்டாப்): ஒரு கற்பனையான மிடி கீபோர்ட் Comment[pa]=ਇੱਕ ਵੁਰਚੁਅਲ MIDI ਕੀ-ਬੋਰਡ Type=Application Exec=vkeybd Icon=vkeybd_48x48 Terminal=false StartupWMClass=vkeybd.tcl Categories=Application;AudioVideo;Audio;Music vkeybd-0.1.18d/vkeybd.list000066400000000000000000000132051125226414200154120ustar00rootroot00000000000000128 8 Room (SC-55) 128 7 Room (SC-88) 128 127 CM-64/32 Set (SC-55) 128 57 Rhythm FX (SC-88) 128 56 SFX (SC-55) 128 50 Kick & Snare (SC-88) 128 49 Ethnic (SC-88) 128 48 Orchestra (SC-55) 128 40 Brush (SC-55) 128 32 Jazz (SC-55) 128 26 Dance (SC-88) 128 25 TR-909 (SC-55) 128 24 Electronic (SC-55) 128 16 Power (SC-55) 128 1 Standard 2 (SC-88) 128 0 Standard 1 (SC-55) 0 123 Bird 0 0 Piano 1 0 1 Piano 2 0 2 Piano 3 0 3 Honky Tonk 0 4 E.Piano 1 0 5 E.Piano 2 0 6 Harpsichord 0 7 Clavinet 0 8 Celesta 0 9 Glockenspiel 0 10 Music Box 0 11 Vibraphone 0 12 Marimba 0 13 Xylophone 0 14 Tubular Bells 0 15 Dulcimer 0 16 Organ 1 0 17 Organ 2 0 18 Organ 3 0 19 Church Organ 0 20 Reed Organ 0 21 Accordion 0 22 Harmonica 0 23 Bandoneon 0 24 Nylon Guitar 0 25 Steel Guitar 0 26 Jazz Guitar 0 27 Clean Guitar 0 28 Guitar Mutes 0 29 Overdrive Guitar 0 30 DistortionGuitar 0 31 Guitar Harmonics 0 32 Acoustic Bass 0 33 Fingered Bass 0 34 Picked Bass 0 35 Fretless Bass 0 36 Slap Bass 1 0 37 Slap Bass 2 0 38 Synth Bass 1 0 39 Synth Bass 2 0 40 Violin 0 41 Viola 0 42 Cello 0 43 Contrabass 0 44 Tremolo Strings 0 45 Pizzicato 0 46 Harp 0 47 Timpani 0 48 Strings 0 49 Slow Strings 0 50 Synth Strings 1 0 51 Synth Strings 2 0 52 Choir Aahs 0 53 Voice Oohs 0 54 Synth Vox 0 55 Orchestra Hit 0 56 Trumpet 0 57 Trombone 0 58 Tuba 0 59 Mute Trumpet 0 60 French Horns 0 61 Brass 0 62 Synth Brass 1 0 63 Synth Brass 2 0 64 Soprano Sax 0 65 Alto Sax 0 66 Tenor Sax 0 67 Baritone Sax 0 68 Oboe 0 69 English Horn 0 70 Bassoon 0 71 Clarinet 0 72 Piccolo 0 73 Flute 0 74 Recorder 0 75 Pan Flute 0 76 Bottle Chiff 0 77 Shakuhachi 0 78 Whistle 0 79 Ocarina 0 80 Square Wave 0 81 Saw Wave 0 82 Synth Calliope 0 83 Chiffer Lead 0 84 Charang 0 85 Solo Vox 0 86 5th Saw Wave 0 87 Bass & Lead 0 88 Fantasia 0 89 Warm Pad 0 90 Poly Synth 0 91 Space Voice 0 92 Bowed Glass 0 93 Metal Pad 0 94 Halo Pad 0 95 Sweep Pad 0 96 Ice Rain 0 97 Soundtrack 0 98 Crystal 0 99 Atmosphere 0 100 Brightness 0 101 Goblin 0 102 Echo Drops 0 103 Star Theme 0 104 Sitar 0 105 Banjo 0 106 Shamisen 0 107 Koto 0 108 Kalimba 0 109 Bagpipe 0 110 Fiddle 0 111 Shenai 0 112 Tinker Bell 0 113 Agogo 0 114 Steel Drum 0 115 Wood Block 0 116 Taiko Drum 0 117 Melodic Tom 0 118 Synth Drum 0 119 Reverse Cymbal 0 120 Fret Noise 0 121 Breath Noise 0 122 Seashore 0 124 Telephone 0 125 Helicopter 0 126 Applause 0 127 Gunshot 1 120 Cut Noise 2 120 String Slap 1 121 Fl. Key Click 1 122 Rain 2 122 Thunder 3 122 Wind 4 122 Stream 5 122 Bubble 1 123 Dog 2 123 Horse-Gallop 1 124 Telephone 2 2 124 Door Creaking 3 124 Door 4 124 Scratch 5 124 Windchime 1 125 Car-Engine 2 125 Car-Stop 3 125 Car-Pass 4 125 Car-Crash 5 125 Siren 6 125 Train 7 125 Jetplane 8 125 Starship 9 125 Burst Noise 1 126 Laughing 2 126 Screaming 3 126 Punch 4 126 Heart Beat 5 126 Footsteps 1 127 Machine Gun 2 127 Lasergun 3 127 Explosion 8 4 Detuned Rhodes 8 5 Detuned EP2 8 6 Coupled Harpsichord 8 14 Church Bell 8 16 Detuned Organ 1 8 17 Detuned Organ 2 8 19 Detuned Organ 3 8 21 Italian Accordion 8 24 Ukulele 8 25 12 St. Guitar 16 25 Mandolin 8 26 Hawaiian Guitar 8 27 Chorus Guitar 8 28 Funk Guitar 8 30 FeedBack Guitar 8 31 Guitar Feedback 8 38 SynthBass 3 8 39 SynthBass 4 8 48 Orchestra Pad 8 50 Syn Strings 3 8 61 Brass 2 8 62 Synth Brass 3 8 63 Synth Brass 4 8 80 Sine Wave 8 107 Taisho Koto 8 115 Castanets 8 116 Concert BD 8 117 Melo Tom 2 8 118 808 Tom 127 0 Acou Piano 1 127 1 Acou Piano 2 127 2 Acou Piano 3 127 3 Elec Piano 1 127 4 Elec Piano 2 127 5 Elec Piano 3 127 6 Elec Piano 4 127 7 Honky Tonk MT 127 8 Elec Organ 1 127 9 Elec Organ 2 127 10 Elec Organ 3 127 11 Elec Organ 4 127 12 Pipe Organ 1 127 13 Pipe Organ 2 127 14 Pipe Organ 3 127 15 Accordion MT 127 16 Harpsichord 1 127 17 Harpsichord 2 127 18 Harpsichord 3 127 19 Clavinet 1 127 20 Clavinet 2 127 21 Clavinet 3 127 22 Celesta 1 127 23 Celesta 2 127 24 Syn Brass 1 MT 127 25 Syn Brass 2 MT 127 26 Syn Brass 3 MT 127 27 Syn Brass 4 MT 127 28 Syn Bass 1 MT 127 29 Syn Bass 2 MT 127 30 Synth Bass 3 127 31 Synth Bass 4 127 32 Fantasy MT 127 33 Harmo Pad 127 34 Choral 127 35 Glasses 127 36 Soundtrack MT 127 37 Atmosphere MT 127 38 Warm Bell 127 39 Funny Vox 127 40 Echo Bell 127 41 Ice Rain MT 127 42 Oboe 2001 127 43 Echo Pan 127 44 Dr Solo 127 45 School Daze 127 46 Bellsinger 127 47 Square Wave MT 127 48 String Sect 1 127 49 String Sect 2 127 50 String Sect 3 127 51 Pizzicato MT 127 52 Violin 1 127 53 Violin 2 127 54 Cello 1 127 55 Cello 2 127 56 Contrabass MT 127 57 Harp 1 127 58 Harp 2 127 59 Guitar 1 127 60 Guitar 2 127 61 Elec Guit 1 127 62 Elec Guit 2 127 63 Sitar MT 127 64 Acoustic Bass 1 127 65 Acoustic Bass 2 127 66 Elec Bass 1 127 67 Elec Bass 2 127 68 Slap Bass 1 MT 127 69 Slap Bass 2 MT 127 70 Fretless Bass 1 127 71 Fretless Bass 2 127 72 Flute 1 127 73 Flute 2 127 74 Piccolo 1 127 75 Piccolo 2 127 76 Recorder MT 127 77 Pan Pipes MT 127 78 Sax 1 127 79 Sax 2 127 80 Sax 3 127 81 Sax 4 127 82 Clarinet 1 127 83 Clarinet 2 127 84 Oboe MT 127 85 English Horn MT 127 86 Bassoon MT 127 87 Harmonica MT 127 88 Trumpet 1 127 89 Trumpet 2 127 90 Trombone 1 127 91 Trombone 2 127 92 French Horn 1 127 93 French Horn 2 127 94 Tuba MT 127 95 Brass Sect 1 127 96 Brass Sect 2 127 97 Vibraphone 1 127 98 Vibraphone 2 127 99 Synth Mallet 127 100 Wind Chime 127 101 Glockenspiel MT 127 102 Tube Bell 127 103 Xyolophone MT 127 104 Marimba MT 127 105 Koto MT 127 106 Sho 127 107 Shakuhachi MT 127 108 Whistle 1 127 109 Whistle 2 127 110 Bottle Blow 127 111 Breath Pipe 127 112 Timpani MT 127 113 Melodic Tom MT 127 114 Deep Snare 127 115 Elec Perc 1 127 116 Elec Perc 2 127 117 Taiko 127 118 Taiko Rim 127 119 Cymbal 127 120 Castanets MT 127 121 Triangle 127 122 Orche Hit 127 123 Telephone MT 127 124 Bird Tweet 127 125 One Note Jam 127 126 Water Bell 127 127 Jungle Tune vkeybd-0.1.18d/vkeybd.man000066400000000000000000000122241125226414200152120ustar00rootroot00000000000000.TH vkeybd 1 "January 1, 2000" .LO 1 .SH NAME vkeybd \- virtual keyboard on X .SH SYNOPSIS .B vkeybd [\-options] .SH DESCRIPTION .B vkeybd is a virtual keyboard for AWE/OSS, MIDI/OSS and ALSA drivers. It's a simple fake of a MIDI keyboard on X-windows system. Enjoy a music with your mouse and .I computer keyboard :-) .SH OPTIONS .SS "Common Options" .TP .B \--device mode Use the specified mode for output device. The argument are .B awe, .B midi or .B alsa, for AWE/OSS, MIDI/OSS and ALSA devices, respectively. Default is .B alsa. .TP .B \--config file Use the specified file as config file (see section "KEYBOARD"). .TP .B \--preset file Use the specified file as preset list file (see section "PRESET LIST FILE"). .TP .B \--channel num Specify the channel to be played for normal instruments. Valid only for MIDI and ALSA devices. Default is 0. .TP .B \--drum num Specify the channel to be played for drum instruments. Valid only for MIDI and ALSA devices. Default is 9. .TP .B \--octave num Specify the number of octaves to display keys. Default is 3. .SS "ALSA Device Option" .TP .B \--addr destination Set ALSA client and port numbers to be connected. If argument begins with 's' or 'S', the port is opened as subscription port, and events are sent to all connected subscribers. The port can be connected to other ports via .B aconnect(1). Otherwise, .B vkeybd connects directly to the specified port. The argument must be a form like client:port or client.port, where client and port are index numbers listed in .B /proc/asound/seq/clients. Default is 's'. .TP .B \--name string Specify the name of client/port. Some applications like tk707 check the client/port name whether it is a valid MIDI device port. This options makes vkeybd possible to "fake" as a real MIDI device. .SS "OSS Sequencer Device Options" .TP .B \--seqdev file Specify the device file path for sequencer access. As default .B /dev/sequencer is used. .TP .B \--seqidx num Specify the synth device index for AWE32/64 WaveTable. If negative value is given, the device is auto-probed. Default value is -1. .SS "MIDI Device Option" .TP .B \--mididev num Speicfy the file path of MIDI device. Default value is /dev/midi. .SH "FILE MENU" .I Connection shows whether the .B vkeybd connects to the device. On OSS system, only one application is allowed to access sequencer device. Thus, if one wants to play another program even using another device, he needs to disconnect .B vkeybd once. On ALSA or OSS emulation on ALSA, you don't have to switch .B vkeybd off, since multiple access is allowed. With .I "Save Config", the current keymap and view configuration are saved on .B ~/.vkeybdrc config file. This file will be read at the next invoke. .SH "VIEW MENU" Thie menu shows the check buttons to toggle the display of control buttons. With .I Key/Velocity button, a key and a velocity scale bars are shown. The key scale indicates the lowest note value of the visible keyboard (as default 48 = C4). The velocity scale bar is used to change the velocity of each note-on. With .I Control button, controls for the current channel and for the MIDI continous-controls are enabled. The channel number is increased or decreased by clicking the right or left button around the shown channel number. The bank and preset are remembered for each channel. You may choose the CC to be adjusted by pull-down menu, which indicates .I ModWheel as default. Then change the parameter value with the scale bar at the right side. With .I Pitch button, you may adjust pitch wheel. The pitch goes back to the center position when you click the .I "Pitch Clear" button at the left. With .I Program button, the selection list of playing instrument is toggled. The shown presets are read from preset list file. .SH "KEYBOARD" Each visible key is mapped on your computer keyboard from 'z' to '\\'. To use the computer keyboard, you should turn off auto repeat on your X display via .B xset(1) : .IP "" 4 % xset -r .PP The key assignment can be changed by editting the config file .B ~/.vkeybdrc. Once save the current configuration via .I "File/Save Config" menu. The config file is the Tcl source, and you may change the list of keymap as you wish. The keymap is a list of elements consisting on the key symbol and the corresponding note offset. The key symbol is the X key symbol for assigned key, and note offset is the shifted note number from note key of beginning of keyboard, which is changed by .I Key scalebar. For example, when a pair of {a 8} is defined and the lowest MIDI key is 48, a MIDI note 56 will be turned on by pressing the key 'a'. .SH "PRESET LIST FILE" The preset list file is used to describe the list of MIDI preset names. If the command line option is omitted, the default preset list file .B ~/vkeybd.list, .B ~/.vkeybd.list and .B $vkblib/vkeybd.list are searched sequentially. The preset list will appear when .I Program toggle button is on, and you can select a tone to be played from the list. .PP The preset list file can be converted from .B SoundFont(tm) file via .B sftovkb(1) utility. For example, .IP "" 4 % sftovkb synthgm.sbk > vkeybd.list .PP .SH "SEE ALSO" sftovkb(1), X(1), xset(1), aconnect(1) .SH AUTHOR Takashi Iwai vkeybd-0.1.18d/vkeybd.spec000066400000000000000000000044441125226414200153760ustar00rootroot00000000000000%define ver 0.1.10 Summary: Virtual Keyboard Name: vkeybd Version: %ver Release: 1 Copyright: GPL Group: Applications/Sound Source: http://members.tripod.de/iwai/vkeybd-%{ver}.tgz BuildRoot: /tmp/rpmtest URL: http//members.tripod.de/iwai/awedrv.html %description ==================================================================== VIRTUAL KEYBOARD ver.0.1.10 Takashi Iwai ==================================================================== This is a virtual keyboard for AWE, MIDI and ALSA drivers. It's a simple fake of a MIDI keyboard on X-windows system. Enjoy a music with your mouse and "computer" keyboard :-) The program requires Tcl7.5/Tk4.1 or newer libraries. This program supports: - ALSA driver ver.0.5.x (default) - AWE driver ver.0.4.3 on OSS - Raw MIDI device on OSS and ALSA %prep %setup %build make PREFIX=/usr %install make PREFIX="$RPM_BUILD_ROOT"/usr install-all %clean rm -rf $RPM_BUILD_ROOT %files /usr/bin/* /usr/man/* %dir /usr/share/vkeybd %doc README %package -n vkeybd-ossonly ==================================================================== VIRTUAL KEYBOARD ver.0.1.10 Takashi Iwai ==================================================================== This is a virtual keyboard for AWE, MIDI and ALSA drivers. It's a simple fake of a MIDI keyboard on X-windows system. Enjoy a music with your mouse and "computer" keyboard :-) The program requires Tcl7.5/Tk4.1 or newer libraries. This program supports: - AWE driver ver.0.4.3 on OSS - Raw MIDI device on OSS %description ==================================================================== VIRTUAL KEYBOARD ver.0.1.10 Takashi Iwai ==================================================================== This is a virtual keyboard for AWE, MIDI and ALSA drivers. It's a simple fake of a MIDI keyboard on X-windows system. Enjoy a music with your mouse and "computer" keyboard :-) The program requires Tcl7.5/Tk4.1 or newer libraries. This program supports: - ALSA driver ver.0.5.x (default) - AWE driver ver.0.4.3 on OSS - Raw MIDI device on OSS and ALSA %prep %setup %build make PREFIX=/usr USE_ALSA=0 %install make PREFIX="$RPM_BUILD_ROOT"/usr USE_ALSA=0 install-all %clean rm -rf $RPM_BUILD_ROOT %files /usr/bin/* /usr/man/* %dir /usr/share/vkeybd %doc README vkeybd-0.1.18d/vkeybd.tcl000066400000000000000000000513341125226414200152260ustar00rootroot00000000000000#!/usr/bin/wish -f # # Virtual Tiny Keyboard # # Copyright (c) 1997-2007 by Takashi Iwai # # turn off auto-repeat on your X display by "xset -r" # #---------------------------------------------------------------- # default files #---------------------------------------------------------------- # preset list file set defpresetfile vkeybd.list set defconfig vkeybdrc set defkeymap vkeybdmap #---------------------------------------------------------------- # keyboard size (width & height) set keywid 18 set keyhgt 72 #---------------------------------------------------------------- # keyboard octaves set optvar(octave) 3 #---------------------------------------------------------------- # create virtual keyboard proc CheckKeymap {target} { global keymap keywin foreach i $keymap { set key [lindex $i 0] if {$key == $target} { return 0 } } return 1 } proc IncKeyBase {} { global keybase optvar if {$keybase < [expr 120 - ($optvar(octave) * 12)]} { set keybase [expr $keybase + 12] } } proc DecKeyBase {} { global keybase optvar if {$keybase >= 12} { set keybase [expr $keybase - 12] } } proc KeybdCreate {w} { global keycolor keywid keyitem keyindex keyhgt keymap keywin global optvar set keywin $w canvas $w -width [expr $keywid * $optvar(octave) * 7] -height $keyhgt -bd 1 -bg black set numkeys [expr $optvar(octave) * 12] pack $w -side top for {set i 0} {$i < $numkeys} {incr i} { set octave [expr ($i / 12) * 7] set j [expr $i % 12] if {$j >= 5} {incr j} if {$j % 2 == 0} { set x1 [expr ($octave + $j / 2) * $keywid] set x2 [expr $x1 + $keywid] set y1 0 set y2 $keyhgt set id [$w create rectangle $x1 $y1 $x2 $y2 -width 1\ -fill white -outline black -tags ebony] set keycolor($i) white } else { set x1 [expr ($octave + $j / 2) * $keywid + $keywid * 6/10] set x2 [expr $x1 + $keywid * 8/10 - 1] set y1 0 set y2 [expr $keyhgt * 6 / 10] set id [$w create rectangle $x1 $y1 $x2 $y2 -width 1\ -fill black -outline white -tags ivory] set keycolor($i) black } set keyitem($i) $id set keyindex($id) $i $w bind $id [list KeyStart $i 1] $w bind $id [list KeyStop $i 1] $w bind $id [list KeyMotion $i %x %y %s] } $w lower ebony foreach i $keymap { set key [lindex $i 0] set note [lindex $i 1] bind . [list KeyQueue 1 $note 0] bind . [list KeyQueue 0 $note 0] set upperkey [string toupper $key] if {[string length $key] == 1 && $upperkey != $key} { bind . [list KeyQueue 1 $note 0] bind . [list KeyQueue 0 $note 0] } } # # some special key sequences # if [CheckKeymap Escape] { bind $w {SeqOff; ResetControls} } bind $w {exit 0} bind $w {exit 0} bind $w {IncKeyBase} bind $w {IncKeyBase} bind $w {DecKeyBase} bind $w {DecKeyBase} focus $w } #---------------------------------------------------------------- # key press/release, filter autorepeats # # a nice hack by Roger E Critchlow Jr # set KeyEventQueue {} proc KeyQueue {type note time} { global KeyEventQueue lappend KeyEventQueue $type $note $time after idle KeyProcessQueue } proc KeyProcessQueue {} { global KeyEventQueue while {1} { switch [llength $KeyEventQueue] { 0 return 3 { foreach {type note time} $KeyEventQueue break KeyProcess $type $note $time set KeyEventQueue [lrange $KeyEventQueue 3 end] } default { foreach {type1 note1 time1 type2 note2 time2} $KeyEventQueue break if {$note1 == $note2 && $time1 == $time2 && $type1 == 0 && $type2 == 1} { set KeyEventQueue [lrange $KeyEventQueue 6 end] continue; } else { KeyProcess $type1 $note1 $time1 set KeyEventQueue [lrange $KeyEventQueue 3 end] } } } } } proc KeyProcess {type note time} { if {$type} { KeyStart $note 0 } else { KeyStop $note 0 } } #---------------------------------------------------------------- # note on/off # base key note and default velocity set keybase 48 set keyvel 127 set activekey "" proc KeyStart {key button} { global keybase keywin keyitem keyvel activekey SeqOn catch { if {$button == 1} { set activekey $keyitem($key) } $keywin itemconfigure $keyitem($key) -fill blue } set key [expr $key + $keybase] SeqStartNote $key $keyvel } proc KeyStop {key button} { global keybase keywin keyitem keyindex keycolor activekey SeqOn catch { if {$button == 1 && $activekey != ""} { set key $keyindex($activekey) set activekey "" } $keywin itemconfigure $keyitem($key) -fill $keycolor($key) } set key [expr $key + $keybase] SeqStopNote $key 0 } proc KeyMotion {key x y s} { global activekey keywin keyitem keyindex if {($s & 256) == 0} { if {$activekey != ""} { KeyStop $keyindex($activekey) 1 } return } set new [lindex [$keywin find overlapping $x $y $x $y] end] if {$new != $activekey} { if {$activekey != ""} { KeyStop $keyindex($activekey) 1 } if {$new != ""} { KeyStart $keyindex($new) 1 } } } #---------------------------------------------------------------- # midi controls set controls { {"ModWheel" 1 0} {"Volume" 7 127} {"Express" 11 127} {"Panning" 10 64} {"Reverb" 91 0} {"Chorus" 93 0} {"Sustain" 64 0} {"Sostenuto" 66 0} } proc ResetControls {{send_seq 0}} { global controls curctrl ctrlval foreach i $controls { set type [lindex $i 1] set ctrlval($type) [lindex $i 2] if {$send_seq} {SeqControl $type $ctrlval($type)} } # all sounds off SeqControl 120 0 } proc NewControl {w ctrl} { global curctrl ctrlval set type [lindex $ctrl 1] set curctrl $type $w.ctrl configure -text [lindex $ctrl 0] $w.val configure -variable ctrlval($type) SeqControl $type $ctrlval($type) } #---------------------------------------------------------------- # program selection # make a bank and preset list from preset file proc MakeLists {w} { global sflist bankvar bankmode optvar set sflist {} if {[file readable $optvar(preset)]} { ReadSF $optvar(preset) sflist } if {$sflist == {}} { lappend sflist [list 0 0 "Piano"] } foreach i $sflist { set bank [lindex $i 0] set bankvar($bank) 1 } $w.b.list delete 0 end $w.b.list insert end "all" foreach i [lsort -integer [array names bankvar]] { $w.b.list insert end [format "%03d" $i] } set bankmode all MakePresets $w } # read preset table proc ReadSF {fname var} { upvar $var listp set file [open $fname r] if {$file == ""} { puts stderr "can't open file $fname." return } while {1} { set line [string trim [gets $file]] if {$line == ""} {break} if {[string match "#*" $line]} {continue} set bank [lindex $line 0] set preset [lindex $line 1] set name [lrange $line 2 [llength $line]] lappend listp [list $bank $preset $name] } close $file } # compare two preset list elements proc listcmp {a b} { set v [expr [lindex $a 0] - [lindex $b 0]] if {$v == 0} { set v [expr [lindex $a 1] - [lindex $b 1]] } return $v } # make preset list proc MakePresets {w} { global sflist bankmode $w.p.list delete 0 end foreach i [lsort -command listcmp $sflist] { set str [eval format "%03d:%03d:%s" $i] if {$bankmode == "all" || $bankmode == [lindex $i 0]} { $w.p.list insert end $str } } } # change the current channel proc InitPreset {} { global chanbank chanpreset for {set i 0} {$i < 16} {incr i} { if {$i == 9} { set chanbank($i) 128 } else { set chanbank($i) 0 } set chanpreset($i) 0 } } proc DecrChannel {} { global optvar chanbank chanpreset if {$optvar(channel) > 0} { set optvar(channel) [expr $optvar(channel) - 1] # all sounds off SeqControl 120 0 SeqProgram $chanbank($optvar(channel)) $chanpreset($optvar(channel)) } } proc IncrChannel {} { global optvar chanbank chanpreset if {$optvar(channel) < 15} { incr optvar(channel) # all sounds off SeqControl 120 0 SeqProgram $chanbank($optvar(channel)) $chanpreset($optvar(channel)) } } # remake preset list from selected bank listbox proc BankSelect {w coord} { global bankmode set idx [$w.b.list nearest $coord] if {$idx == ""} {return} set sel [$w.b.list get $idx] if {$sel == "all"} { set mode all } else { scan $sel "%d" mode } if {$mode != $bankmode} { set bankmode $mode MakePresets $w } $w.b.label configure -text "Bank:$bankmode" } # set the selected preset to sequencer proc ProgSelect {w coord} { global sflist chanpreset chanbank optvar set idx [$w.p.list nearest $coord] if {$idx == ""} {return} set sel [$w.p.list get $idx] set lp [split $sel :] scan [lindex $lp 0] "%d" bank scan [lindex $lp 1] "%d" preset set name [join [string range $lp 8 end]] set chanbank($optvar(channel)) $bank set chanpreset($optvar(channel)) $preset SeqProgram $bank $preset $w.p.label configure -text "Preset:$name" } #---------------------------------------------------------------- # make a listbox proc my-listbox {w title width height {dohoriz 0}} { frame $w label $w.label -text $title -relief flat pack $w.label -side top -fill x -anchor w scrollbar $w.yscr -command "$w.list yview" pack $w.yscr -side right -fill y set lopt [list -width $width -height $height] lappend lopt -selectmode single -exportselect 0 if {$dohoriz} { scrollbar $w.xscr -command "$w.list xview" -orient horizontal pack $w.xscr -side bottom -fill x eval listbox $w.list -relief sunken -setgrid yes $lopt\ [list -yscroll "$w.yscr set"]\ [list -xscroll "$w.xscr set"] } else { eval listbox $w.list -relief sunken -setgrid yes $lopt\ [list -yscroll "$w.yscr set"] } pack $w.list -side left -fill both -expand yes return $w.list } #---------------------------------------------------------------- # create windows # toggle display of preset selection windows set disp(keyvel) 0 set disp(ctrl) 0 set disp(pitch) 0 set disp(prog) 0 proc ToggleView {w cvar} { global disp if {$disp($cvar)} { pack $w.$cvar -side top -fill x } else { pack forget $w.$cvar } } # toggle sequencer on/off set seqswitch 0 proc ToggleSeqOn {w} { global seqswitch if {$seqswitch} { SeqOn } else { SeqOff ResetControls } } # create the pulldown menues proc MenuCreate {{pw ""}} { global env optvar defconfig defkeymap if {$optvar(octave) < 1 || $optvar(octave) > 9} { puts stderr "vkeybd: invalid octave too value $optvar(octave)" set optvar(octave) 3 } set w $pw.menubar menu $w -tearoff 0 $w add cascade -menu $w.file -label "File" -underline 0 menu $w.file -tearoff 0 $w.file add checkbutton -label "Connection"\ -command "ToggleSeqOn $w.file.off"\ -variable seqswitch -underline 0 $w.file add command -label "Save Config" -command "SaveConfig $env(HOME)/.$defconfig" -underline 0 $w.file add command -label "Save Keymap" -command "SaveKeymap $env(HOME)/.$defkeymap" -underline 0 $w.file add command -label "Quit" -command {exit 0} -underline 0 $w add cascade -menu $w.view -label "View" -underline 0 menu $w.view -tearoff 0 $w.view add check -label "Key/Velocity" -variable disp(keyvel)\ -command [list ToggleView $pw keyvel] $w.view add check -label "Controls" -variable disp(ctrl)\ -command [list ToggleView $pw ctrl] $w.view add check -label "Pitchwheel" -variable disp(pitch)\ -command [list ToggleView $pw pitch] $w.view add check -label "Program List" -variable disp(prog)\ -command [list ToggleView $pw prog] $w add cascade -menu $w.reverb -label "Reverb" -underline 0 menu $w.reverb -tearoff 0 $w.reverb add radio -label "Room 1"\ -variable reverbmode -value 0 -command "SeqReverbMode 0" $w.reverb add radio -label "Room 2"\ -variable reverbmode -value 1 -command "SeqReverbMode 1" $w.reverb add radio -label "Room 3"\ -variable reverbmode -value 2 -command "SeqReverbMode 2" $w.reverb add radio -label "Hall 1"\ -variable reverbmode -value 3 -command "SeqReverbMode 3" $w.reverb add radio -label "Hall 2"\ -variable reverbmode -value 4 -command "SeqReverbMode 4" $w.reverb add radio -label "Plate"\ -variable reverbmode -value 5 -command "SeqReverbMode 5" $w.reverb add radio -label "Delay"\ -variable reverbmode -value 6 -command "SeqReverbMode 6" $w.reverb add radio -label "Panning Delay"\ -variable reverbmode -value 7 -command "SeqReverbMode 7" $w add cascade -menu $w.chorus -label "Chorus" -underline 0 menu $w.chorus -tearoff 0 $w.chorus add radio -label "Chorus 1"\ -variable chorusmode -value 0 -command "SeqChorusMode 0" $w.chorus add radio -label "Chorus 2"\ -variable chorusmode -value 1 -command "SeqChorusMode 1" $w.chorus add radio -label "Chorus 3"\ -variable chorusmode -value 2 -command "SeqChorusMode 2" $w.chorus add radio -label "Chorus 4"\ -variable chorusmode -value 3 -command "SeqChorusMode 3" $w.chorus add radio -label "Feedback"\ -variable chorusmode -value 4 -command "SeqChorusMode 4" $w.chorus add radio -label "Flanger"\ -variable chorusmode -value 5 -command "SeqChorusMode 5" $w.chorus add radio -label "Short Delay"\ -variable chorusmode -value 6 -command "SeqChorusMode 6" $w.chorus add radio -label "Short Delay 2"\ -variable chorusmode -value 7 -command "SeqChorusMode 7" global reverbmode chorusmode set reverbmode 4 set chorusmode 2 } # create the virtual keyboard panel proc PanelCreate {{pw ""}} { global controls curctrl ctrlval optvar set w $pw.ctrl frame $w frame $w.chan label $w.chan.label -text "Channel" button $w.chan.left -text "<" -command { DecrChannel } label $w.chan.digit -textvariable optvar(channel) button $w.chan.right -text ">" -command { IncrChannel } pack $w.chan.label $w.chan.left $w.chan.digit $w.chan.right -side left -expand 1 frame $w.c label $w.c.label -text "Control" menubutton $w.c.ctrl -relief raised -width 9 -menu $w.c.ctrl.m menu $w.c.ctrl.m foreach i $controls { set label [lindex $i 0] set type [lindex $i 1] $w.c.ctrl.m add radio -label $label\ -variable curctrl -value $type\ -command [list NewControl $w.c $i] set ctrlval($type) [lindex $i 2] } $w.c.ctrl.m add separator $w.c.ctrl.m add command -label "Reset" -command {ResetControls 1} scale $w.c.val -orient horizontal -from 0 -to 127 -showvalue true\ -command {SeqControl $curctrl} NewControl $w.c [lindex $controls 0] pack $w.c.label $w.c.ctrl $w.c.val -side left -expand 1 pack $w.chan $w.c -side left -expand 1 #---------------------------------------------------------------- set w $pw.keyvel frame $w frame $w.k label $w.k.label -text "Key" scale $w.k.val -orient horizontal\ -from 0 -to [expr 120 - ($optvar(octave) * 12)] -resolution 12\ -showvalue true -variable keybase pack $w.k.label $w.k.val -side left -expand 1 frame $w.v label $w.v.label -text "Velocity" scale $w.v.val -orient horizontal\ -from 0 -to 127\ -showvalue true -variable keyvel pack $w.v.label $w.v.val -side left -expand 1 pack $w.k $w.v -side left -expand 1 #---------------------------------------------------------------- set w $pw.pitch frame $w global pitchbend button $w.label -text "Pitch Clear" -command "set pitchbend 0; SeqBender 0" scale $w.pitch -orient horizontal -from -8192 -to 8192 -showvalue 0\ -length 256 -variable pitchbend -command SeqBender set pitchbend 0 pack $w.label $w.pitch -side left -expand 1 #---------------------------------------------------------------- set w $pw.prog frame $w my-listbox $w.p "Preset:" 28 10 my-listbox $w.b "Bank:all" 5 10 bind $w.b.list [list BankSelect $w %y] bind $w.p.list [list ProgSelect $w %y] pack $w.b $w.p -side left -expand 1 MakeLists $w $pw. configure -menu $pw.menubar ToggleView $pw keyvel ToggleView $pw ctrl ToggleView $pw pitch ToggleView $pw prog #---------------------------------------------------------------- KeybdCreate $pw.kbd pack $pw.kbd -fill x -side bottom -pady 1 } #---------------------------------------------------------------- # search default path # proc SearchDefault {fname} { global env optvar set path "$env(HOME)/$fname" if {[file readable $path]} { return $path } set path "$env(HOME)/.$fname" if {[file readable $path]} { return $path } if {[info exists env(VKEYBD)]} { set path "$env(VKEYBD)/$fname" if {[file readable $path]} { return $path } } set path "$optvar(libpath)/$fname" return $path } # for keymap; check $LANG for the system-wide configurations proc SearchDefaultLang {fname} { global env optvar proc CheckDefaultPath {fname lang} { global env optvar if {[info exists env(VKEYBD)]} { set path "$env(VKEYBD)/$fname$lang" if {[file readable $path]} { return $path } } set path "$optvar(libpath)/$fname$lang" if {[file readable $path]} { return $path } return "" } set path "$env(HOME)/$fname" if {[file readable $path]} { return $path } set path "$env(HOME)/.$fname" if {[file readable $path]} { return $path } set lang [string trim $env(LANG) .] switch -glob $lang { [a-z][a-z] {set lang "-$lang"} [a-z][a-z]_[A-Z][A-Z]* {set lang [string range "-$lang" 0 5]} default {set lang ""} } set path [CheckDefaultPath $fname $lang] if {$path != ""} { return $path } if {[string match "-*_*" $lang]} { set lang [string range $lang 0 2] set path [CheckDefaultPath $fname $lang] if {$path != ""} { return $path } } if {$lang != ""} { set path [CheckDefaultPath $fname ""] if {$path != ""} { return $path } } set path "$optvar(libpath)/$fname" return $path } # # parse command line options # proc ParseOptions {argc argv} { global optvar for {set i 0} {$i <= $argc} {incr i} { set arg [lindex $argv $i] if {! [string match -* $arg]} {break} set arg [string range $arg 2 end] if {[string match *=* $arg]} { set idx [string first = $arg] set val [string range $arg [expr $idx + 1] end] set arg [string range $arg 0 [expr $idx - 1]] if {[info exists optvar($arg)]} { set optvar($arg) $val } else { usage exit 1 } } else { if {[info exists optvar($arg)]} { incr i set optvar($arg) [lindex $argv $i] } else { usage exit 1 } } } } # # load config file # proc LoadConfig {fname} { if {[file readable $fname]} { source $fname } } # # save config file # proc SaveConfig {fname} { global disp optvar keymap set file [open $fname w] if {$file == ""} { tk_messageBox -icon error -message "can't open file $fname." -type ok return } puts $file "global disp optvar" puts $file "set disp(keyvel) $disp(keyvel)" puts $file "set disp(ctrl) $disp(ctrl)" puts $file "set disp(pitch) $disp(pitch)" puts $file "set disp(prog) $disp(prog)" puts $file "set optvar(octave) $optvar(octave)" close $file } # # Save Keymap config file (read by LoadConfig) # proc SaveKeymap {fname} { global keymap set file [open $fname w] if {$file == ""} { tk_messageBox -icon error -message "can't open file $fname." -type ok return } puts $file "global keymap" puts $file "set keymap {" foreach i $keymap { set key [lindex $i 0] set note [lindex $i 1] puts $file " {$key $note}" } puts $file "}" close $file } # # read a non-tcl style keymap file # proc ReadKeymap {fname} { global keymap if {[file readable $fname]} { set file [open $fname r] if {$file == ""} { puts stderr "can't open file $fname." return } set keymap {} while {1} { set line [string trim [gets $file]] if {$line == ""} {break} lappend keymap [list [lindex $line 0] [lindex $line 1]] } close $file } } #---------------------------------------------------------------- # main ... # set optvar(devfile) "" if {! [info exists optvar(libpath)]} { set optvar(libpath) "/etc" } set optvar(preset) [SearchDefault $defpresetfile] set optvar(config) [SearchDefault $defconfig] set optvar(keymap) [SearchDefaultLang $defkeymap] set optvar(channel) 0 ParseOptions $argc $argv LoadConfig $optvar(config) LoadConfig $optvar(keymap) # parse again to override optvar's in the config file ParseOptions $argc $argv InitPreset MenuCreate PanelCreate wm title . "Virtual Keyboard ver.0.1.18" wm iconname . "Virtual Keyboard" SeqOn preinit tkwait window . exit 0 vkeybd-0.1.18d/vkeybdmap000066400000000000000000000004321125226414200151340ustar00rootroot00000000000000global keymap set keymap { {a 8} {z 9} {s 10} {x 11} {c 12} {f 13} {v 14} {g 15} {b 16} {n 17} {j 18} {m 19} {k 20} {comma 21} {l 22} {period 23} {slash 24} {apostrophe 25} {backslash 26} {grave 27} } vkeybd-0.1.18d/vkeybdmap-de000066400000000000000000000011161125226414200155220ustar00rootroot00000000000000global keymap set keymap { {less 19} {a 20} {y 21} {s 22} {x 23} {c 24} {f 25} {v 26} {g 27} {b 28} {n 29} {j 30} {m 31} {k 32} {comma 33} {l 34} {period 35} {minus 36} {adiaeresis 37} {numbersign 38} {q 31} {2 32} {w 33} {3 34} {e 35} {r 36} {5 37} {t 38} {6 39} {z 40} {u 41} {8 42} {i 43} {9 44} {o 45} {0 46} {p 47} {udiaeresis 48} {plus 50} {F1 0} {F2 2} {F3 4} {F4 5} {F5 7} {F6 9} {F7 11} {F8 12} {F9 14} {Page_Up 13} {Page_Down 10} {Home 8} {End 6} {Insert 3} {Delete 1} } vkeybd-0.1.18d/vkeybdmap-es000066400000000000000000000010511125226414200155370ustar00rootroot00000000000000global keymap set keymap { {less 19} {a 20} {z 21} {s 22} {x 23} {c 24} {f 25} {v 26} {g 27} {b 28} {n 29} {j 30} {m 31} {k 32} {comma 33} {l 34} {period 35} {minus 36} {ccedilla 37} {q 36} {2 37} {w 38} {3 39} {e 40} {r 41} {5 42} {t 43} {6 44} {y 45} {7 46} {u 47} {i 48} {9 49} {o 50} {0 51} {p 52} {plus 53} {F1 0} {F2 2} {F3 4} {F4 5} {F5 7} {F6 9} {F7 11} {F8 12} {F9 14} {Page_Up 13} {Page_Down 10} {Home 8} {End 6} {Insert 3} {Delete 1} } vkeybd-0.1.18d/vkeybdmap-fr000066400000000000000000000012151125226414200155410ustar00rootroot00000000000000global keymap set keymap { {less 19} {q 20} {w 21} {s 22} {x 23} {c 24} {f 25} {v 26} {g 27} {b 28} {n 29} {j 30} {comma 31} {k 32} {semicolon 33} {l 34} {colon 35} {exclam 36} {ugrave 37} {asterisk 38} {a 31} {eacute 32} {z 33} {quotedbl 34} {e 35} {r 36} {parenleft 37} {t 38} {minus 39} {y 40} {u 41} {underscore 42} {i 43} {ccedilla 44} {o 45} {agrave 46} {p 47} {parenright 48} {equal 49} {dollar 50} {F1 0} {F2 2} {F3 4} {F4 5} {F5 7} {F6 9} {F7 11} {F8 12} {F9 14} {F10 16} {F11 18} {F12 19} {Home 8} {End 6} {Insert 3} {Delete 1} }