Skip to content

Commit

Permalink
linux_alsa is now just linux. Changes in compile instructions, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
nosuchtim committed Jun 10, 2020
1 parent e317d86 commit 38e60cb
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 499 deletions.
88 changes: 24 additions & 64 deletions README.linux
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
******************************************************
*** NOTE *** This is old and potentially obsolete,
*** though it will likely be resurrected shortly.
******************************************************
----------------------------------------------------------------------------

Installing and Running KeyKit for Linux (using ALSA or /dev/midi*)
Compiling and Running KeyKit for Linux (using ALSA)

To compile, make sure you have these packages installed:

sudo apt install libghc-alsa-core-dev
sudo apt install libghc-x11-dev

To install and run, just unpack the tar file somewhere (say, /usr/local/src),
cd into the directory that is created, and type:
then:

make install_linux

This will install:
This will produce:

/usr/local/bin/key # The GUI version of keykit
/usr/local/bin/lowkey # The text-only version of keykit,
# suitable for use in CGI scripts.
bin/key # The GUI version of keykit
bin/lowkey # The text-only version of keykit,
# suitable for use in CGI scripts.

By default, exeucting 'key' will execute the ALSA version of keykit.
If you want to execute the version that uses /dev/midi*, just
edit /usr/local/bin/key and change key_alsa to key_devmidi.
KeyKit is a client of the ALSA "sequencer" (it's really a
MIDI routing system) which allows KeyKit to have as many
input and output connections as you may desire.

For the ALSA version, there are two different implementations of MIDI support.
One uses "raw" MIDI ports, which generally means ports corresponding
by MIDI hardware on your computer (though note that ALSA does have a way
to create "virtual" "raw" MIDI ports as well; google for "snd-virmidi").
Using this MIDI implementation limits KeyKit to a single input port
and a single output port.
You control the connections between KeyKit and hardware ports
and/or soft synths or other applications using other utility
applications such as aconnect or qjackctl.

The other approach makes KeyKit a client of the ALSA "sequencer"
(its really a MIDI routing system), and allows KeyKit to have as many
input and output connections as you may desire. You control the connections
between KeyKit and hardware ports and/or soft synths or other applications
using other utility applications such as aconnect or qjackctl.
By default, KeyKit will create one input port and one output port,
but you can alter that by defining one or both of

Expand All @@ -41,28 +32,15 @@ but you can alter that by defining one or both of

in your environment. Their value should be sanely-sized integer. You should
read doc/multiport to understand how to use these multiple input and
output ports. Note that KeyKit will *not* connect itself to any
other destinations, so you will not be able to do anything until you have
used aconnect/qjackctl/etc. to make connections.
output ports.

By default, KeyKit uses the ALSA sequencer implementation. To switch
to the "raw" MIDI version, do this before compiling:
Note that KeyKit will *not* connect itself automatically to
any other destinations, so you will not be able to do anything
until you have used aconnect/qjackctl/etc. to make connections.

cd mdep/linux_alsa
mv midi.c sequencer_midi.c
mv raw_midi.c midi.c
cd ../..

For the rawmidi version, the default ALSA midi device will be used
by default. You can explicitly control the device used by setting
the environment variable ALSA_RAWMIDI_DEVICE. The value of
ALSA_RAWMIDI_DEVICE should be of the form "hw:#,#", where the two numbers
are the device and card numbers. For example, a value of "hw:1,0"
would use card1 and the 0-th (first) device on that card.

If you use the devmidi version, the default midi device is
/dev/midi00. If you want a different device, you can set the
environment variable MIDIDEVICE to the full path of the device.
Also note that the ports will not appear in qjackctl until you've
actually opened them, either with "Tools1->Port Enabler" in the KeyKit GUI,
or by putting calling outport() or inport() to open a port by default.

You can also set the environment variable MUSICPATH to point to the
directory(s) where you keep your .mid files. For example:
Expand All @@ -76,24 +54,6 @@ Documentation is in the doc directory.

----------------------------------------------------------------------------

Compiling KeyKit for Linux

If you have the 'src' directory and want to recompile keykit from scratch,
execute:

make install_linux # compiles/installs for both ALSA and devmidi
-or-
make install_linux_alsa # for the ALSA version
-or-
make install_linux_devmidi # for the devmidi version

This will compile and install key and lowkey in /usr/local/bin.

You can also "make regress_stdio" to build a text-only version
of the software and run regression tests.

----------------------------------------------------------------------------

Steve Falco (sfalco@lucent.com) produced the first Linux port
in January 1997. Tim Thompson (me@timthompson.com) produced the
ALSA port in April, 2000. Paul Davis (paul@linuxaudiosystems.com)
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ by Tim Thompson (me@timthompson.com)

For use on Windows, just unzip the dist/key_nt.zip and execute the bin/key.exe you find inside.

Other platforms that should work: dist/key_raspbian.zip (Raspberry Pi/ARM) and dist/key_linux_alsa.zip (Linux/Intel).
Other platforms that should work: dist/key_raspbian.zip (Raspberry Pi/ARM) and dist/key_linux.zip (Linux/Intel).

You'll find formatted documentation in:
<ul>
Expand All @@ -24,13 +24,14 @@ doc/libdoc.html (Library functions)
doc/hacking.html (Hacking guidance)
</ul>

See top-level makefile for instructions on compiling. See the doc directory
for other documentation. In particular, see doc/porting for details
on the machine-dependent support needed for a given platform.
See the README.* files for platform-specific info on compiling.
See the doc directory for other documentation. In particular,
see doc/porting for details on the machine-dependent support
needed for a given platform.

Other than for the distributions above, much of the machine-dependent support in the mdep directory
is probably obsolete and will no longer work without modification, but is being retained
for future use.
Other than for the distributions mentioned above, much of the machine-dependent support
in the mdep directory is probably obsolete and will no longer work without modification,
but is being retained for future use.

BTW, when you see "nt" in names - e.g. the key_nt.zip file, mdep/nt directory, or the install_nt target
in the makefile - it refers to the Windows version. The fact that it refers to Windows NT
Expand Down
24 changes: 24 additions & 0 deletions README.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

Compiling and Running KeyKit on Windows

--------------------------------
To compile the windows version, you'll need:

0) Windows 10
1) Microsoft Visual Studio 2019 (the most recent version that put things
in c:\Program Files (x86)\Microsoft Visual Studio\2019 )
2) Cygwin64 (in c:\cygwin64, only needed for perl and an XML parsing library for docs)
3) Git (in c:\program files\Git, for a few unix utilities)

Once you have these, execute this command in a DOS window:

makewindows.bat

This will compile and put binaries in the bin directory.

See the doc directory for:

*.html - nicely formatted docs
porting - gives detailed porting guidelines.

Any questions, email to me@timthompson.com
Binary file renamed dist/key_linux_alsa.zip → dist/key_linux.zip
Binary file not shown.
85 changes: 29 additions & 56 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
# Copyright 1996 AT&T Corp. All rights reserved.
#
# KeyKit has been ported to many environments in its lifetime,
# however the most recent version has only been tested in the
# environments described below.
#
# Windows - To compile the windows version, you'll need:
#
# 0) Windows 10
# 1) Microsoft Visual Studio 2019 (the most recent version that put things
# in c:\Program Files (x86)\Microsoft Visual Studio\2019 )
# 2) Cygwin64 (in c:\cygwin64, only needed for perl and an XML parsing library for docs)
# 3) Git (in c:\program files\Git, for a few unix utilities)
#
# Once you have these, execute this command in a DOS window:
#
# makewindows.bat
#
# This will compile and put binaries in the bin directory.
#
# UNIX/Linux (stdio) - To compile, "make install_stdio".
# Use "make regress_stdio" to run the regression tests.
#
# The machine-dependent parts of KeyKit have not changed much
# over the years, so many of the previous ports
# (most of which are included in the mdep directory) should
# be resurrected fairly easily.
#
# See the doc directory for:
# *.html - nicely formatted docs
# porting - gives detailed porting guidelines.
# however the most recent version has only been tested on
# Windows and Linux.
#
# See the README.* files for platform-specific info.

# Any questions, email to me@timthompson.com

# set MK to the preferred version of the make utility on your system
Expand Down Expand Up @@ -266,9 +242,6 @@ distribution_nt :
cd dist/nt && powershell "$$global:ProgressPreference = 'SilentlyContinue' ; compress-archive -literalpath key -destinationpath ../key_nt.zip"
rm -fr dist/nt

senddownload :
senddownload

updateversion :
sed -e "/KEYKITVERSION/s/Version ..../Version $(VERSION)/" < index.html > tmp.html
mv tmp.html index.html
Expand Down Expand Up @@ -355,15 +328,15 @@ copy_x : bindir
# Linux X Windows version with MIDI
#########################################################

copy_linux_alsa : bindir
cp mdep/linux_alsa/mdep1.c src/mdep1.c
cp mdep/linux_alsa/mdep2.c src/mdep2.c
cp mdep/linux_alsa/mdep.h src/mdep.h
cp mdep/linux_alsa/makefile src/makefile
cp mdep/linux_alsa/bsdclock.c src/clock.c
cp mdep/linux_alsa/tjt.ico src/tjt.ico
cp mdep/linux_alsa/keykit.ico src/keykit.ico
cp mdep/linux_alsa/midi.c src/midi.c
copy_linux : bindir
cp mdep/linux/mdep1.c src/mdep1.c
cp mdep/linux/mdep2.c src/mdep2.c
cp mdep/linux/mdep.h src/mdep.h
cp mdep/linux/makefile src/makefile
cp mdep/linux/bsdclock.c src/clock.c
cp mdep/linux/tjt.ico src/tjt.ico
cp mdep/linux/keykit.ico src/keykit.ico
cp mdep/linux/midi.c src/midi.c
$(RMCR) src/*.c src/*.h src/*.ico src/makefile
$(RMCR) lib/* tests/makefile
cp mdep/stdio/resetkeylib bin
Expand Down Expand Up @@ -428,25 +401,25 @@ distribution_raspbian :

bindir :

install_linux_alsa: bindir
install_linux: bindir
$(MK) install_stdio
$(MK) copy_linux_alsa
$(MK) copy_linux
cd src ; $(MK) install

distribution_linux_alsa :
rm -fr dist/linux_alsa dist/key_linux_alsa.zip
mkdir dist/linux_alsa
mkdir dist/linux_alsa/key
mkdir dist/linux_alsa/key/bin
mkdir dist/linux_alsa/key/lib
mkdir dist/linux_alsa/key/music
mkdir dist/linux_alsa/key/doc
cp bin/key bin/lowkey dist/linux_alsa/key/bin
cp lib/* dist/linux_alsa/key/lib
cp music/* dist/linux_alsa/key/music
cp doc/*.html dist/linux_alsa/key/doc
cd dist/linux_alsa ; zip -r ../key_linux_alsa.zip key
rm -fr dist/linux_alsa
distribution_linux :
rm -fr dist/linux dist/key_linux.zip
mkdir dist/linux
mkdir dist/linux/key
mkdir dist/linux/key/bin
mkdir dist/linux/key/lib
mkdir dist/linux/key/music
mkdir dist/linux/key/doc
cp bin/key bin/lowkey dist/linux/key/bin
cp lib/* dist/linux/key/lib
cp music/* dist/linux/key/music
cp doc/*.html dist/linux/key/doc
cd dist/linux ; zip -r ../key_linux.zip key
rm -fr dist/linux


##########################################
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions mdep/linux_alsa/makefile → mdep/linux/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SRC = real.c yacc.c code.c code2.c sym.c main.c util.c mdep1.c mfin.c \
phrase.c misc.c fsm.c grid.c view.c midi.c clock.c mdep2.c \
keyto.c regex.c task.c fifo.c kwind.c menu.c bltin.c meth.c
PROFILE = -g
CFLAGS = -m32 -O $(INC) $(PROFILE)
CFLAGS = -O $(INC) $(PROFILE)

all : $(EXECS)

Expand Down Expand Up @@ -174,10 +174,10 @@ lint :
lint $(CFLAGS) $(SRC) | grep -v questionable | lintfilter

mdepback :
cp mdep1.c mdep2.c mdep.h makefile ../mdep/linux_alsa
cp tjt.ico keykit.ico ../mdep/linux_alsa
cp clock.c ../mdep/linux_alsa/bsdclock.c
cp midi.c ../mdep/linux_alsa
cp mdep1.c mdep2.c mdep.h makefile ../mdep/linux
cp tjt.ico keykit.ico ../mdep/linux
cp clock.c ../mdep/linux/bsdclock.c
cp midi.c ../mdep/linux

test : all
cd ../tests ; sh keytest.sh
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 38e60cb

Please sign in to comment.