Beispiel #1
0
int
main (int argc, char *argv[])
{
  int i;
  double s[N];
  FILE* fo = sound_file_open_write ();

  for (i = 0; i < 4; i++)
    {
      gamme_sinus_12_up(s, fo);
    }
  for (i = 0; i < 4; i++)
    {
      gamme_am_12_up(s, fo);
    }
  for (i = 0; i < 4; i++)
    {
      gamme_fm_12_up(s, fo);
    }
  for (i = 0; i < 4; i++)
    {
      gamme_shepard_12_up(s, fo);
    }

  sound_file_close_write (fo);
  exit (EXIT_SUCCESS);
}
Beispiel #2
0
int
main (int argc, char *argv[])
{
  int i;
  FILE *output;
  double s[N];

  srand( time(NULL) );

  if (argc =! 1)
  {
    printf ("usage: %s\n", argv[0]);
    exit (EXIT_FAILURE);
  }

  output = sound_file_open_write ();

  for (i = 0; i < 10; ++i)
  {
    double x = (double)rand()/RAND_MAX; 
    printf("tire : %f\n", x);
    double note = get_note_stat(x);
    oscillateur( s, 1.0, note);
    sound_file_write (s, output); 
    sound_file_write_silence (output);

  }

  
  sound_file_close_write (output);
  exit (EXIT_SUCCESS);
}
Beispiel #3
0
int
main (int argc, char *argv[])
{
  int i;
  FILE *output;
  double s[N];

  if (argc != 1)
    {
      printf ("usage: %s\n", argv[0]);
      exit (EXIT_FAILURE);
    }

  output = sound_file_open_write ();

  double a = 1;
  double f = 440;
  for (i=0; i<N; i++)
    s[i] = log(1 + (a * sin(2 * M_PI * f * i * 1.0 / FE)));
      
  sound_file_write (s, output);
  sound_file_close_write (output);
  exit (EXIT_SUCCESS);
}