source: trunk/third/audiofile/test/instparamwrite.c @ 17099

Revision 17099, 1.4 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17098, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2        Audio File Library
3
4        Copyright 2000, Silicon Graphics, Inc.
5
6        This program is free software; you can redistribute it and/or
7        modify it under the terms of the GNU General Public License as
8        published by the Free Software Foundation; either version 2 of
9        the License, or (at your option) any later version.
10
11        This program is distributed in the hope that it will be
12        useful, but WITHOUT ANY WARRANTY; without even the implied
13        warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14        PURPOSE.  See the GNU General Public License for more details.
15
16        You should have received a copy of the GNU General Public
17        License along with this program; if not, write to the Free
18        Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19        MA 02111-1307, USA.
20*/
21
22#include <stdio.h>
23
24#include <audiofile.h>
25
26main (int argc, char **argv)
27{
28        AFfilehandle    file;
29        AFfilesetup     setup;
30        AUpvlist        list;
31
32        if (argc != 2)
33        {
34                fprintf(stderr, "usage: instparamwrite filename\n");
35        }
36
37        setup = afNewFileSetup();
38        afInitFileFormat(setup, AF_FILE_AIFFC);
39
40        file = afOpenFile(argv[1], "w", setup);
41        if (file == AF_NULL_FILEHANDLE)
42        {
43                fprintf(stderr, "could not open file %s for writing", argv[1]);
44        }
45
46        afFreeFileSetup(setup);
47
48        /* Set the base note to a 'D.' */
49        afSetInstParamLong(file, AF_DEFAULT_INST, AF_INST_MIDI_BASENOTE, 50);
50
51        /* Detune down by 30 cents. */
52        afSetInstParamLong(file, AF_DEFAULT_INST, AF_INST_NUMCENTS_DETUNE, -30);
53
54        afCloseFile(file);
55}
Note: See TracBrowser for help on using the repository browser.