Giter Site home page Giter Site logo

midilute's Introduction

Midilute

Midilute is a command-line application that turns midi input into keystrokes that causes the lute in Mordhau to be played.

Not for Windows

I wrote this program for myself, but decided to publish it. I play Mordhau on Linux via software made by Valve called Proton. Because of this the program I wrote unfortunately only works on Linux.

It uses Guile, ALSA, and xdotool.

  • Guile runs on Windows via Cygwin or MinGW, but
  • ALSA only runs on Linux.
  • xdotool is available on many *nix platforms.

If you want something like this for Windows:

I know that the creator of Lutebot is working on a new version that has midi device support. There is also another project that seems to support this feature.

How to build the program

You need Guile, ALSA, a C++ compiler, and CMake to compile the midi component of this program. Some OS's like Ubuntu put development components into special packages like guile-2.2-dev and asoundlib2-dev.

Assuming you've got everything you need installed, you should be able to follow these instructions:

Clone the project:

$ git clone https://github.com/dextercd/Midilute.git
$ cd Midilute

Create the build directory and build the midi component with CMake:

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

As long as no errors occurred you should now have a file named libguilemidi.so in the build directory.

Now you should be able to use the program.

How to use the program

You'll need to build the C++ files with CMake. Let's assume the resulting libguilemidi.so file is in a directory called build/.

Now you should be able to run this command.

$ LTDL_LIBRARY_PATH=build/ guile main.scm

This will launch Midilute, but playing your midi device will not yet do anything. You'll need to connect your midi device with the program using aconnect.

# Show all midi input and output devices
$ aconnect -l
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 28: 'Digital Piano' [type=kernel,card=3]
    0 'Digital Piano MIDI 1'
client 128: 'Mordhau input' [type=user,pid=19573]
    0 'Mordhau input   '

# Digital piano is my midi device, Mordhau input is the virtual device that we
# want to connect to.

$ aconnect 28:0 128:0

# Now when you press a key on your midi device that is in Mordhau's lute range
# it should automatically type something like `equipmentcommand 16.

Now you should be able to play the Lute with your midi device!

midilute's People

Contributors

dextercd avatar

Stargazers

 avatar

Watchers

 avatar  avatar

midilute's Issues

Issues building with cmake

Hello, I am currently having trouble building this program with cmake. I download the source as zip, and unzip the contents. I then create a directory inside the source folder called build. Inside, I install guile-2.2 and I run cmake while pointing to the source directory. Here is a log of the steps:

robin@nest:~/workspace/lutebot/Midilute-master/build$ sudo apt install guile-2.2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  guile-2.2-libs
Suggested packages:
  guile-2.2-doc
The following NEW packages will be installed:
  guile-2.2 guile-2.2-libs
0 upgraded, 2 newly installed, 0 to remove and 11 not upgraded.
Need to get 4,947 kB of archives.
After this operation, 45.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 guile-2.2-libs amd64 2.2.3+1-3ubuntu0.1 [4,939 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 guile-2.2 amd64 2.2.3+1-3ubuntu0.1 [7,452 B]
Fetched 4,947 kB in 0s (33.3 MB/s)    
Selecting previously unselected package guile-2.2-libs:amd64.
(Reading database ... 257454 files and directories currently installed.)
Preparing to unpack .../guile-2.2-libs_2.2.3+1-3ubuntu0.1_amd64.deb ...
Unpacking guile-2.2-libs:amd64 (2.2.3+1-3ubuntu0.1) ...
Selecting previously unselected package guile-2.2.
Preparing to unpack .../guile-2.2_2.2.3+1-3ubuntu0.1_amd64.deb ...
Unpacking guile-2.2 (2.2.3+1-3ubuntu0.1) ...
Setting up guile-2.2-libs:amd64 (2.2.3+1-3ubuntu0.1) ...
Setting up guile-2.2 (2.2.3+1-3ubuntu0.1) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/guile-2.2/bin/guile to provide /usr/bin/guile (guile) in auto mode
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
robin@nest:~/workspace/lutebot/Midilute-master/build$ ls -alrt ../
total 28
-rw-r--r-- 1 robin robin 1954 Dec  3  2019 README.md
-rw-r--r-- 1 robin robin 1107 Dec  3  2019 main.scm
drwxr-xr-x 2 robin robin 4096 Dec  3  2019 guile-midi
-rw-r--r-- 1 robin robin  490 Dec  3  2019 CMakeLists.txt
drwxr-xr-x 3 robin robin 4096 Jul  2 17:26 ..
drwxr-xr-x 4 robin robin 4096 Jul  2 18:00 .
drwxr-xr-x 2 robin robin 4096 Jul  2 18:07 build
robin@nest:~/workspace/lutebot/Midilute-master/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ALSA: /usr/lib/x86_64-linux-gnu/libasound.so (found version "1.1.3") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'guile-2.2'
--   No package 'guile-2.2' found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  CMakeLists.txt:6 (pkg_check_modules)


-- Configuring incomplete, errors occurred!
See also "/home/robin/workspace/lutebot/Midilute-master/build/CMakeFiles/CMakeOutput.log".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.