You are here

Midi control for QTractor

I'm experimenting with external midi control for qtractor. For example, I have a midi device connected to qtractor that sends cc7 volume changes for a particular channel. Those changes doesn't seem to have any effect on qtractor, in the mixer the volume stays where it is. is there a way, perhaps, to enable such behavior so I could change channel volumes (and maybe other things) from external device?

Best regards,
Marko

Forums: 
rncbc's picture

I finally got to put my BCF2000 on the desk and edit some presets with BC-Edit. It seems to work on Linux (java -jar bcedit.jar). Also, I could download the factry presets to the editor, make some changes and then tried to upload the new user defined preset to the BCF2000. To no avail. It always fails with this Timeout error while sending "$rev F1", so no joy in making my custom Qtractor preset via BC-Edit.

I guess I'll have to go by with on-panel editing. Then dump/load the preset as SysEx, the old-fashioned way. I got to test this working from the command line utility amidi alright. Just got no time left yet to make custom edits (gotta RTFM still:)

Anyway, I found that the Ardour manual has a section about this very subject (and the same trouble with BC-Edit, incidentally) from which you can get practical in Linux terms, here

Later, this week-end, I'll get to it again, and probably get a nice Qtractor Mixer Preset for us; or you can make your own first and share. My plan is start with factory Preset 2 Simple Mixer (P-2) and just change the PC's (MIDI Program Change) buttons below the rotary knobs and the knob push-buttons as well, into CC's (MIDI Control Change), which are yet the only kind of MIDI controller events recognized in Qtractor.

As my suggestion, from top to bottom, re. channels 1 to 8, respectively for each vertical strip/track:

Rotary Knobs:
CC#10 - Panning (same as P-2)
Push-button Knobs:
CC#22 - Monitor (or Record)
1st-row Buttons:
CC#21 - Solo (or Monitor)
2nd-row Buttons:
CC#20 - Mute
Faders:
CC#7 - Volume (same as P-2)

Your alternate suggestions are welcome.

OTOH, while you do workout on the BCF presets :) I'll do the logarithmic (or cubic?) scaling for audio tracks gain/volume commands. Deal?

Seeya

Yeah, DEAL! As I've already finished lets they the first half of the preset, I will finish it and get the preset dump from console! (Maybe I'll try out to connect the BCF to a windows machine and do the presets with BCF-Edit. Otherwise its really a lot of knob-work...

[EDIT]: Just finished the first version of our qtractorMixer-BCF-preset. I prefered the following mapping from top to bottom:
Rotary - CC 10 - Track Pan
Rotary_Button - CC 22 - Track Solo
Button_1 - CC 20 - Track Monitor
Button_2 - CC 21 - Track Mute
and of course, the Level - CC 7 - Track Gain

The midi controller map to import in qtractor is here: bcx2000.qtc
The presets (as i use 2 presets for all the 16 channels) are also there: qTractorMixer_1-8.syx and qTractorMixer_9-16.syx

To store the presets to the BCF just use
amidi -p hw:2 -s qTractorMixer_1-8.syx.

@Lexridge: Please try out these 2 presets, they should work fine ...

When I send either of your sysex files to my BCF2000, I get an Er22. :(
For that matter, I cannot even import them into BCEdit, which btw, as Rui mentioned earlier, cannot send to the BCF. :(

Lexridge

rncbc's picture

@lexridge:
Before you can send any sysex to the BCF2000 you should make sure no connection to or from it is in use; then you should make sure which device number is the BCF in ALSA sound card list, eg.

cat /proc/asound/cards

read N on the left-most column and only after that you may be confident to send the syxex file with

amidi -p hw:N -s filename.syx.

OTOH, the sysex files that are used this way are raw sysex files, literally captured as direct preset dumps from the BCF2000; they're not the same exquisite format as the ones imported/exported from BCEdit, so you can't use them that way.

Seeya

@Rui: amidi was most certainly 'talking' to the BCF. The Er22 was on the BCF's display, not from amidi. I would get the LED figure 8 pattern for a few seconds, then the Er22. However, the BCF shows up as having 3 separate MIDI ports, and I just chose the first one.

I used amidi -l to show me the ports, and here are the commands I sent, both resulting in the Er22:
amidi -p hw:2,0,0 -s qTractorMixer_1-8.syx
amidi -p hw:2 -s qTractorMixer_1-8.syx

BTW, my BCF is using firmware v1.10.

Lexridge

rncbc's picture

@lexridge,

gizzmo files worked fine on my BCF2000, the same files were renamed and made available here for the convenience:

Qtractor_Mixer_1-8.syx
Qtractor_Mixer_9-16.syx

please, try to download as plain binary (octet-stream), as that's what they really are, without any kind of text transliteration (eg. CR/LF conversion).

The controller configuration file, the one to get loaded on View/Controllers.../Import..., also follows

bcx2000.qtc

nb. this one maybe read as a usual text file.

Seeya

rncbc's picture

Just committed to CVS (qtractor-0.4.1.1327):

- MIDI control mapping of audio track gain controls are following
a cubic scale, in approximation to non-linear logarithmic (IEC).
(EXPERIMENTAL).

Please test :)

I will test it... (wow ... really very productive this weekend ... )
May I ask you a stupid question: When you talk about a revision of qtractor (0.4.1.1327 in this case). Where can I find this information? I'm very new to CVS (only used SVN) ... and all I can see is a revision of every single file ... not an over all revision ...

rncbc's picture

CVS has no commit revision as SVN has. Although each files has its own revision under CVS that's not the number I'm referring to on the qtractor version string. This is just an arbitrary number that I try to increment manually on the head of the configure.ac file on each of my CVS commits, kludgy, eh? :))

Byee

Hi rui,
I tested out the cubic approximation to IEC scale, but it didn't look very good. Faders are still very non-linear.
I had a look at the source code, and copied the IEC-scalling things from qtractorMeter.c to our control map. I think this works very fine. You can have a look at it, by taking this file: qtractorMidiControl.cpp.
It is just a fast hack, and i think, there might e faster ways to do that ... but it works.
(Btw. I also added my name to the header .... (took the chance when you invited me...))

rncbc's picture

Wait. I've made a vice-versa mistake due to not testing it for real. I still believe the cubic approximation is a pretty good one against the IEC/logarithmic one. My mistake was that I inverted the conversion. Where a cubic power was due (cubef(x)) I've made it a cube root (cbrtf(x)). I'll revert this gross mistake and you'll see that things will work better and faster :)

nb. the optimized cbrtf(x) is 4 times faster than IEC_Scale(log10f2(x)) and the result difference is negligible under the problem at hand IMO.

[UPDATE:] qtractor-0.4.1.1328 (cvs) has it fixed; still not tested tho.

Seeya

I'm sorry. Its still not working ... maybe we should slow down ... ;-)

rncbc's picture

You're right. Prior version was correct but a misplaced parenthesis made all the difference. Try again, please, qtractor-0.4.1.1330 is new in CVS HEAD :)

[UPDATE:] Also scrapped that custom cbrtf(x) optimization as it was being botched by g++ -O2 :(

[UPDATE2:] Un-scrapped back again as cbrtf2(x), now avoiding strict-aliasing by g++ -O2 (marked as qtractor-0.4.1.1331).

Cheers

Oh no... now I'm really sorry. When I tried things out with IEC-Scale, I ran into the same problem with the paranthesis. If I had known that this mistake has been there before, I would have told you! Sorry for that! I will try things out...

Hi Rui,
tryed out last revision. Everything works fine! Great! A really good approach of the IEC scale thing. Maybe you should take this for the VU values also, to save some time?

Just a small addition:
In file qtractorMidiControl.cpp I added two lines after line 327
if (fValue > 1.0) fValue = 1.0;
if (fValue < 0.0) fValue = 0.0;
to make sure that the audio level higher than 0.0db are just cut up. The same works for TrackPanning command.

and a last change to get rid of some debug messages which are slowing down the system in file qtractorMainForm.cpp after line 1299 I commented out the appendMessages() with an #ifdef CONFIG_DEBUG

Last but not least a small issue:
When I open a session, all the controllers should be sent out? Or what do you think? I don't know when, exactly, but I think when a session is loaded, all the controllers have their defined values and could be sent out. I also think, when we come to an implementation with automation, the controller should also be sent out if its changed by automation...

rncbc's picture

take this [cubic approach] for the VU values also, to save some time?
yep, maybe, however the IEC (logarithmic) functions must be retained nevertheless, as the dB values have to be displayed and converted still (think of audio gain spin-boxes entry value...).

open a session, all the controllers should be sent out?
what, aren't they? it should be sending all feedback controllers on session load, for every session track eg. look for qtractorMidiControl::sendAllControllers() usage in qtractorMainForm.cpp ... if that isn't really effective please do complain (works for me might not be enough;)

Cheers

Hi Rui,
Just a heads up.....I'm seeing the same thing. I loaded a project, did a quick and dirty mix, saved it, closed qtractor, pulled all the BCF's faders to zero, reopened qtractor, and the project. The mixer's faders stayed at 0.

Qtractor should send a "feedback" update to the BCF on a project load, but it does not do so.....at least on this system.

Thanks,
Lexridge

rncbc's picture

Ok. It makes two :) I'll get to look at what's wrong with my setup that makes it work right ;)

[UPDATE:] I guess the reason why's not working for you is that all controllers state are being feedback _before_ the MIDI control bus gets properly (re)connected outboard. I wasn't experiencing this issue that often because I do have a QjackCtl patchbay rule to keep all connections independently from Qtractor session reloads, so that control buses are already connected at the time controller feedback mappings are sent out. However, I must confess, this was working just due to a combination of factors: sheer luck and a fast machine (quad-core:)). Got that fixed, hopefully enough, on CVS now (qtractor-0.4.1.1334+).

Seeya

Hi Rui,
today, I found some minutes to test newest version (qtractor-0.4.1.1340, i think). Controllers are working fine. Nothing left at the moment ... great ... can't await to get some automation *ggg* ...
cheers
gizzmo

rncbc's picture

@gizzmo

Awesome! I guess we're ready for a next dot release, commit up ... :)

Cheers

Yeah, really great!
(May I ask a short question: I stumbeled over the native linux plugins called jucetice: How can I use them with qtractor? Just copy the .so file to where? Sorry, i think I'm just stupid at the moment .... if the answer takes longer, i should create a new thread...)

rncbc's picture

Yep, it's just copying the .so alright, most of them at least, into pre-configured directories:

- native Linux VST plug-ins (.so) should be searched under the directories given on the View/Options.../Display/Plugin Paths dialog (defaults to /usr/local/lib/vst and /usr/lib/vst, which you have to create yourself as aren't by distro default, or in VST_PATH environment variable. However the latter option is well deserved to:

- foreign Windows VST plug-ins (.dll), as wrapped by DSSI-VST through WINE, are found by proxy in the directories given by the VST_PATH environment variable only.

Cheers

Hi Rui,

you didn't take this into code, did you?
Just a small addition:
In file qtractorMidiControl.cpp I added two lines after line 327
if (fValue > 1.0) fValue = 1.0;
if (fValue < 0.0) fValue = 0.0;
to make sure that the audio level higher than 0.0db are just cut up. The same works for TrackPanning command.

The problem is, that if the gain value of an audio track is higher than 0.0dB, the MIDI controller gets wrong values... I think we could just cut up values over 0.0dB. I think, the check for the overun now has to be after line 306, and the same after line 368. What do you think?

rncbc's picture

That kind of check has been moved to central qtractorMidiControl::sendController(), lines 409-417, although there the capping is in the integer domain.

Is there something wrong with it?

Cheers

Ups. Forget it. It's working perfect. I wrongly started an older version... The only issue that is left, is, that sometimes, the midi controllers are not updated and sent out when they should. But this problem is not yet re-produceable for me. If I can show a step-to-reproduce i'll contact you... ;-)

rncbc's picture

Feedback MIDI controllers are only updated/sent out at particular occasions: on session load or when you change any connection from any MIDI output buses and even though the latter does get deferred in effect to only when you start playback later. Also, an immediate update is issued when adding new tracks, removing existing ones or generally rearranging track order.

Take care.

rncbc's picture

(Sorry for the delay, summertime is rushing :)

FST would bring a heavy new dependency to Qtractor: WINE. Something that I won't be that happy to carry on my own, at least overnight ;) However I'll keep it on my thoughts.

BTW, there's this very basic/native VST stub application, vst_test-0.9.tar.gz, that may be taken as testbed, more like a bare-bones cradle, to let you start hacking a FST-Qt4 host interface. Anyone for the grabs? :))

Cheers.

Hi Rui,

yeah, I forgot about the WINE dependency. That's really heavy...

Hopefully we find someone, to do this work. Unfortunately my time is very limited, as work is getting harder and harder... and at the moment, I'm playing a little bit with the GUI for automatic tracks .... but still, nothing to present in the next days...

regards

Pages

Add new comment