Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:47:54+00:00 2026-05-23T09:47:54+00:00

I’m a PHP programmer whose decided to take the plunge into C++ by developing

  • 0

I’m a PHP programmer whose decided to take the plunge into C++ by developing a simple alternative to MissWatson that would allow me to, via the command line with PHP, process a MIDI file through a VST.

I started with the Steinberg VST SDK and I’ve been using this MIDI library: https://ccrma.stanford.edu/software/stk/index.html.

I’m stuck on vectors, specifically the vectors that would store the MIDI events into. Here’s the last bit of code to clean up (keep in mind I’m a total noob to C++ and am probably doing most of this wrong):

std::string midiPath = "C:\\creative\\midi\\m1.mid";

if (argc > 1) {
    midiPath = argv[1];
}

//MidiFileIn::MidiFileIn(midiPath);
stk::MidiFileIn::MidiFileIn(midiPath);

//std::vector<_Ty> * midiEvents;
std::vector<_Ty> midiEvents(200);

stk::MidiFileIn::getNextEvent(midiEvents, 0);
//char* midiEvents[200];
//VstEvents* midiEvents;
//processMidi(effect, VstEvents*);

const char* wavPath = argv[2];
//processAudio(effect, 0, x, x);

and here are the errors:

1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(370): error C2065: '_Ty' : undeclared identifier
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(370): error C2514: 'std::vector' : class has no constructors
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(480) : see declaration of 'std::vector'
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(372): error C2664: 'stk::MidiFileIn::getNextEvent' : cannot convert parameter 1 from 'std::vector' to 'std::vector<_Ty> *'
1>          with
1>          [
1>              _Ty=unsigned char
1>          ]
1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>

So, how do I use the _Ty constructor? Am I on the right track or just crazy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:47:55+00:00Added an answer on May 23, 2026 at 9:47 am

    @the_mandrill is correct, but I just wanted to note that you should be using a VstEvent* type, not VstEvents. A VstEvents structure contains a list of VstEvent objects, and you probably want to break them down into the vector. So some pseudocode for you:

    // Initialization
    std::vector<VstEvent *> midiEvents();
    
    // Somewhere inside of stk::MidiFileIn::getNextEvent()
    while(youReadTheMidiEvents) {
      VstEvents *inEvents = yourReadMidiEventsFunction();
      for(int i = 0; i < inEvents->numEvents; i++) {
        midiEvents.push_back(inEvents->events[i]);
      }
    }
    
    // Somewhere much later in your destructor
    for(int i = 0; i < midiEvents.size(); i++) {
      free(midiEvents.at(i));
    }
    midiEvents.clear();
    

    I have no idea how you are actually reading MIDI events from file (hence the your* stuff), but the above code is simply assuming that you are getting back a VstEvents array somehow. So consider it just a terse overview of how you’re going to have to store pointers in your vector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm making a simple page using Google Maps API 3. My first. One marker
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.