Beispiel #1
0
static inline void handle_drum(MIDIDRUM* MIDI_DRUM, unsigned char drum)
{
   if (MIDI_DRUM->drum_state[drum] && !MIDI_DRUM->prev_state[drum]) {
       calc_velocity(MIDI_DRUM,MIDI_DRUM->drum_state[drum]);
       MIDI_DRUM->noteup(MIDI_DRUM->sequencer, MIDI_DRUM->channel, MIDI_DRUM->midi_note[drum], 0);
       MIDI_DRUM->notedown( MIDI_DRUM->sequencer, MIDI_DRUM->channel, MIDI_DRUM->midi_note[drum], MIDI_DRUM->velocity);
       }
}
Beispiel #2
0
void camera_t::apply(float dt) {
  // pivot around a particular position i.e. "target"
  if (showreel) {
    static float radius = 16.72f, height = 5.0f, t = 0;
    t += dt / 2;
    this->pos = glm::vec3(radius * cos(float(M_PI * 2.0f) + t), height,
                          radius * sin(float(M_PI * 2.0f) + t));
    this->matrix = glm::lookAt(pos, target, glm::vec3(0.0f, 1.0f, 0.0f));
  } else // move around freely and unrestricted ...
  {
    calc_velocity(dt);
    if (!gui_enabled)
      orient(dt);
  }
}
Beispiel #3
0
static inline void handle_bass(MIDIDRUM* MIDI_DRUM, unsigned char drum)
{
   if (MIDI_DRUM->drum_state[drum] && !MIDI_DRUM->prev_state[drum]) {
       if(MIDI_DRUM->drum_state[drum]){
           calc_velocity(MIDI_DRUM,MIDI_DRUM->drum_state[drum]); 
           MIDI_DRUM->notedown( MIDI_DRUM->sequencer, MIDI_DRUM->channel, MIDI_DRUM->midi_note[drum], MIDI_DRUM->velocity);
	   if(MIDI_DRUM->hat_mode == drum)
	   {
	       MIDI_DRUM->midi_note[MIDI_DRUM->hat] = MIDI_DRUM->midi_note[CLOSED_HAT];
	   }
       }else{
           MIDI_DRUM->noteup(MIDI_DRUM->sequencer, MIDI_DRUM->channel, MIDI_DRUM->midi_note[drum], 0);
	   if(MIDI_DRUM->hat_mode == drum)
	   {
	       MIDI_DRUM->midi_note[MIDI_DRUM->hat] = MIDI_DRUM->midi_note[OPEN_HAT];
	   }
       }
   }
}