Ms Pinky SDK - OSX sample project is missing from download

General and Miscellaneous Topics regarding MsPinky
Post Reply
discopatrick
Posts:7
Joined:Sun May 03, 2015 2:25 pm
Ms Pinky SDK - OSX sample project is missing from download

Post by discopatrick » Tue May 05, 2015 3:03 pm

I've downloaded the SDK. The readme says there should be a "a sample application project" in the OSX folder, but it isn't there.

I'm keen to see a sample application so I can get a head start on how to incorporate the library into my own apps.

Does anyone have this to hand? Or can it be made available via the download, or emailed to me directly, please?
dlpinkstah
Site Admin
Posts:1093
Joined:Mon Jun 07, 2004 9:17 pm

Post by dlpinkstah » Tue May 05, 2015 7:03 pm

The sample app is no longer supported. Sorry! But it's really very simple to use the SDK and I can provide some code snippets here:

Code: Select all

void *vinyl_tracker;

double power_thresh = -30.0;
double cutoff_sharpness = 2.5;

//instantiate the Ms Pinky vinyl tracking object
vinyl_tracker = MPVT2_CreateNew(8192, getSampleRate());

MPVT2_SetVinylGeneration(vinyl_tracker, 4);
MPVT2_SetAbsoluteMode(vinyl_tracker, true);
MPVT2_SetSignalPowerThreshold(vinyl_tracker, power_thresh);
MPVT2_SetCutoffSharpness(vinyl_tracker, cutoff_sharpness);

……..

// Called for each buffer of input samples inside your audio service callback
MPVT2_ProcessBuffer(vinyl_tracker, buffer.getSampleData(0), buffer.getSampleData(1),
			buffer.getNumSamples(), velocityVals, powerVals, positionVals, num_measurements);
			
Basically you just instantiate the vinyl tracking object with MPVT2_CreateNew(), and then use that instance assigned to a void * pointer to access the other SDK functions. SDK functions which set parameters of the tracker have names like "MPVT2_SetXXX" and these should be called from a low-priority thread because they can take a bit of time to compute. The MPVT2_ProcessBuffer() routine can be called from your realtime audio processing thread. With these snippets, and with the provided .pdf file in the SDK you should have plenty of information on how to get started.
discopatrick
Posts:7
Joined:Sun May 03, 2015 2:25 pm

Post by discopatrick » Tue May 05, 2015 7:51 pm

To be honest I'm struggling with a few fundamentals at that moment. I'm not even sure what language I'm supposed to be coding in!

If you could help me get over a few hurdles, and start up a simple project, I'd be happy to share it here with the community so that others like me in future have something to start with.

I'm guessing I need to start either a C, C++, or Objective-C project?

Currently, I've got a Cocoa Application project started in Xcode 6, and I've added the library to the project. However, if I #import "VinylTrackFramework.h" then Xcode flags up a syntax error in that file.

Thanks in advance for your help! :)
dlpinkstah
Site Admin
Posts:1093
Joined:Mon Jun 07, 2004 9:17 pm

Post by dlpinkstah » Tue May 05, 2015 8:28 pm

The language to use is C/C++

Instead of #import you should use this:

#include "VinylTrackFramework.h"

Then add the libVinylTrack.a to your project.
discopatrick
Posts:7
Joined:Sun May 03, 2015 2:25 pm

Post by discopatrick » Thu May 07, 2015 12:22 am

Ok, I'm making some progress, but have become stuck again. I've tried two approaches.

The first approach was to create an OSX Cocoa application (which I have a little experience in building) and somehow include the Ms Pinky library in the project. The issue here is that a Cocoa Application is written in Obj-C, and the Ms Pinky library is written in C++. It seems there are ways to mix the two, but I'm struggling to understand it: http://www.philjordan.eu/article/mixing ... bjective-c++

It would seem simpler to build a pure C++ application. Xcode doesn't have a template for this. However, the Juce framework ( http://www.juce.com ) can generate a working Xcode C++ project for you, and this is my second approach. The Juce template projects build just fine in Xcode, but I run into problems when trying to use the Ms Pinky library in the project.

If a add a private property called vinyl_tracker to the class, then try to assign it in the constructor like this:

Code: Select all


...

#include "VinylTrackFramework.h"

class MainContentComponent   : public AudioAppComponent
{
public:
    //==============================================================================
    MainContentComponent()
        : phase (0.0f),
          phaseDelta (0.0f),
          frequency (5000.0f),
          amplitude (0.2f),
          sampleRate (0.0),
          expectedSamplesPerBlock (0)
    {
        setSize (800, 600);
        
        vinyl_tracker = MPVT2_CreateNew(8192, 44100);

        // specify the number of input and output channels that we want to open
        setAudioChannels (2, 2);
    }

...

private:
    //==============================================================================
    float phase;
    float phaseDelta;
    float frequency;
    float amplitude;

    double sampleRate;
    int expectedSamplesPerBlock;
    Point<float> lastMousePosition;
    
    void *vinyl_tracker;

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent)
};

...

...then the error message I get from Xcode is:

Undefined symbols for architecture x86_64:
"_MPVT2_CreateNew", referenced from:
MainContentComponent::MainContentComponent() in MainComponent.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas what I could be doing wrong? "Undefined symbols for architecture x86_64" suggests it has a problem with me building a 64 bit app. I've tried changing the architecture config to "Universal Binary (32 bit)" via the Juce IDE, but I get the same error.
discopatrick
Posts:7
Joined:Sun May 03, 2015 2:25 pm

Post by discopatrick » Thu May 07, 2015 12:35 am

Oh, another question I forgot to ask - what would be *your* recommended approach for building an app with the Ms Pinky SDK?

For example, IDE, language, or any other useful information... is there any set up you know that "just works"? :)
discopatrick
Posts:7
Joined:Sun May 03, 2015 2:25 pm

Post by discopatrick » Thu May 07, 2015 12:43 am

Also, some background information on the above error message - I'm trying to build this in Xcode 6.2 on Mavericks 10.9.5
discopatrick
Posts:7
Joined:Sun May 03, 2015 2:25 pm

Post by discopatrick » Thu May 07, 2015 1:10 am

The solution was simple - I just had to include LibVinylTrack.a in my project, following the instructions in the accepted answer on this post: http://stackoverflow.com/questions/1840 ... ure-x86-64

I'm not very experienced with Xcode, so chances were it would be something simple :)

Edited to add: the correct way to do this in a Juce project is to add the config via Juce and *not* Xcode, otherwise Juce will overwrite the config next time it auto-generates the Xcode project. This is how it should be done: http://www.juce.com/forum/topic/xcode-l ... aries-link
Last edited by discopatrick on Sat May 09, 2015 6:35 pm, edited 1 time in total.
dlpinkstah
Site Admin
Posts:1093
Joined:Mon Jun 07, 2004 9:17 pm

Post by dlpinkstah » Thu May 07, 2015 7:39 pm

Glad to hear there is progress!

I think your choice of the JUCE framework is an excellent one. That way whatever application you create will automatically be cross-platform with Windoze. I use JUCE for the Pinky VST/AU.

One thing to keep in mind is that the MPVT2_SetVinylGeneration() method should not be called from your real-time audio thread, but instead should be called from another low-priority thread, such as the GUI widget callback thread. And while this function is doing it's thing, you must make sure that your other thread(s) is/are not accessing the instance of vinyl_tracker for any purpose as this could cause a crash! So just use semaphores or whatever to make sure of that.

All the other MPVT2_Setxxx and the MPVT2_Queryxxx methods can be called from any thread.
Mudo
Posts:340
Joined:Tue Jun 08, 2004 9:22 pm
Location:...Barcelona...

Post by Mudo » Tue May 12, 2015 12:37 pm

I recomend take a look into openframeworks due it have iOs/android export in addition to be c++ ide/framework.

;)
...

Mudo means mute person.


Researching new interface paradigms
...
tsutek
Posts:38
Joined:Thu Feb 23, 2012 8:53 am

Post by tsutek » Mon Aug 10, 2015 10:12 am

Is someone planning to inject some new life into MsPinky in the form of an iOS DVS app? Naughty naughty 8)

I've given MsPinky very little love after switching to hardware-based DVS. Perhaps it could be time to revisit things..
Mudo
Posts:340
Joined:Tue Jun 08, 2004 9:22 pm
Location:...Barcelona...

Post by Mudo » Mon Aug 10, 2015 10:18 am

well it should be easiest as ever with the newcoming ios9 and audiounit extension support (isn`t it?) but meanwhile there are few possibilities to use your vinyl with djplayer app which supports relative mode from any timecode system available...

Also it is possible to go the hardware route with raspi 2 board and linux externals from Ms. Pinky sdk!

Exciting times once again for the Pinkies community... <3
...

Mudo means mute person.


Researching new interface paradigms
...
Post Reply