Start New Discussion within our Software Development Community

Hello

i am a musician and not a programmer. i assume this is completely obvious to you by now.

do listen to my music if you please. something to do while you read my long enquiry.

samantha.mp3

I am attempting my first c++ program to create a program for a midi control device..... a thing with real buttons

so i have midi and some parameters to assign to each knob and button. a parameter may have up to 127 strings... or values.

the final output is in xml. my program will generate this xml.

the program creates labels or strings for various thresholds withint the midi cc data.

i want to be able to determine whether the variable in question is discreet or continuous (128 values being considered continuous in this case.)

if the variable is discreet i need to break up the midi cc from 0 - 127 into the number of variables.

eg if there are 2 -
then the device should display 0 - 63 ON while the midi message is being sent
and then 64 - 127 the device should be off.

Another parameter may be wave form
in this instance there may be sin ,, square,, tri,,,

so midi 0 -43 =sin
44 - 86 square etc.

i need to have a array of these max and min values within the bracket... and the associated parameter with it.

My first question is..
How do i assign a string to a array?
thanks

// string
#include <iostream>
#include <string>
using namespace std;
char v;

int main ()
{
    int a=0;
    string parameter;
  cout << "is the variable discreet?\n";
    // perhaps this should be some kind of boolean.
    cin >> v;
    cout << v << endl;
    
    //need a if statement here ... and folowing only executed if boolean is true///
    cout << "how many variable classes? \n";
    cin >> a;
    
    
for (int n=1; n<=a; n++) 
    char aChar[6];
    {   
    cout << "Parameter" << n << endl; 
    cin >> parameter[n]; // i want to be able to read into here n strings into the array... )filter resonance, attack , decay sustian release..
        //.. etc
        // presently it is only reading one char. this is where i am having trouble...
    }
    }
   for (int n=1; n<=a; n++) 
    {   
    cout << parameter[n] << endl;
        // just testing to see if i got them all
return 0;
}

>>How do i assign a string to a array?
1) add #include <vector> 2) create an array of strings vector<string> aList; 3) add a string to the vector: aList.push_back( "Hello World" );