Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
MIDI Aftertouch only in debug but not in release mode
No permission to create posts
October 1, 2013
4:25 pm
Avatar
Peter
Member
Members
Forum Posts: 41
Member Since:
September 12, 2013
sp_UserOfflineSmall Offline

Hi Will,

when I compile my project in release mode there is no more MIDI aftertouch. In debug mode no problem. I watch aftertouch with a VU and process it later on. Code is:

bool __stdcall CMultiMoogA::midiMessage(unsigned char cChannel, unsigned char cStatus, unsigned char
cData1, unsigned char cData2)
{
cMIDI_Status = cStatus;
if (cMIDI_Status = 0x0A) // Status $A = aftertouch
iMIDI_After_Touch = (int)cData1; // read data
m_fM3Value = (float) iMIDI_After_Touch/128;
return true;
}

What goes wrong ??

regards
Peter

P.S. if you do a new version, don't forget to put a C before the new Object name in line 69 RackAFXDLL.cpp .

October 1, 2013
4:35 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

I am not sure why aftertouch would care about debug or release mode but I will also check this.

The C before a class name can be controlled by the setting in View->Preferences; if you turn on Hungarian Notation (bottom of panel) then the C gets added. If not, the C is left off.

- Will

October 1, 2013
4:52 pm
Avatar
Peter
Member
Members
Forum Posts: 41
Member Since:
September 12, 2013
sp_UserOfflineSmall Offline

I checked it again, my condition above (if (cMIDI_Status = 0x0A)) is always true. So I replaced it with:

bool __stdcall CMultiMoogA::midiMessage(unsigned char cChannel, unsigned char cStatus, unsigned char
cData1, unsigned char cData2)
{
iMIDI_Status = (int)cStatus;
if (iMIDI_Status == 208)
{
iMIDI_After_Touch = (int)cData1; // my breakpoint in debugger
m_fM3Value = (float) iMIDI_After_Touch/128;
}
return true;
}
but this makes no difference. In the debugger you see the data values increase if aftertouch is increased (breakpoint). In release mode no aftertouch. Thanks for the Hungarian Notation hint.

Peter

October 2, 2013
4:02 pm
Avatar
Peter
Member
Members
Forum Posts: 41
Member Since:
September 12, 2013
sp_UserOfflineSmall Offline

I found the reason for my problem:

m_bWantAllMIDIMessages was not set explicitely, in debug mode it seems to be true by default in release mode false. I set it true in plugin.cpp and everything works.

But it does not make a difference if I put Hungarian Notation on or not, if I save as a project a C is never added.

Everything else works great !

regards

Peter Wink

October 2, 2013
9:08 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi Peter

First, you definitely need to set the want MIDI flag true, but normally you do this in your plug-in's constructor, not in plugin.cpp (though it technically makes no difference). And RackAFX does not know (or care) if your plug-in is compiled in release or debug mode.

Secondly, I may have misunderstood your question about the "C" before a class; are you using the "Save Project As..." menu item? If so, it will not change the name of your plug-in class, only the project folder and project name. There are too many problems with trying to modify object names.

So, with hungarian notation ON, a C is added to your project name automatically to generate the C++ class name (ie you name your project Synth and the C++ object is named CSynth). And with it OFF it just uses the project name as the class name. But with Save Project As this should not change anything. Are you using Save Project As..?

Thanks,
Will

October 3, 2013
7:55 pm
Avatar
Peter
Member
Members
Forum Posts: 41
Member Since:
September 12, 2013
sp_UserOfflineSmall Offline

Hi Will,
yes, I should have remembered the MIDI flag but because the debug worked, I forgot it..Cry. I have set the flag now in the main constructor as you told, this makes much more sense.
The C problem:
I allways use "save as" when I make a significant modification to my projects - to be on the save side. My default setting was allways "Hungarian notation on". Independant of the hungarian notation the resultsof "save as" is:
original project:
CPlugIn* pOb = new CTestA(); // *** Line 69 RackAFXDLL.cpp
CPlugIn* pOb = new CTestA; // *** Line 82 RackAFXDLL.cpp // for VST Plugin if used
"save as"
CPlugIn* pOb = new TestA(); // ***
CPlugIn* pOb = new TestA; // ***

I have three more questions, if you have time, I would be happy about an answer:
1) Is it possible to use a user background pattern for the plugin GUI ?
2) Is it possible to "mis" -use the LCD Display as display for the currently selected fader to show the fader value ?
3) I use the Moog 4Ladder filter as filter in my Synth. If you change the filter setting (e.G with an Envelope Generator) sometimes there is a kind of klick in the filter. Is there a trick with initialising to prevent this??

regards

Peter

October 3, 2013
11:00 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

OK gotcha - yeah that's right; save as does not put the C there and I will add this to the next rev too - thanks for reporting it. As for the other questions:

1) no, you can't have a user background because the backgrounds are precompiled in the lib I wrote to do the translation. Remember that the graphics information/GUI is embedded in your DLL. I would have to store your BMP data in an array in the plug-in before compiling and I have not yet added this.

2) you currently can not send strings to the LCD though I have thought about this.

3) Unless your EG has a discontinuity or other fast changing transient there should be no click. First make sure you are not exceeding the limits of the filter so that it isn't temporarily blowing up. Next make sure you EG curve is absolutely correct; recently I was implementing an EG that sometimes exceeded 1.0.

Will

October 5, 2013
6:50 pm
Avatar
Peter
Member
Members
Forum Posts: 41
Member Since:
September 12, 2013
sp_UserOfflineSmall Offline

Hi Will

I found a solution for my question no. 3 (above). I used the MoogLPF (4ladder). Now I replaced this filter by 2 cascaded Moog Ladder2 filters and the problem is gone. I do not understand this really, but may be it is due to the more uncritical impulse response of the 2 ladder filter. The problem occured mainly with higher Q, short attack/decay and soft sounds like triangle wave.

I have another question regarding the PolyBLEP. In the routine is the variable: float dHeight. It is 0->1. Let us say you define a discontinuity as discontin = abs( x(n) -x(n-1)) of 2 sequent sample values with 1 at maximum level range (e.g. -1/+1) and you say if discontin > mycriticalLevel then I do the PolyBLEP.
Then you should be able (if you do not care about the time needed to do this) to handle any Wavetable. Is this right?

kind regards

Peter

October 8, 2013
10:16 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

HI Peter

Yes, that should work for polyBLEP and wavetables.

Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143