Jump to content

Logic Pro Environment - How to convert MIDI Notes to CC messages


pedromorales

Recommended Posts

Hi,

Hope you can help!

1/ 

I'd like to use Logic Pro X to control my Korg Volca Sample to play melodies using the loaded samples.  

Korg Volca Sample can sort of play different pitches of the samples by changing its "speed" parameter. This speed parameter varies from -63 to +63, with zero being essentially the natural pitch of the sample. The pitch varies roughly over +- 2 octaves each way. One can control the speed parameter using MIDI by sending a CC message (CC43), with a value ranging from 1..127. 

I think 

MIDI CC43 Val = 1 maps to Speed Value = -63 (roughly two octaves down from the original sample pitch)

MIDI CC43 Val = 64 maps to Speed Value = 0 (original pitch of the sample)

MIDI CC43 Val = 127 maps to Speed Value = +63 (roughly two octaves up from the original sample pitch)

 

What I'd like to do is to be able to play C3 note in Logic and for this to be translated/converted as a Midi message corresponding to CC43 message with a value = 64.

And for the following notes to be translated continuously over four octaves, with each C being as follows:

C1 -> CC43 Val = 1 (it'd be 0 ideally, but I can live with 1 instead)

C2 -> CC43 Val = 32

C3 -> CC43 Val = 64

C4 -> CC43 Val = 96 (from experimentation 32 steps roughly correspond to an octave on the Volca, so each semitone is roughly equal to 8/3rd of a step, i.e. 2.67). 

C5 -> CC43 Val  = 127 (because there's no 128 value - that's fine, I can live with it)

 

I believe this can be done using the Logic's Environment, but I have completely no idea how to even go about it. I've never sed the Environment before 

Any help would be very appreciated! 

 

2/ 

Also, I'd like to convert the Note Velocity value from Logic to Midi message CC7 (corresponding to "Level" knob on the the Volca). Note Velocity 1..127 simply mapps to CC7 1..127 values. 

 

thanks

Link to comment
Share on other sites

Firstly apologies if this doesn't make any sense. I find it quite hard to explain. Someone else might be able to do a better job.

 

The Transformer can transform note on/off events to controller events but I've found it a bit buggy. I've also only used it to transform sequenced MIDI data (ie. not in the environment for events 'on the fly').

 

Essentially, in the top row, you set up the Status to = NOTE then below choose 'Fix' and 'Control'. This will transform any incoming note events into controller events. The Transformer doesn't seem to give you options for NoteOn and NoteOff so it tends to create events for both.

 

The Pitch parameter is the 'first data byte' (which for a control change event corresponds to the CC number) so under 'Pitch' you'd set your condition to 'Fix' and the number to 43. This will assign any incoming pitch number to 43 (the first data byte of the CC event you want to send)

 

You'll also want to use the original Pitch numbers to determine the CC values (CC value is the 'second data byte') so you need to click the blue line under the Velocity (data byte 2 for a Note event) parameter until it connects to the data byte 1 parameter. This will route the original Pitch number to your CC value.

 

Once this is set up you will have to work out the operation on the pitch data to get it to map to your CC values in order to get the pitches you want. It will be probably some sort of scaling/adding I imagine - or you could choose 'Use Map' and just draw your own map in the blue bars at the bottom of the Transformer window.

 

Unfortunately Transformer is not the most intuitive tool in Logic. It hasn't been updated in a long long time and it takes quite a bit of getting used to. I also don't know how buggy this will be. It always seems to take a bit of messing around before it works properly for me. Overlapping notes seem to cause a bit of chaos because of it creating CC events for both NoteOn and NoteOff.

 

 

 

 

Edit: After having written all that it occurs to me that to transform MIDI on the fly it might be a lot easier setting up an External Instrument and using the 'Modifier' MIDI plugin.

Link to comment
Share on other sites

Thank you Multiman2 for the answer. 

Since I'm trying to convert MIDI notes to CC43 messages on the fly, I think MIDI Modifier option might be the easiest. The only caveat is that there's no CC43 (actually CC33-62 appear to be missing from the select menu). 

How about using Scripter to do the job? It seems like a much more straightforward way to convert MIDI messages than using the Environment. 

Does anyone have any experience writing scripts and can help? Thank you in advance

Link to comment
Share on other sites

I would 100% go the scripter route, i thought about doing it in the past for my Korg Sample, although there is a piece of hardware which can do this, i'm sure you're already aware however:- https://www.retrokits.com/rk-002/

 

Never got round to doing it, shouldn't be too hard to do at all.

 

If i get a chance, i'll try and create one later if you don't succeed.  Just load up some of the sample scripts and you'll get a rough idea on how to create them, there's some tutorial presets already there.

Link to comment
Share on other sites

Hi all

Decided to give the script a shoot. 

Here it is...

It turns out that Korg Volca Sample tracks fairly evenly over +- 2 octaves, and then it deviates, which is why there's a bunch of IF Statements for the various note ranges.

 

//Korg Volca Sample helper

// Allows for playing melodies on the Volca Sample by remapping MIDI Note events 

//  into CC43 messages which can control the Speed knob on the device.

// Also, maps Note Velocity to Level knob on the Volca. 

                                             

function HandleMIDI(event) {

 

 

    //if event is Note

    if(event instanceof NoteOn) {

 

        var cc = new ControlChange; //create a CC object

        

       

// Convert Note Velocity to CC7 message corresponding to "Level" knob 

cc.number = 7;

cc.value = event.velocity

cc.send();

 

// Convert Note pitch to CC43 message corresponding to "Speed" knob

cc.number = 43;

 

if (event.pitch >=84) {

cc.value = 112 + ((event.pitch - 84) * 8/12);

}

if (event.pitch >=72 & event.pitch < 84) {

cc.value = 96 + ((event.pitch - 72) * 16/12);

}

if (event.pitch >=48 & event.pitch < 72) {

cc.value = 64 + ((event.pitch - 60) * 32/12);

}

if (event.pitch < 48 & event.pitch >= 36) {

cc.value = 32 + ((event.pitch - 48) * 16/12) ;

}

if (event.pitch < 36) {

cc.value =  (16 + ((event.pitch - 36) * 8/12)) ;

}

cc.send();

cc.trace();

 

event.send();

event.trace();   

}                         

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...