Old 04-04-2017, 04:43 AM   #1
paulprovost
Human being with feelings
 
Join Date: Mar 2017
Posts: 5
Default csurf plugin on osx - How do I start?

Hi all,

I'm looking to write a small csurf plugin for a simple hardware controller (well, it does complex things, but the hardware is quite simple) and I was wondering what people recommend for starting. I was looking at this https://github.com/elanhickler/MyReaperPlugin and the quneo one (https://github.com/pib/reaper_quneo), but the first seems overly complicated and the second does not compile for me on macOS.

Oh yeah, I'm developing on macOS, so an xcodeproj is important.

Anyways, I'll keep digging through MyReaperPlugin, but if you guys have any advice, I'd really appreciate it!

Thanks in advance!

Paul
paulprovost is offline   Reply With Quote
Old 04-04-2017, 12:50 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

MyReaperPlugin is not intended to be a control surface plugin, so it's not a good starting point to look at.

You could look at the official Reaper SDK as that has actual control surface implementations but unfortunately that doesn't have XCode projects included for the CSurf plugin...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-05-2017, 03:38 AM   #3
paulprovost
Human being with feelings
 
Join Date: Mar 2017
Posts: 5
Default Almost there!

Hi,

Thanks for your answer. I almost have the quneo csurf plugin compiling, but I have an error:

swell-modstub.mm:43:45: No matching function for call to 'objc_msgSend'

and I have warnings about an undeclared selector on lines 42 and 43:

swell-modstub.mm:42:41: Undeclared selector 'swellGetAPPAPIFunc'

I see that swellGetAPPAPIFunc is defined by a macro in swell.h, but I don't see that macro used anywhere. Do you have any idea on where/how I should use it?

So close...!

Paul
paulprovost is offline   Reply With Quote
Old 04-05-2017, 06:48 AM   #4
Teddy
Human being with feelings
 
Join Date: Sep 2011
Posts: 198
Default

Great work Paul.
I'm definitely subscribing to this thread, and hope that you'll share the xcode project when things are working...
Teddy is offline   Reply With Quote
Old 04-05-2017, 07:55 AM   #5
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

I was able to get the Quneo project built in XCode 8.2 by making some changes. I can't test how it runs however, because I don't own Quneo hardware.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-05-2017, 09:25 AM   #6
paulprovost
Human being with feelings
 
Join Date: Mar 2017
Posts: 5
Default

Hi Xenakios,

That s great. I think I was able to also this morning (it compiled with no errors), but I had to leave for work before I could test it. Would you mind sharing your changes? Was it only project setting, or did you have to change code as well?

Thanks for spending the time, I really appreciate it!

Paul
paulprovost is offline   Reply With Quote
Old 04-14-2017, 01:38 AM   #7
Teddy
Human being with feelings
 
Join Date: Sep 2011
Posts: 198
Default

Hi Paul,

Did you figure this out? Would you consider posting the xcode project or instructions?
Teddy is offline   Reply With Quote
Old 04-14-2017, 08:14 PM   #8
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by paulprovost View Post
Was it only project setting, or did you have to change code as well?
1) I changed the plugin to build the SWELL code instead of trying to use the SWELL functions from Reaper. (That requires changing some include statements in the source code.)
2) The Carbon framework needs to be added into the project
3) ARC (automatic reference counting) needs to be turned off

Maybe some other small things had to be changed too...

I wouldn't mind sharing the changes I did, but it's always a hassle to share when the projects refer files outside the project directory and it needs to be explained precisely where those files should be put...(In this case the WDL/SWELL files.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-22-2017, 10:18 AM   #9
paulprovost
Human being with feelings
 
Join Date: Mar 2017
Posts: 5
Default

Thanks Xenakios! Yeah, I agree that sharing files in that context is not easy. I think what fixed it for me was the location of the WDL code.

@Teddy, I pretty much succeeded in compiling the QuNeo plugin. I'm a bit foggy as to what finally made it work, but I think it was placing the WDL source one level up from the project. So I have:

reaper_quneo (the git checkout)
reaper_plugin.h
...
WDL
mutex.h
...

The WDL repository has an extra level (WDL/WDL instead of simply WDL). Then I fixed some casts and I was good to go.

The next step is the old copy and rename to make my own csurf.
paulprovost is offline   Reply With Quote
Old 04-30-2017, 06:43 AM   #10
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,184
Default

Quote:
Originally Posted by paulprovost View Post
Hi,

Thanks for your answer. I almost have the quneo csurf plugin compiling, but I have an error:

swell-modstub.mm:43:45: No matching function for call to 'objc_msgSend'

and I have warnings about an undeclared selector on lines 42 and 43:

swell-modstub.mm:42:41: Undeclared selector 'swellGetAPPAPIFunc'

I see that swellGetAPPAPIFunc is defined by a macro in swell.h, but I don't see that macro used anywhere. Do you have any idea on where/how I should use it?

So close...!

Paul
i'm getting this issue as well with OS X 10.12.4 and Xcode 8.3.2, how did you resolve it ?
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
Geoff Waddington is offline   Reply With Quote
Old 04-30-2017, 03:13 PM   #11
paulprovost
Human being with feelings
 
Join Date: Mar 2017
Posts: 5
Default

Actually, it kind of solved itself, which is not much help, I know. Might have been something with the location of WDL.

But what I realized is that both reaper_quneo and my own adaptation do not function properly. You can "Add" the control surface in the "Control surfaces/OSC/web control" section of the preferences, and it works fine, but when you select it and click "edit", the interface fields are not populated. Also, the surface does not persist when you close Reaper and re-open it.

This is probably due to some confusion in dlgProc due to the various constants inherited from MFC (if memory serves, I haven't done any MFC in 15 years...). I was about to roll up my sleeves and dig through it when a last ditch attempt at finding a better source turned up the Faderport XT csurf plugin (with source!).

Thread: http://forum.cockos.com/showthread.php?t=170036
Source: https://github.com/TheNimaj/Faderport_XT

This compiled wit some minor fixes:

- jmde/csurf/csurf_faderport.h: Commented out #include <Windows.h>
- Some other issue where the compiler was complaining about a function being redeclared with a different type. I just copied in the declaration from the .c into the .h and all was fine. Unfortunately, I can't track it down now, for some mysterious reason.
- For convenience, the original author (The_Nimaj, blessed he be for his efforts) had hardcoded a copy of the .dylib to the UserPlugin folder of his Reaper resources folder. To fix, select the .dylib target in the Products folder of your project and click on the "Build Phases" "tab" at the top. You'll see two "Copy Files" phases. Expand them and fix the paths there. There must be a better way of doing this than hardcoding the path of your home directory (like using $HOME or something), but my (limited) XCode-fu fails me here. Anyways, when hardcoding a different path, it works.

Sorry for the rambling post, but I wanted to dump all this somewhere.

This plugin has a very simple interface in the "Add" dialog, just two combos for MIDI in and MIDI out. The rest of the options are set using a .ini file, which suits me fine. But this may not be to everybody's taste.

So I'm off to rip this apart and implement my (much simpler) csurf. No offense to The_Nimaj, and much thanks for giving me this starting point.

Last thoughts: the source includes a version of WDL, which may not be the greatest idea in the long run, but, hey, it works for now.

'nuff said.

Paul
paulprovost is offline   Reply With Quote
Old 05-01-2017, 08:21 AM   #12
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 11,184
Default

Ok, was able to compile by setting "Enable Strict Checking of objc_msgSend Calls" to NO.

When I run it I get a console message : "SWELL API not found: SWELL_ExtendedAPI"

Reaper is very sluggish and demonstrates the same missing functionality as reaper_quneo and you.
__________________
To install you need the CSI Software and Support Files
For installation instructions and documentation see the Wiki
Donate -- via PayPal to waddingtongeoff@gmail.com
Geoff Waddington is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.