Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
64 bit MFX and DXi development: Where do I start?
Since I *finally* got a 64 bit PC recently, it looks like I can start the long overdue process of porting my plugins from TenCrazy.com However, it appears that Cakewalk's DXi2 SDK was last updated in January 2003, as provided here: http://www.cakewalk.com/D...e/article.aspx?aid=112 As such, I have my doubts that this SDK is compatible for x64 platform builds! So where do I start? I can certainly grab a newer version of the general DX SDK that knows about multiple architectures, but I dunno about the DXi/MFX stuff. So how does Cakewalk do it these days? Or are the MFX plugins in SONAR X# really just VST MIDI these days? Heck if I know, I still run SONAR 8.5 (32x) for my own production... Anyone have a sample project they could share? - m
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2012/12/17 00:13:23
(permalink)
Ah, fantastic: and the forum pulls out all the line breaks now. Looks like many things have changed during my absence... and not necessarily for the better! - m
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2012/12/17 16:48:45
(permalink)
I have been using Sonar X1 for about a year now, and have hit a point where the default midi editing just doesn't cut it. I explored CAL, and have determined that it would be very painful to do what I want in a programming environment that doesn't support user defined functions, arrays, or floating point data. I naturally turned to MFX as the preferred way to go, but have been a bit surprised by the SDK. Visual C++ 6.0. Seriously? I managed to get the MFC MFX project to compile under 2008 (after disabling the MakeHelp code), and with minor tweaks, had it compile without errors for 64-bit. I'm sure that I'm naive to think that I can just change the target platform to 64-bit and cross my fingers, but I have no knowledge of what else would have to change. I have not been successful in getting 64-bit X1 to take note of the registered dll. It would seem that extensibility of MIDI functionality is pretty low on the request list for the average user.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2012/12/17 17:45:57
(permalink)
I installed the free VS Express 2012 the other day, and it seems to target x64 as well, so we'll see if it will do the trick. VC++6 served me quite well over the years, but this is probably a jump that it's incapable of making! I'll post a skeleton project if I get something working. I'm kind of wondering if Cakewalk will sort of let MFX die off without updates, like it did with CAL.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2012/12/19 03:01:21
(permalink)
If I get something working first, I'll post it too. Presently, I'm not having a great deal of success. I spun up a 32-bit VM with XP, Visual 6.0, and an older copy of 32-bit Sonar. It took a bit of fiddling, but the MFX demo builds and works in Sonar. I've tried a variety of configurations under VS 2008, but even when I get a clean build targetting 32-bit, it won't register on my 32-bit VM. If I can figure out how to get past that issue, then I can return to targetting 64-bit.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/01/22 19:34:30
(permalink)
I'm giving up. I put in an enhancement request for a 64-bit SDK, but I'm not holding my breath.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/01/26 10:39:26
(permalink)
Thanks for trying, and for submitting the request. I think I'm giving up as well until we can get an experienced hand to put up a demo project! - m
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/01/27 22:38:22
(permalink)
Please consider putting in your own request. A bit more noise couldn't hurt.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/02/02 14:16:42
(permalink)
Well, I tried to send them a message via their "Developer Support Contact Form", but it results in an error message. THIS IS REALLY FRUSTRATING, AND PERHAPS REPRESENTATIVE OF CAKEWALK'S RELATIONSHIP WITH DEVELOPERS THESE DAYS. I'll try to send the message to another email and hope it gets through to someone, eventually. The main text of it follows for posterity. - m ********************* I believe that better support for MFX developers is needed if the standard is going to survive. The Cakewalk DevXchange ( http://www.cakewalk.com/D.../article.aspx?aid=115) is woefully out of date: it refers to Cakewalk Pro Audio 8 as the example product! Two whole product generations later, we've yet to get an updated SDK or example projects. This makes it problematic to update my somewhat popular free 32-bit MFX offerings ( http://www.tencrazy.com/gadgets/mfx/) to 64-bit platforms, which I've yet to figure out since buying a more modern PC. In searching for help, I've only come across one other developer in the same situation as me, looking for help on the Cakewalk Dev Forum when none is to be found. Are you going to let MFX die on the vine like CAL did? If so, I might as well give up on it now and use the time and money towards moving to another DAW with more flexible MIDI APIs. As stands, I never upgraded past SONAR 8.5 Producer, as it didn't seem that you were interested in supporting VST MIDI modules, either. It's a shame to allow potentially great tools like CAL and MFX to decay into obscurity, but it's perhaps even a crime not to replace them with something more modern. SONAR should remain a powerhouse in the MIDI department too, not just for multitrack audio. If all you're looking to do these days is ape something like Pro Tools, I'm afraid I'm just not that interested. - m
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/02/02 14:39:34
(permalink)
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/02/19 01:11:29
(permalink)
Thank you for posting your own request. We shall see what comes of it. In looking for better extensibility, I spent a week playing with Reaper. However, I decided that I wasn't interested in porting a year's worth of projects to another DAW just yet. I considered copying MIDI data back and forth between Sonar and Repear, but that was a nightmare. Ultimately, I'm most interested in leveraging an interpolation library I wrote in c++ a number of years ago. I want to control phrasal rhythms in a way that I have yet to witness in any plugin or the pre-baked functionality. I was prepared to port my library to another language if need be, but I've now progressed to going down scary paths to get the functionality I'm after. Unless a 64-bit SDK magically appears before I get going, in a few months, I'll be building three things to word in tandem: 1. a Windows Forms app from which I can compute my interpolations 2. a CAL program to apply my interpolations 3. a macro (haven't chosen the tool yet) to envoke the Cal program and supply it with the interpolation coeficients. Fortunately, I've worked it out so that no values need to be shuffled from Sonar to my app. It's a one way data path. Most of the floating point math will be conducted in the forms app, thus getting around the lack of such functionality in CAL. All remaining "floating point" math will actually be done using oversized integers in CAL. The final computation in CAL will be a division by some sensibly chosen factor to acquire the final value. If the kluge works, you can bet that I'll be simultaneously ashamed and proud. Cheers
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/02/19 01:13:43
(permalink)
Oh, that's right... no line breaks allowed. Well, I supposed that's safer than unescaped text.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/02/19 01:16:10
(permalink)
I just tried to submit a reply containing break tags, but was brought to a rather alarming page: "An exception has been thrown on the page you are trying to access. The error has been logged and the site admin will take the necessary action to prevent such error." I guess they don't want me to do that.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/11 17:20:01
(permalink)
Colin, I finally wrote to Frank (of http://www.midi-plugins.de/), who said that he didn't have to do anything special to get things compiled under 64-bit, and that the MFX SDK used is still the old one. His response is pasted below. I will try to get this compiled again soon! - m "Providing a 64bit MFX-plugin is rather easy. You do not need a special SDK (and BTW, there is none). All you need to do is to compile your plugin project as 64 bit. I guess you are using Visual Studio (2010/2012)? From the "Configuration Manager" set up a new platform (x64) for you project and build the project. You will probably have to fix a couple of warnings and errors but that's not a big thing. Finally with the resulting dll you have to do the same with the 32bit version, register it to make it available in the 64bit Sonar version. This is all I am doing for the 64bit version of by plugins. 32 and 64 bit version compile from the same source code."
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/15 02:20:32
(permalink)
Hi Markleford, Thank you for continuing to prod. Many months ago when I was trying to get this to work, I was unsuccessful at getting a clean compile under VS 2008. I was modifying the demo project from the SDK. We're running VS 2013 Ultimate at work now, so maybe I'll give it another go in my off hours next week. This is exciting news that someone has it working. Being able to build an MFX plugin will save me a great deal of hassle. Fortunately, I've fallen miles behind on my music project, so I'm not yet champing at the bit to write the supporting code.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/15 14:05:13
(permalink)
VS 2012 U, I mean - not 2013.
|
b rock
Max Output Level: 0 dBFS
- Total Posts : 8717
- Joined: 2003/12/07 20:31:48
- Location: Anytown (South of Miami), U.S.A.
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/15 20:11:38
(permalink)
☄ Helpfulby colinjamieson 2013/08/19 03:01:56
Markleford: Thanks for your dogged determination in getting your MFX to 64-bit. For a time there, no one appeared to be listening. Your plugins (and Frank's) have been real problem-solvers for me ever since you released them. I don't know of many working alternatives (outside of MIDI Solutions' hardware boxes). I was even able to get some of them to 'print to track' using the virtual MIDI cable workaround. If you're in the market for any ideas on the next one, I'd love to see an 'event processor' for converting one MIDI message to another. CC Map on Steroids. I realize the difficulties in converting the first data byte to the second (MIDI notes to CC messages, for example, or double-precision pitchbend to CC). To my knowledge, no one has ever tried combining MIDI notes and a CC message (or channel AT) to produce polyphonic aftertouch, either. Just wishful thinking there. I'd be happy to see the existing TenCrazy MFX in 64-bit. Thanks again.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/16 14:06:52
(permalink)
I'm running into some DirectX challenges. Despite there being no true MFX SDK, Am I right in understanding that I need the DirectX SDK to get a clean compile? I can't remember where I heard it, but I seem to recall that there's some old version of the DirectX SDK that needs to be used since the latest and greatest has deprecated features utilized by MFX. MS doesn't seem too keep on giving download access to the old DirectX SDKs.
|
SuperG
Max Output Level: -63 dBFS
- Total Posts : 1371
- Joined: 2012/10/19 16:09:18
- Location: Edgewood, NM
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/18 01:52:00
(permalink)
☄ Helpfulby colinjamieson 2013/08/19 03:01:35
FWIW, I tried building the sample project using the MFX sdk under VS 2010, no problems. I've been avoiding VS 2012...
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/19 03:01:15
(permalink)
@SuperG I can get a clean build of the SDK MFX sample under Visual Studio 6 (32-bit), the dlls register, and the plugins are visible in sonar. Under Visual Studio 2008 (also 32-bit), I had to make modifications to get a clean build (largely related to commenting out code for the antiquated help file system), the dlls appeared to register, but the plugins never became visible. 64-bit under Visual Studio 2008 had the same issues. I'll try VS 2010.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/21 09:57:57
(permalink)
More guesses from Frank: "Well, I can not tell if VS Express is sufficient. I use VS Ultimate for the development." So I suppose I'll have to still determine if I have to upgrade. "Registering the plugins is straightforward. What I do for development purpose: regsvr32 /s DeleteDoubles\x64\Release\DelDoubl.dll" So nothing special there. "I do not link any DirectX libraries or include any. This is not necessary. There is an old MFX_wizard in Cakewalk's SDK. Use this one for midi plugins; then no DirextX libs are required." I actually think that my plugins are based off the MFX_wizard code. In fact, I wrote my own wizard to put in my own basic framework that I use for everything, so perhaps that is my problem! This topic has been downgraded on my priority list, so I haven't been working actively on it. And @b_rock, I guess we can give that poly-aftertouch idea a try if I manage to get it working again! Best, - m
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/23 13:53:29
(permalink)
I fired up a pile of virtual machines and I made some progress using the sample projects from the sdk. There are two projects related to MFX, one using MFC, and the other using the raw win32 API. There is also the wizard Markleford mentioned, but I haven't dived into that yet. I replicated all 32-bit steps in both VS 2008 Pro and VS 2010 Pro. From project manager, I delete the .hpj file and the entire help directory. Once this is done, I can get a 32-bit build without errors (but with tons of warnings). With one exception, the dlls register, and are visible in 32-bit Sonar. Oddly, with the MFC project, the debug dll produced by VS 2010 fails to register, even though the release dll works just fine. All dlls produced by VS 2008 worked without issue. I attempted a 64-bit build of the win32 API project in VS 2010 (my 2008 environment wasn't configured to handle 64-bit builds.) I was alerted to a couple errors that were fixed by using non-deprecated versions of api methods and constants. Once this was done, the build was about as clean as the 32-bit one (still lots of warnings about deprecated str copy methods). I was able to register the 64-bit dll using regsvr32 as always, however, the plugins would not appear in Sonar X2. I went digging in the registry, and found that the dll registration was only partially complete. It was missing a required entry under Cakewalk. If I can get the plugin working by manually adding the missing registry entries, then I'll take a closer look at the registration code in the project tonight. Thank you again Markleford for your input and consultation with Frank. It gave me hope that this might actually be possible and that the solution might be something straight forward.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/24 00:52:34
(permalink)
When I manually populate the registry, the 64-bit plugin becomes available in 64-bit Sonar. Obviously something is broken in the project code for registering the control via regsvr32. Unfortunately, even though I can add it to the FX chain on a MIDI channel, I can't get the plugin GUI to appear. I guess I need to start cleaning up the warnings in the project build. I'm definitely much closer now than I ever managed to get back in February.
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/24 00:52:42
(permalink)
When I manually populate the registry, the 64-bit plugin becomes available in 64-bit Sonar. Obviously something is broken in the project code for registering the control via regsvr32. Unfortunately, even though I can add it to the FX chain on a MIDI channel, I can't get the plugin GUI to appear. I guess I need to start cleaning up the warnings in the project build. I'm definitely much closer now than I ever managed to get back in February.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/24 10:39:44
(permalink)
That's progress, at least! Great to hear!
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/25 03:53:16
(permalink)
☄ Helpfulby colinjamieson 2013/08/25 14:06:20
Problem sufficiently solved! I figured out why the plugin GUI wasn't appearing. As those of you who have created your plugins probably already knew, there are two GUIDs that need to be added to the registry - not one. If I manually populate all required registry entries, the plugin works. So, I was left with trying to figure out why regsvr32 is failing to actually register the dll, even though it reports success on completion. I learned something new today - how to examine a dll in debug mode while regsvr32 is executing. In function setKeyAndValue, I found that the result from RegCreateKeyEx was ERROR_ACCESS_DENIED. Also, function DllRegisterServer (which is called by regsvr32) returns S_OK no matter what happens - thus the outcome of regsvr32 always reporting success even when it fails. Much online searching suggests that the crux of the registry issue has nothing to do with 64-bit, and everything to do with how Windows changed its registry editing access requirements starting with Windows Vista (I'm running Windows 7). I have a working, but not so satisfying solution. First, I took Markleford's lead from his Ten Crazy deployments, and used a .bat to call regsvr32. It worked fine in all Windows XP 32-bit scenarios. Even under Windows 7, I get a success message, but as mentioned above, it's deceptive. Next, I tried right clicking the .bat and selecting Run As Administrator. Unfortunately, when you do this, the working directory changes from being whatever folder the .bat and .dll are in to being c:\windows\system32, and then it complains that it can't find the .dll. My solution for now is to reference the .dll with a static path inside the .bat. This is the unsatisfying part - it works, but the .bat needs to be edited if you want to put the .dll in a different directory, and you need to explicitly "run as administrator." So, the sufficiently final solution to get everything working in the two sdk projects "MFCSample MFX" and "Sample MFX": (these directions might be a bit specific to the sdk projects, but hopefully this will be helpful to anyone running into trouble with their own projects) - Open the solution in Visual Studio 2010 Professional (I welcome someone else to try this with the Express Version)
- Agree to convert the project from Visual c++ 6.0 format to VS 2010 format.
- Agree to permanently remove version control bindings
- If you want to preserve your help system, you'll have to convert it to something more modern - good luck. Otherwise: from Solution Explorer delete:
- the .hpj file
- the entire Help Files directory
- Within the solution, select the project, and use the Configuration Manager to change the Active solution platform from win32 to x64.
- You'll now have to fix any broken deprecated items. For both projects, I only found errors in the Property Page code, but the errors were different in the two projects.
- MFCSample MFX: In files MFCSamplePropPage.h and MFCSamplePropPage.cpp, the return type of the callback function DialogProc needs to be changed from BOOL to INT_PTR.
- In Sample MFX: In file PropPage.cpp, function CPropPage::StaticDialogProc, change:
- SetWindowLong to SetWindowLongPtr
- GetWindowLong to GetWindowLongPtr
- The two instances of DWL_USER to DWLP_USER
- Rebuild and ignore the warnings if you dare. Almost all of the warnings have to do with string copy and concatenation functions. The deprecated versions have no bounds checking and allow buffer overflows, whereas the new versions perform bounds checks. However, when has a buffer overflow ever caused any trouble... :) points finger at the Morris Worm
- The sdk projects are configured to automatically register the dlls. However, the registration will fail due to the permissions issue.
- copy the .dll from the debug or release folder (as the case may be) and stick it in C:\Program Files\Cakewalk\Shared MIDI Plugins\
- Create a .bat file in the same directory, and put the following line inside of it (replacing MyPlugin.dll with the actual name of your own plugin):
- regsvr32.exe "C:\Program Files\Cakewalk\Shared MIDI Plugins\MyPlugin.dll"
- Right-click on the .bat file and select "Run as administrator"
- Rock and Roll
If anyone can identify an elegant way to elevate permissions and remove the need for a static path in the .bat, then I'm all ears.
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/25 10:34:22
(permalink)
Wow! Excellent detective work! Congrats! NOW... Are you willing to share a working plugin project (just the SDK's Sample MFX is fine) so that I can check if it can compile and register under Express?
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/25 14:00:16
(permalink)
Absolutely. Where's the upload button?
|
Markleford
Max Output Level: -87 dBFS
- Total Posts : 173
- Joined: 2003/11/11 10:24:11
- Location: The Beach, FL
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/25 15:09:12
(permalink)
|
colinjamieson
Max Output Level: -90 dBFS
- Total Posts : 24
- Joined: 2012/12/17 16:38:38
- Status: offline
Re:64 bit MFX and DXi development: Where do I start?
2013/08/25 16:27:25
(permalink)
I don't have enough street cred on this site to send a private message, so I emailed it to you.
|