
// Lew Hill 
// MidiVizBellTree.h

// this class creates an
// upward spiraling bell tree
// of musical notes.

#ifndef _MIDI_VIZ_BELL_TREE_
#define _MIDI_VIZ_BELL_TREE_

#include "MidiVizTrapezoid.h"
#include "NoteColorLookupTable.h"
//#include "midiLew.h"
#include "MidiEvent.h"

using namespace std;

class MidiVizBellTree{

 public:
  
  MidiVizBellTree();

  //  MidiVizBellTree(midiLew* music);

  void draw();

  void frame(double time);

  void processMidiEvent(MidiEvent event);

  void intersect(float in_position[], int button);
  // perform intersection test against
  // the bell tree 

  void setRadialNoteDistance(float distance);

  void setRootNote(int note);
  // this is the midi note of the lowest node in the tree

  void setChannel(int channel);
  // this is the midi channel that a note will be transmitted on

  void setVelocity(int note_velocity);
  // how loud should the note be

  void setVerticalNoteGap(float verticalgap);
  // how much higher should one note be from the next in the
  // stair case

  void setAngularNoteGap(float anglegap);
  // what angle (degrees) should there be between tree nodes.

  void adjustTreeLeafAngles();
  // this note applies all tree parameters

  void assignColors();

  void assignNotes();
  
  
  void setPosition(float x, float y, float z ){
    position[0] = x;
    position[1] = y;
    position[2] = z;
  }
  
  void setRotation(float x, float y, float z){
    rotation[0] = x;
    rotation[1] = y;
    rotation[2] = z;
  }
  
  void setScale(float x, float y, float z){
    scale[0] = x;
    scale[1] = y;
    scale[2] = z;
  }
  
 private:

  MidiVizTrapezoid vizNotes[60];
  int NUM_VIZ_NOTES;

  float position[3];
  float rotation[3];
  float scale[3];

  int rootNote;
  int channel;
  int noteVelocity;
  float verticalGap;
  float angleGap;
  float radialNoteDistance;
  //  midiLew *music;

};

#endif

