Giter Site home page Giter Site logo

gbevin / receivemidi Goto Github PK

View Code? Open in Web Editor NEW
292.0 292.0 22.0 3.84 MB

Multi-platform command-line tool to monitor and receive MIDI messages

Home Page: https://uwyn.com

License: GNU General Public License v3.0

Makefile 0.11% C 5.46% C++ 91.40% Objective-C++ 2.01% Java 0.74% Objective-C 0.20% CMake 0.05% PowerShell 0.01% Shell 0.02%
command-line command-line-tool midi midi-messages

receivemidi's Introduction

receivemidi's People

Contributors

gbevin avatar plan44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

receivemidi's Issues

Timeout receivemidi

This is not an issue, but a request and I do not know how to contact you.

I am trying to connect to a MIDI device via a website server. The (private) server is connected to a midi device and I want to connect to it via a website page running on that server. I wrote a PHP script to handle the request. At first I used amidi, but that outputs unreliably. Then I used this software, sendmidi and recveivemidi. When I start the PHP script from the commandline (logged in via SSH) everything works fine. The receivemidi command does not terminate itself, so I programmed a timeout in my php script to terminate upon reception of a certain expected number of bytes or after (e.g.) 1 second. This seems to work.
However, when I access the PHP script from a remote website, the script ´hangs´ It will not terminate with a proc_terminate command as it does when I directly run the PHP from the server. I am struggling for 2 days now, it must have something todo with user rights. The apache error log shows
"Home directory not accessible: Permission denied", from which the origin I cannot find. Searching the web points to pulseaudio, but I am not sure and several attempts with user rights did not help.

Would it be possible to add some functionality in the receivemidi program to terminate upon reception of a certain number of bytes AND have a timeout?

Receive multiple SysEx messages under Windows?

I'm trying to send a sequence of 16 SysEx messages from a device to ReceiveMIDI, and when I initiate the transfer I can only receive the first message using Windows. The Mac version works perfectly.

Mac output: (expected behaviour)
Mac-mini-3:~ matthew$ /Users/matthew/Downloads/receivemidi-macos-1.0.5/receivemidi dev Alex system-exclusive hex 00 02 17 0A 00 41 42 31 7E 34 4E 42 68 7F 7F 7F 7F 7F 7F 3F 3F 0A 01 00 0C 00 05 00 dec system-exclusive hex 00 02 17 0A 01 3D 7E 2F 7E 6A 6A 4B 07 7F 7F 7F 7F 7F 7F 3F 3F 0B 08 00 0C 00 01 00 dec system-exclusive hex 00 02 17 0A 02 1D 7F 5A 7F 26 25 7F 62 7F 7F 7F 7F 7F 7F 3F 3F 0B 03 00 0C 00 02 00 dec system-exclusive hex 00 02 17 0A 03 2E 4D 16 7F 40 58 7F 4D 7F 7F 7F 7F 7F 7F 3F 3F 08 00 00 0C 00 03 00 dec system-exclusive hex 00 02 17 0A 04 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 04 00 dec system-exclusive hex 00 02 17 0A 05 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 05 00 dec system-exclusive hex 00 02 17 0A 06 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 00 00 dec system-exclusive hex 00 02 17 0A 07 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 01 00 dec system-exclusive hex 00 02 17 0A 08 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 02 00 dec system-exclusive hex 00 02 17 0A 09 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 03 00 dec system-exclusive hex 00 02 17 0A 0A 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 04 00 dec system-exclusive hex 00 02 17 0A 0B 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 05 00 dec system-exclusive hex 00 02 17 0A 0C 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 00 00 dec system-exclusive hex 00 02 17 0A 0D 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 01 00 dec system-exclusive hex 00 02 17 0A 0E 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 02 00 dec system-exclusive hex 00 02 17 0A 0F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 3F 3F 00 00 00 0C 00 03 00 dec

Windows output:
C:\Users\User\Desktop\receivemidi dev Alex system-exclusive hex 00 02 17 0A 00 41 42 31 7E 34 4E 42 68 7F 7F 7F 7F 7F 7F 3F 3F 0A 01 00 0C 00 05 00 dec

I am seeing the same kind of behaviour with other Windows MIDI apps including MIDI-OX. The sending device literally just sends the SysEx bytes, flushes the USB interface, then sends again, once per message until it's done.

I'm expecting to see the Mac output, 16 messages in a row.

Additionally - how hard would it be to dump the incoming SysEx messages to a .syx file?

MIDI Output shown instead

First of all I want to thank you for this great utility! The versatility is excellent and I'm using it for a custom controller script as we speak. While working with it earlier, I've noticed the list shows outputs instead of inputs. Typing the correct input port works however.

for (auto&& device : MidiOutput::getAvailableDevices())

Can't receive MIDI stream in Hex format

Unable to receive MIDI messages in hex format, I've typed the command but I receive all the messages in decimal, I've typed the following command: "receivemidi dev Driver IAC Bus 1 hex" but the data stream is still in decimal numbers.

Juce Timer runs with realtime priority from jackd settings

I've been having trouble with automated scripts running jackd and receivemidi. Sometimes they end up causing RT throttling, which makes the system unresponsive. I checked with "top -H", and receivemidi was running with the -70 realtime priority I assign to jackd in it's command line. I changed the receive midi invocation to use the nice command, and that stopped receivemidi form having -70 priority, but a thread called "Juce Timer" now appears with -70 priority.

Is there a way to get JUCE to stop trying to use my jackd priority settings?

I thought that receivemidi operated only on ALSA ports, so why is it even looking at jackd?

thanks,
-Ted

does util.command work on windows?

Hi,

I am getting xxxx could not be started. This is on win7. I have tried using an absolute path and just the name of the command, e.g blah.exe.

Mike

Middle C displayed as C5

The note names in Note On and Off messages are from C0 to G10, middle C on a keyboard is usually named C3 or C4 and therefore the start note is C-2 or C-1
so it would be useful an option to choose the Middle C value between the aforementioned notes and choose one of them as default instead of displaying C5 when playing middle C.

Linux missing libraries.

I have the following missing libraries on Ubuntu 20.04.

sendmidi: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.33' not found (required by sendmidi) sendmidi: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by sendmidi)
sendmidi: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by sendmidi) sendmidi: /lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.29' not found (required by sendmidi)

I compiled it and works fine.

Don't force march in the buildsystem

The buildsystem enforces -mtune=core2 -march=core2, which are valid only for x86 platforms.
I successfully built and used extensively on an arm cpu, you just have to remove those two flags.
Please edit your makefile to set them only on x86 platforms.

Execute Shell Script

Hi,

Thanks for a great project.
Any chance of modifying jsf, or rather adding an option to execute a shell script/command for each message?

Thanks!

spy on midi out ports

Hi,
first of all: thank you for saving me ages of coding time, I was missing a unix type commandline midi monitor utility and was thinking about creating one myself in python or something. Fortunately your tool already exists and is almost exactely what I was looking for! It probably would have taken me years to complete haha ;-)

One thing that I am missing is a feature that I know from snoize MIDI Monitor. You can monitor what goes into an actual midi output port. You probably know MIDI Monitor, it's called "spy on output to destinations" in the gui.

For instance sometimes I work with midi manipulator tools like "MIDIpipe". I would like to see what goes into midi pipe from my daw (Output Port: MidiPipe Input 1), and see what comes out after midi pipe (Input Port: MidiPipe Output 1).

Or another usecase was when I wanted to proof that a cheap china usb midi adapter does not transmit all midi data, it looses some ;-)

Is there any way this would be possible with receivemidi, maybe in combination with sendmidi or something?
Hope this all makes sense.

Thanks again!
all the best
Jojo

Commands from program file

Hi,

Thanks for this kindly tool! But how to check on different notes and execute a script. This is my command file:

dev microKEY2
on C5 js "if (MIDI.isNoteOn()) Util.command('notepad.exe');"
on B4 js "if (MIDI.isNoteOn()) Util.command('taskkill /f /im notepad.exe');"

But that will not work. How to combine two actions in the command file?

Dependencies for Ubuntu

Hello,

Not sure if this is the right place to put this, but there are a few dependencies for compiling on Ubuntu that aren't listed or obvious:

pkg-config
libasound2-dev
libcurl4-openssl-dev

I assume this applies to SendMIDI too. Thanks for the software!

Triggering a script only when a specified sequence of midi notes are received? How?

Thanks for sendmidi and receivemidi Geert!

I like the script triggering feature of receivemidi a lot.

js    code       Execute this script for each received MIDI message
jsf   path       Execute the script in this file for each message

How could I trigger a script when a sequence of notes is received?

Example: If note pitches 60,61,62 in this order is received (no matter how long or short each note is, only note on sequences could be considered, ignoring note off events). The script should not trigger for 60. Also not for 61. Also not for 62. Also not for 60,61. Also not for 60,62. Also not for 61,62. But the triple combination 60,61,62 it should trigger.

Is there any simple technique available how this could be achieved? Maybe you tried anything similar already? I know this technique from Sequetron by Phil Tipping which is its main feature. Sequetron sequencer can be controlled entirely by commands which trigger on midi note sequences.

This can be useful if the midi space should be used similarly, but this time using receivemidi, opening it for general use cases.

Multiple devices with same name

Hi, I'm looking to "proxy" traffic from one computer, to a MIDI keyboard, through a combination of receivemidi and sendmidi so I can spy on the traffic and use this wonderful swiss army knife to reverse engineer some sysex commands. I may be over-complicating this, so bear with me if there's a simpler solution.

Here's my proposed connection setup:

Windows Computer Running Proprietary Editor Software -> (LINUX with receivemidi (USB MIDI Device 1), data piped to sendmidi (USB MIDI DEVICE 2) ) -> Keyboard

And in reverse as well. This way my linux machine is in-between and can log the conversation, run scripts, etc. I really like this tool so trying to find a way...

This seems like it would work, however, the receivemidi/sendmidi only allow me to use device name, rather than an ID. Unfortunately, in my development setup, I have two MIDI usb devices that are the same make/model and same name:

Output from aplay -L

...
usbstream:CARD=S3
    Sound Blaster Play! 3
    USB Stream Output
sysdefault:CARD=Tab
    Default Audio Device
usbstream:CARD=Tab
    E-MU XMidi1X1 Tab
    USB Stream Output
sysdefault:CARD=Tab_1
    Default Audio Device
usbstream:CARD=Tab_1
    E-MU XMidi1X1 Tab
    USB Stream Output

Output from receivemidi list and sendmidi list:

Midi Through Port-0
E-MU XMidi1X1 Tab Out
E-MU XMidi1X1 Tab Out

I did try launching them successfully, hoping to get away with something, but it always selects the first device (although two instances can open the same card, which could be useful).

Is there a a way to use an index, or a flat out device id (ex: /dev/snd/midiC3D0)? I tried, but wasn't able to find a workaround. Maybe an option like receivemidi devindex 2 in my case? It would need to be checked each time because the cards can move around, but that would be really useful for some swiss army knife action using this tool.

From what I saw there weren't any good alsa tricks for this, so it seems like an index param in the tools would be a fairly easy feature to implement.

I know I can always find/buy/use a different midi device, but where's the fun in that? :)

Anyway, thanks for a great piece of software, I've used it on other projects and it came in super useful, especially the send clock features, that was a life-saver.

output / input redirection on windows

Hi. I know these utilities are developed primarily for linux and mac. But i would like to get redirection working on windows command prompt. Perhaps this could be allowed as an 'issue' to help other windows users? Windows command prompt allows you to use a > much like a pipe | on unix. The text output of command 1 is fed into command 2. I would expect receivemidi > sendmidi to work as the default behaviour is to log out the commands in a way that sendmidi understands. I think it is the input ti sendmidi that is not working. receivemidi > log.txt works fine. Does anyone know how to make it work?

ReceiveOsc, SendOsc

Just thought for a moment how it would be having also ReceiveOsc and SendOsc, then we could create easily cross variants like ReceiveOsc | SendMidi, or ReceiveOsc and triggering some shell script, similarly as possible with ReceiveMidi already. My main use case would be triggering scripts from xbox360 game controller. Scripts which contain SendMidi :-) , converting xbox360 to midi controllers, which can be useful if you want to trigger things independently of active windows, here midi events are very useful, they pass through any window selection or non-selection.

Thanks for sharing your great work.

Ability to launch arbitrary command when an event is received?

Hi! First of all, thanks for the wonderful tools. I was wondering if there is a way to have an incoming MIDI event trigger a specific command on the operating system, such as running another executable or shell script. I tried to read through the code, but I don't know C++ well enough to see if this is easy to add, or how to go about it.

I'm happy to try to learn if you could point me to the right spot in the codebase, I can't tell if this would be implemented here or in JUICE lib.

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.