title: Function in 8 step sequencer
body: <pre><code>typedef struct
  {
      float frequency;
      float amplitude;
  }   OscData;
  
  typedef struct
  {
      int notenumber;
      int velocity;
  }   NoteData;
  
  OscData noteToOsc (NoteData note);
  
  int main()
  {
      /*declare integer to store midi note value*/
      int note;
      int velo;
  
      NoteData notedata[8];
      int sequenceposition;
  
      float frequency, x, y;
      float amplitude;
      OscData oscdata[2];
  
  
      /*get user to input a midi value*/
      printf("press 8 keys on the Axion MIDI keyboard to create a loop\n");
  
      /*recording starts here*/
      sequenceposition = 0;
      do
      {
          note = aserveGetNote();
          velo = aserveGetVelocity();
  
          if (velo != 0)
          {
              notedata[sequenceposition].notenumber = note;
              notedata[sequenceposition].velocity = velo;
              printf("note number = %d\n", notedata[sequenceposition].notenumber);
              printf("velocity = %d\n", notedata[sequenceposition].velocity);
              sequenceposition++;
          }
      }
      while (sequenceposition &lt; 8);
      /*recording ends here*/
  
      while(true)
      {
          /*playback starts here*/
          for(sequenceposition = 0; sequenceposition &lt; 8; sequenceposition++)
          {
              oscdata[0].frequency = frequency;
              oscdata[1].amplitude = amplitude;
  
              oscdata = noteToOsc(notedata[sequenceposition]);
  
  
              /*display frequency*/
              printf("Starting oscillator at %5.2fHz\n", oscdata[0].frequency);
              printf("Amplitude = %f\n", oscdata[1].amplitude);
  
              /*start oscillator*/
              aserveOscillator(0, oscdata[0].frequency, oscdata[1].amplitude, 0);
              aserveSleep(200);
          }
  
      }
  
      return 0;
      /*end*/
  
  
  OscData noteToOsc (NoteData note);
  
  {
      float frequency, x, y, amplitude;
  
  
      oscdata[0].frequency = frequency;
      oscdata[1].amplitude = amplitude;
  
          /*convert midi value to frequency and velocity to amplitude*/
  
          x = 2;
          y = (notedata[sequenceposition].notenumber-69.0)/12.0;
          oscdata[0].frequency = 440 * pow(x, y);
  
          amplitude = notedata[sequenceposition].velocity / 127.0;
  
  }
  
  }
  </code></pre>
  
  <p>This is code for an 8 step sequencer that scans for the input of 8 notes from a midi keyboard. The function called in main is supposed to do the conversion of note number to frequency and velocity to amplitude but there is an error 'Array type 'OscData[2] is not assignable' Am I supposed to be putting something else in place of Oscdata?
  Thanks</p>