use Electric Guitar as MIDI controller

Discuss anything new and newsworthy! See http://planet.linuxaudio.org and https://libreav.org/news for more Linux Audio News!

Announcements of proprietary software may fit better in the Marketplace.


Moderators: raboof, MattKingUSA, khz

Post Reply
Minh
Established Member
Posts: 5
Joined: Fri May 22, 2020 10:46 pm

use Electric Guitar as MIDI controller

Post by Minh »

Hi guys,
I have this question that I have been trying to find a solution to.

I am trying to find ways to use my Electric Guitar as MIDI input to my DAW. I am exploring various options, and currently trying to explore plugins options, before buying hardware like MIDI pickups.
I found out about MIDI Guitar, but they only support on Mac and Windows.
From this thread , someone suggested that I can either run WINE, Aubio or Carla.

When I run WINE, and run MIDI Guitar 64 bit, ASIO Driver does not seem to find any Device for me to connect as INPUT. Strangely, in the MIDI Interface tab, it recognizes my Audio Interface as one of the choices for Output.

If someone has experience with this, please help me out.



Set Up
OS: Ubuntu Studio 19.4 LTS
Interface: TASCAM US 2 x 2
DAW: mostly Ardour 5
I run QJackCtl, connect my Audio Interface, and start Ardour as my normal workflow, and connect any other software through JACK if needed.
lad
Established Member
Posts: 45
Joined: Thu Aug 16, 2018 8:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: use Electric Guitar as MIDI controller

Post by lad »

This sounds familiar. Try to load the virtual midi device module like so:
sudo modprobe snd_virmidi
If it works, you'll see a virtual midi device show up in jack connections and the wine program.

Do this to load the module on boot:
sudo su
echo snd-virmidi >> /etc/modules
OS: Debian 11 kernel: Liquorix
...trying out AV Linux
tavasti
Established Member
Posts: 2047
Joined: Tue Feb 16, 2016 6:56 am
Location: Kangasala, Finland
Has thanked: 369 times
Been thanked: 208 times
Contact:

Re: use Electric Guitar as MIDI controller

Post by tavasti »

Minh wrote: Fri May 22, 2020 11:22 pm When I run WINE, and run MIDI Guitar 64 bit, ASIO Driver does not seem to find any Device for me to connect as INPUT. Strangely, in the MIDI Interface tab, it recognizes my Audio Interface as one of the choices for Output.
Connect midi cable from your interface midi out to midi in, and you can read your midi from there.

Linux veteran & Novice musician

Latest track: https://www.youtube.com/watch?v=ycVrgGtrBmM

Minh
Established Member
Posts: 5
Joined: Fri May 22, 2020 10:46 pm

Re: use Electric Guitar as MIDI controller

Post by Minh »

guys, I managed to get it working, though not exactly the way @lad suggested.
Maybe later I will try to do it your way, that way I can ensure I understand better.


I ended up going with Carla. These were my steps
1. install the repository of kxstudio.
I followed this exact instruction https://lkubuntu.wordpress.com/2014/01/ ... -wineasio/ (I have Ubuntu so I follow the ubuntu part)

2. install WINE

3. Run the exe file downloaded for MIDI Guitar
Then I go into where MIDI Guitar installs its VST file, find the .dll required, copy that to a folder "VST" that I made on Desktop

4. Run Carla
On the left hand column, Under my VST folder, I see MIDIGuitar2-64bit (if you have 32bit, that's what you will see)

Open QJackCtl
press on Connect, connect "capture_1" to MIDI Guitar 2's "input_1"
*note: I connect my electric guitar on Input_1 from my Audio Interface.
and connect MIDI GUITAR 2's "output_1" to both "playback_1" and "playback_2"

Voila.

Hopefully this post of mine helps the next person.

@lad from MIDI GUITAR 2's GUI, i dont see anyway you can change the Input Source. But once I have it in Carla, the host name will appear as Carla-Win64-Bridge, or something similar to that.
User avatar
flappix
Established Member
Posts: 50
Joined: Thu Jan 19, 2017 10:39 pm
Location: Germany
Been thanked: 16 times

Re: use Electric Guitar as MIDI controller

Post by flappix »

I'm using aubio for this. It runs natively under linux and does a quite good job.
Minh
Established Member
Posts: 5
Joined: Fri May 22, 2020 10:46 pm

Re: use Electric Guitar as MIDI controller

Post by Minh »

flappix wrote: Sat May 23, 2020 8:35 pm I'm using aubio for this. It runs natively under linux and does a quite good job.
Can you please provide some instruction?
Basslint
Established Member
Posts: 1511
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 382 times
Been thanked: 298 times

Re: use Electric Guitar as MIDI controller

Post by Basslint »

Minh wrote: Sat May 23, 2020 10:57 pm
flappix wrote: Sat May 23, 2020 8:35 pm I'm using aubio for this. It runs natively under linux and does a quite good job.
Can you please provide some instruction?
I hope @flappix doesn't mind if I answer, since I used Aubio in the past, hopefully they will correct me if I say something wrong :D

Aubio is a library which implements several "audio labelling" algorithms. It also provides some command line tools to make use of those algorithms in real-time.

The one you'd need for guitar pitch tracking, which automatically translates the audio data to MIDI, is `aubionotes` (documentation). To use it more easily, you can pass it the -j flag so that you can patch inputs and outputs via jack. You might need to play a bit with flags to get it right, but often it just works out of the box. The most important parameter is `-m`, which selects the pitch tracking algorithm, but you might not need to set it since by default `aubionotes` uses the fast version of the Yin algorithm, which as far as I remember is the best for guitar.

To have better results, avoid any effects on your guitar and perhaps a band-pass filter would help stop some false positives due to unwanted harmonics, ringing strings and their likes.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
arman
Established Member
Posts: 16
Joined: Tue May 05, 2020 9:16 pm

Re: use Electric Guitar as MIDI controller

Post by arman »

I'm trying aubio right now, but it seems there's no note offs so the notes ring forever. Any tips?
stanlea
Established Member
Posts: 700
Joined: Wed Apr 25, 2012 9:49 pm
Has thanked: 41 times
Been thanked: 23 times

Re: use Electric Guitar as MIDI controller

Post by stanlea »

There is another solution : the Guitarix virtual amp has midi out and works pretty well too. Linux native and easy to set up.
Basslint
Established Member
Posts: 1511
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 382 times
Been thanked: 298 times

Re: use Electric Guitar as MIDI controller

Post by Basslint »

arman wrote: Mon May 25, 2020 6:01 am I'm trying aubio right now, but it seems there's no note offs so the notes ring forever. Any tips?
It depends on the ASDR envelope of the synth you are using. aubionotes detects onsets, not silence. So, instruments which would play infinitely if you kept pressing a piano key (e.g. organs) would be unusable.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
Minh
Established Member
Posts: 5
Joined: Fri May 22, 2020 10:46 pm

Re: use Electric Guitar as MIDI controller

Post by Minh »

Basslint wrote: Sun May 24, 2020 2:40 pm
Minh wrote: Sat May 23, 2020 10:57 pm
flappix wrote: Sat May 23, 2020 8:35 pm I'm using aubio for this. It runs natively under linux and does a quite good job.
Can you please provide some instruction?
I hope @flappix doesn't mind if I answer, since I used Aubio in the past, hopefully they will correct me if I say something wrong :D

Aubio is a library which implements several "audio labelling" algorithms. It also provides some command line tools to make use of those algorithms in real-time.

The one you'd need for guitar pitch tracking, which automatically translates the audio data to MIDI, is `aubionotes` (documentation). To use it more easily, you can pass it the -j flag so that you can patch inputs and outputs via jack. You might need to play a bit with flags to get it right, but often it just works out of the box. The most important parameter is `-m`, which selects the pitch tracking algorithm, but you might not need to set it since by default `aubionotes` uses the fast version of the Yin algorithm, which as far as I remember is the best for guitar.

To have better results, avoid any effects on your guitar and perhaps a band-pass filter would help stop some false positives due to unwanted harmonics, ringing strings and their likes.
Sorry I am fairly new to Linux, I couldnt quite figure it out.

Currently I am running Jack, it's connected to my Audio Interface, and my electric guitar is connected to IN1, which appears as Systems-Capture 1, so how would I type it?

aubionotes -i systems_capture_1
doesnt seem to work, it says there's n such file or directory.
User avatar
SpotlightKid
Established Member
Posts: 250
Joined: Sun Jul 02, 2017 1:24 pm
Has thanked: 48 times
Been thanked: 54 times

Re: use Electric Guitar as MIDI controller

Post by SpotlightKid »

Code: Select all

system:capture_1
Use "jack_lsp" to list in- and output ports (or install "Cadence", which gives you the program "Catia" a graphical patch bay for ALSA and JACK ports).
Minh
Established Member
Posts: 5
Joined: Fri May 22, 2020 10:46 pm

Re: use Electric Guitar as MIDI controller

Post by Minh »

SpotlightKid wrote: Mon May 25, 2020 9:24 pm

Code: Select all

system:capture_1
Use "jack_lsp" to list in- and output ports (or install "Cadence", which gives you the program "Catia" a graphical patch bay for ALSA and JACK ports).

So going with your suggestion, I typed the following in:

Code: Select all

 aubionotes -i system:capture_1 -j -r
usage: aubionotes [ options ] 
       -i      --input            input file
       -r      --samplerate       select samplerate
                 use 0 to use input source samplerate, or 32000 to force 32kHz
       -B      --bufsize          set buffer size
                 number of frames to run the analysis on
       -H      --hopsize          set hopsize
                 number of frames to read from source before each analysis
       -O      --onset            select onset detection algorithm
                 <default|energy|hfc|complex|phase|specdiff|kl|mkl|specflux>;
                 default=hfc
       -t      --onset-threshold  set onset detection threshold
                 a value between 0.1 (more detections) and 1 (less); default=0.3
       -M      --minioi           set minimum inter-onset interval
                 a value in second; default=0.012
       -p      --pitch            select pitch detection algorithm
                 <default|yinfft|yinfast|yin|mcomb|fcomb|schmitt>; default=yinfft
       -u      --pitch-unit       select pitch output unit
                 <default|freq|hertz|Hz|midi|cent|bin>; default=freq
       -l      --pitch-tolerance  select pitch tolerance
                 (yin, yinfft only) a value between 0.1 and 0.7; default=0.3
       -s      --silence          select silence threshold
                 a value in dB, for instance -70, or -100; default=-90
       -d      --release-drop     select release drop threshold
                 a positive value in dB; default=10
       -T      --time-format      select time values output format
                 (samples, ms, seconds) default=seconds
       -q      --quiet            be quiet
       -v      --verbose          be verbose
       -h      --help             display this message

  
If I wish to use Aubio, or aubionotes to polyphonically track my electri guitar in real time, I guess i need some more instructions.
I am still fairly new to Linux, especially in regards to audio production software.

Thanks for your patience and guidance.
User avatar
SpotlightKid
Established Member
Posts: 250
Joined: Sun Jul 02, 2017 1:24 pm
Has thanked: 48 times
Been thanked: 54 times

Re: use Electric Guitar as MIDI controller

Post by SpotlightKid »

Basslint wrote: Sun May 24, 2020 2:40 pm [...] `aubionotes` (documentation). To use it more easily, you can pass it the -j flag so that you can patch inputs and outputs via jack.
Apparently you have to use the '-j' flag, not '-i'. Then use catia or the qjackctl connection dialog or the 'jack_connect' command line tool to connect your audio input to aubionote's input. Remember, you can use 'man <program>' to view the help for most command line programs.
Post Reply