Esempio n. 1
0
void game_start_stop(GtkMenuItem     *widget,
		     gpointer user_data)
{
  game_play=!game_play;
  gtk_widget_set_sensitive(GTK_WIDGET(widget), FALSE);
  if(game_play)
    {
      gtk_widget_set_sensitive(menu_game_stop,TRUE);
      gtk_widget_set_sensitive(menu_game_quick,FALSE);
      gtk_widget_set_sensitive(menu_game_start,FALSE);
      gtk_widget_set_sensitive(Start_stop_button,TRUE);
      gtk_label_set(GTK_LABEL(Start_stop_button_label),start_stop_str[1]);
      gtk_widget_set_sensitive(Pause_button,TRUE);
      gtk_widget_grab_default(Pause_button);
      game_init();
      make_noise(options.noise_l,options.noise_h);
      from_virtual();
      move_block(0,0,0);
      current_level = options.level;
      update_game_values(0,current_level,0);
      timer = gtk_timeout_add(level_speeds[current_level],(GtkFunction)game_loop,NULL);
    }
  else
    game_over_init();
}
Esempio n. 2
0
void game_new_wrapper()
{
  options.level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_level));
  options.noise_l = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_noise_level));
  options.noise_h = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_noise_height));

  gtk_widget_set_sensitive(menu_game_quick,FALSE);
  gtk_widget_set_sensitive(menu_game_start,FALSE);
  gtk_widget_set_sensitive(menu_game_stop,TRUE);
  game_play=!game_play;
  gtk_label_set(GTK_LABEL(Start_stop_button_label),start_stop_str[1]);
  gtk_widget_set_sensitive(Pause_button,TRUE);
  gtk_widget_grab_default(Pause_button);			 
  game_init();
  make_noise(options.noise_l,options.noise_h);
  from_virtual();
  move_block(0,0,0);
  current_level = options.level;
  update_game_values(0,current_level,0);
  timer = gtk_timeout_add(level_speeds[current_level],(GtkFunction)game_loop,NULL);
  gtk_widget_hide(new_game_window);
}
Esempio n. 3
0
int main()
{
  make_noise();
  return 0;
}
Esempio n. 4
0
int main()
{
    make_noise(Cat{});
    make_noise(Dog{});
    // make_noise(int{});
}
Esempio n. 5
0
int main(void) 
{
	scalar_t sample_freq = 44100;
	scalar_t i, j, freq;
	int b;

	osc_t osc[3];
	osc_init(&osc[0], OSC_TYPE_SAWTOOTH);
	osc_init(&osc[1], OSC_TYPE_SAWTOOTH);
	osc_init(&osc[2], OSC_TYPE_SAWTOOTH);

	filter_moog_t f;
	filter_moog_init(&f);

	i = 0.06f;
	j = -0.01f;
		
	b = 0;
// init oscillator state

	for (b=0; b<7; b++) {
		freq = note2freq(A, b);
		fprintf(stderr, "freq=%3.2f, oct=%i\n", freq, b);
		osc[0].freq = freq;
		make_noise(osc, 1, 0.4f, sample_freq, 0.0001, NULL);
	}

	b=0;

	//return 0;

	for (;;) {	
		
		
		if (b++ == 1) {
			b = 0;
			j *= -1;
		}

		osc[0].freq = 109;
		osc[1].freq = 111;
		osc[2].freq = 55;

		i += j;
		filter_moog_set_params(&f, i, 0.6f);

		make_noise(osc, 3, 0.1f, sample_freq, 0.0002, &f);

		osc[0].freq = 219;
		osc[1].freq = 221;
		osc[2].freq = 55;

		i += j;
		filter_moog_set_params(&f, i, 0.6f);

		make_noise(osc, 3, 0.1f, sample_freq, 0.0002, &f);
		
		osc[0].freq = note2freq(Cb, 2) - 1;
		osc[1].freq = note2freq(Cb, 2) + 1;
		osc[2].freq = note2freq(Cb, 1);


		i += j;
		filter_moog_set_params(&f, i, 0.6f);

		make_noise(osc, 3, 0.2f, sample_freq, 0.0001, &f);

		//osc_init(&osc, OSC_TYPE_SAWTOOTH);
		//make_noise(&osc, 2, 2.0f, sample_freq);
		
		//osc_init(&osc, OSC_TYPE_SQUARE);
		//make_noise(&osc, 2, 2.0f, sample_freq);
	}
}