JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Sun Aug 09, 2020 12:50 pm Post subject:
seq1 - A Practice Tool MIDI Sequencer for Linux |
 |
|
The name is tentatively 'seq1', if I find that already exists, I'll change it.
Anyway, I've wanted a metronomic tool for practicing guitar and ukulele for a long time. For what I do, I just need a bass part and some simple percussion. But listening to the same loop over and over gets boring quickly.
I'm using a Raspberry Pi 4 (8G) for this, but I believe it would work for any Linux system that has a USB MIDI device. I cannot, however, even guess at how bad or good the timing will be on another system. I am not in a position to make it work on Windows systems.
I wanted a MIDI sequencer that can improvise a bit. Such as certain notes being random choice between several different pitches.
Stipulation: The program is written in C. Not C++. It is basically a wrapper around the amidi command.
Stipulation: This program has a few best practice violations. However, that helped keep it simple and is actually pretty tight sounding even though the clock used is atrocious in a technical sense. I found clock jitter in the 2 millisecond range. Again, it doesn't sound jittery or off. My understanding is that there is no true precision clock in the Raspbian kernel, so it's possible other linux installations might work better. I only mention this because I've measured jitter and know it's there, but at the same time I don't hear it. One result of a best practice violation causes the system to run with a loadavg of about 1.05 1.05 1.05 and one CPU runs near 100% use. My use of this tool has been on a system that does pretty much nothing else (which is what I would suggest).
Stipulation: I am writing this as a tool to use in my studio, to make practicing more fun. I am not in a position to spend the time to make it a GUI based bestest tool ever. It is what it is.
This is a command line tool. It is as simple as I could make it. A sequence is programmed with source language that defines note events. The tool compiles the source into a timestamp sorted event list and then the integrated event player works on the event list by starting a clock at zero and watching the clock until it can send a MIDI event. The MIDI event is sent using the system() function to execute an 'amidi' command which does the MIDI data transfer. Currently, only note on and note off messages are supported during the sequence. Continuous controller messages may be sent before the sequence starts, but currently, they are not supported during the sequence play. Bender messages are not currently supported.
The tool doesn't record. A note event is given the time to play as a tick number, pitch is MIDI note number, velocity is a value from 1 to 127. Any text editor can write the .seq file. Commands are provided for 2 level nest of looping with loop count control. This allows repeated sections of music to be coded just once and looped N times.
The tool supports transpose amount per MIDI channel specified on the command line.
Given the above, I'm considering posting the source code providing people won't laugh too hard. However, the caveat is: download and do with it as you will. I know it's not "pro quality", but it works well enough that I've practiced several hours with it and find it to have far better timing than I do. In fact, I'm considering adding a random variance feature to allow controlling how robotic it sounds.
Compiling the source code is easy, there's no Makefile, it's just a gcc command.
There's a lot of things a lot of folks will say it needs. What it has is what I need I'm guessing this is a sort of open source thing? I know there's a whole official protocol with that which I probably am not following. Given enough interest, I would post updates occasionally. I know about github, I'm not interested in that route - I don't want to spend a ton of time in more coding than I need to - I want to USE the tool, not maintain it. With that caveat, anyone who would download it can modify it as they desire for their own needs. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
|