steverod (15) [Avatar] Offline
#1
The change you helped me with worked fine but it's hard to hear the the velocity differences. What I want to do now is exaggerate the velocity when it echos back. The base velocity will be 60 (C3). Some thing like: if (data) > 3C then (Data) = ((data-C3)*3)+C3) else (data) = ((C3-(data)*3)+(data)). I have no idea what data is called, or what I can call it. I also don't know where to put these lines. Can you help again? Many thanks.
KUMA (56) [Avatar] Offline
#2
Re: Kuma are you still there?
Hello.
How about this:

BOOL MyMidiIn:smilierocessMidiData(LPMIDIEVENT lpEvent)
{
// display the data, either as hex or trace
if(DisplayMode == RAWMODE)
DisplayRawMidi(GetOwner(), lpEvent);
else
DisplayTrace(GetOwner(), lpEvent);

if(EchoOut && ThruEnabled)
{
if(lpEvent->status == 0x90)
{
if(lpEvent->data2 > 82) EvtOn.data2 = 127;
else if(lpEvent->data2 > 41) EvtOn.data2 = lpEvent->data2 * 3 - 122;
else if(lpEvent->data2 > 0) EvtOn.data2 = 1;
else EvtOn.data2 = 0;
EchoOut->Put(&EvtOn);
}
else if(lpEvent->status == 0x80) EchoOut->Put(&EvtOff);
else EchoOut->Put(lpEvent);
}
return TRUE;
}

I have chosen 61 as base velocity.
steverod (15) [Avatar] Offline
#3
Re: Kuma are you still there?
Thanks. That work first time!
steverod (15) [Avatar] Offline
#4
Re: Kuma are you still there?
I'm having difficulty switching back to playing any pitch, but keeping the exaggerated velocities you did for me. I thought it would be easy but....
KUMA (56) [Avatar] Offline
#5
Re: Kuma are you still there?
Eliminate the declaration:

MidiEvent EvtOff;

and also these lines in the constructor:

EvtOn.data1 = 0x3C;
EvtOff.status = 0x80;
EvtOff.data1 = 0x3C;
EvtOff.data2 = 0x00;

then replace ProcessMidiData with this:

BOOL MyMidiIn:smilierocessMidiData(LPMIDIEVENT lpEvent)
{
// display the data, either as hex or trace
if(DisplayMode == RAWMODE)
DisplayRawMidi(GetOwner(), lpEvent);
else
DisplayTrace(GetOwner(), lpEvent);

if(EchoOut && ThruEnabled)
{
if(lpEvent->status == 0x90)
{
EvtOn.data1 = lpEvent->data1;
if(lpEvent->data2 > 82) EvtOn.data2 = 127;
else if(lpEvent->data2 > 41) EvtOn.data2 = lpEvent->data2 * 3 - 122;
else if(lpEvent->data2 > 0) EvtOn.data2 = 1;
else EvtOn.data2 = 0;
EchoOut->Put(&EvtOn);
}
EchoOut->Put(lpEvent);
}
return TRUE;
}
steverod (15) [Avatar] Offline
#6
Re: Kuma are you still there?
I've changed one line to:
else if(lpEvent->data2 > 41) EvtOn.data2 = (lpEvent->data2 - 41) * 4 + 41; I'm not sure what your -122 meant.

Also what does - else if(lpEvent->data2 > 0) EvtOn.data2 = 1; do?

I've been trying to exaggerate low velocities so that every velocity below say, 31 is much quieter - else if(lpEvent->data2 < 31) && (lpEvent->data2 > 0) EvtOn.data2 = (31 - lpEvent->data2) * 4 + (lpEvent->data2); with a couple of errors??
KUMA (56) [Avatar] Offline
#7
Re: Kuma are you still there?
Note that the number lpEvent->data2 * 3 - 122 is equal to (lpEvent->data2 - 61) * 3 + 61.
What I have done is multiplying the deviation from 61 by 3. When the given velocity is smaller than 41, the above formula yields a negative number; to avoid this it is necessary to put the lower limit 41 and to add the line 'else if(lpEvent->data2 > 0) EvtOn.data2 = 1'. Likewise, when the given velocity is greater than 83, the formula yields a number greater than 127, so the line 'if(lpEvent->data2 > 82) EvtOn.data2 = 127;' is needed. If you change the base velocity and the multiplying number, you need to change these lines appropriately, too.