COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > NINJAM Discussion > NINJAM Developer Discussion

Reply
 
Thread Tools Display Modes
Old 11-30-2020, 05:56 AM   #1
seeb0h
Human being with feelings
 
Join Date: Nov 2020
Posts: 3
Default How-to compile NINJAM on windows with VST2.4 SDK

Tested and it worked.

git clone git@github.com:justinfrankel/ninjam.git ninjam
install visual studio community 2019 profil c/c++

Set up ogg and vorbis
Set up the project
  • Convert ninjam\jmde\fx\reaninjam\reaninjam.vcxproj to jmde\fx\reaninjam\reaninjam.sln
  • OutputDir=$(Platform)\$(Configuration)\
  • AdditionalIncludeDirectories=$(SolutionDir)..\..\. .\sdks\libvorbis\include;$(SolutionDir)..\..\..\sd ks\libogg\include;%(AdditionalIncludeDirectories)

Deal with VST2.4
  • Get VST vstsdk366_27_06_2016_build_61
  • Move vstsdk366_27_06_2016_build_61\VST3 SDK\pluginterfaces\vst2.x\aeffect.h and aeffectx.h to ninjam\jmde\

Code:
diff --git a/jmde/fx/reaninjam/vstframe.cpp b/jmde/fx/reaninjam/vstframe.cpp
index 31dfa83..2a94801 100644
--- a/jmde/fx/reaninjam/vstframe.cpp
+++ b/jmde/fx/reaninjam/vstframe.cpp
@@ -249,7 +249,8 @@ public:
     m_hwndcfg=0;
     m_effect.magic = kEffectMagic;
     m_effect.dispatcher = staticDispatcher;
-    m_effect.process = staticProcess;
+    //2.3 m_effect.process = staticProcess;
+    m_effect.processReplacing = staticProcess;
     m_effect.getParameter = staticGetParameter;
     m_effect.setParameter = staticSetParameter;
     m_effect.numPrograms = 1;
@@ -263,7 +264,7 @@ public:
     m_effect.version=1100;

     m_effect.object=this;
-    m_effect.ioRatio=1.0;
+    //2.3 m_effect.ioRatio=1.0;
     m_lasttransportpos=-100000000.0;
     m_lastplaytrackpos=-100000000.0;
   }
@@ -442,8 +443,9 @@ public:

         }
       return 0;
-      case effIdentify:
-        return CCONST ('N', 'v', 'E', 'f');    }
+//2.3      case effIdentify:
+//        return CCONST ('N', 'v', 'E', 'f');
+}
     return 0;
   }
   short cfgRect[4];
Code:
$ git diff jmde/fx/reaninjam/res.rc
diff --git a/jmde/fx/reaninjam/res.rc b/jmde/fx/reaninjam/res.rc
index dce6c2b..6399941 100644
--- a/jmde/fx/reaninjam/res.rc
+++ b/jmde/fx/reaninjam/res.rc
@@ -7,7 +7,12 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include <windows.h>
+
+#ifndef IDC_STATIC
+#define IDC_STATIC              -1
+#endif
+

 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -342,7 +347,7 @@ END

 IDR_MENU1 MENU DISCARDABLE
 BEGIN
-    POPUP "&File"
+    POPUP "&Spiral"
     BEGIN
         MENUITEM "&Connect...\tCtrl+O",                 ID_FILE_CONNECT
         MENUITEM "&Disconnect\tCtrl+D",                 ID_FILE_DISCONNECT, GRAYED
Code:
diff --git a/jmde/fx/reaninjam/vstframe.cpp b/jmde/fx/reaninjam/vstframe.cpp
index 31dfa83..2a94801 100644
--- a/jmde/fx/reaninjam/vstframe.cpp
+++ b/jmde/fx/reaninjam/vstframe.cpp
@@ -249,7 +249,8 @@ public:
     m_hwndcfg=0;
     m_effect.magic = kEffectMagic;
     m_effect.dispatcher = staticDispatcher;
-    m_effect.process = staticProcess;
+    //2.3 m_effect.process = staticProcess;
+    m_effect.processReplacing = staticProcess;
     m_effect.getParameter = staticGetParameter;
     m_effect.setParameter = staticSetParameter;
     m_effect.numPrograms = 1;
@@ -263,7 +264,7 @@ public:
     m_effect.version=1100;

     m_effect.object=this;
-    m_effect.ioRatio=1.0;
+    //2.3 m_effect.ioRatio=1.0;
     m_lasttransportpos=-100000000.0;
     m_lastplaytrackpos=-100000000.0;
   }
@@ -442,8 +443,9 @@ public:

         }
       return 0;
-      case effIdentify:
-        return CCONST ('N', 'v', 'E', 'f');    }
+//2.3      case effIdentify:
+//        return CCONST ('N', 'v', 'E', 'f');
+}
     return 0;
   }
   short cfgRect[4];
Code:
$ git diff WDL/vorbisencdec.h
diff --git a/WDL/vorbisencdec.h b/WDL/vorbisencdec.h
index 000c3a8..0e31c6d 100644
--- a/WDL/vorbisencdec.h
+++ b/WDL/vorbisencdec.h
@@ -94,6 +94,7 @@ class VorbisDecoder : public VorbisDecoderInterface

       ogg_sync_init(&oy); /* Now we can read pages */
       m_err=0;
+      m_samples=0;
     }
     ~VorbisDecoder()
     {
@@ -106,6 +107,8 @@ class VorbisDecoder : public VorbisDecoderInterface
          ogg_sync_clear(&oy);
     }

+    int m_samples_used;
+
     int GetSampleRate() { return vi.rate; }
     int GetNumChannels() { return vi.channels?vi.channels:1; }

@@ -219,6 +222,7 @@ class VorbisDecoder : public VorbisDecoderInterface

     int m_err;
     int packets;
+    int m_samples;

     ogg_sync_state   oy; /* sync and verify incoming physical bitstream */
     ogg_stream_state os; /* take physical pages, weld into a logical
seeb0h is offline   Reply With Quote
Old 11-30-2020, 01:19 PM   #2
pljones
Human being with feelings
 
pljones's Avatar
 
Join Date: Aug 2007
Location: London, UK
Posts: 767
Default

Code:
-    POPUP "&File"
+    POPUP "&Spiral"
What's that for?

Otherwise, nicely done!
__________________
Quote:
Originally Posted by Tony Williams
...Playing fast around the drums is one thing. But to play with people for others, to listen to, that's something else. That's a whole other world.
pljones is offline   Reply With Quote
Old 11-30-2020, 03:24 PM   #3
BellesOndes
Human being with feelings
 
BellesOndes's Avatar
 
Join Date: Oct 2019
Location: Bordeaux - https://studio.bellesondes.fr
Posts: 53
Default

You can remove this, temporary obvious menu name change, just to overwrite existing VST in the Reaper Fx folder to check that compiled version works. We had a doubt, since this version .dll file is way smaller in size than current active one (190kB vs 571kB).

Last edited by BellesOndes; 11-30-2020 at 03:30 PM.
BellesOndes 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 08:03 AM.


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