|
From: Brian B. <wi...@w4...> - 2013-12-08 16:48:14
|
On Sun, 2013-12-08 at 04:44 -0800, Chris Share wrote:
> I've tried the following:
>
>
> /* Create a Format 1 MIDI file */
> 9 fd = MidiFileCreate("output.mid", midifile1, TicksPerQuarterNote, 500);
> 10 if(fd == NULL) {
> 11 printf("File could not be created\n");
> 12 error = MidiGetError();
> 13 printf("Error: %ld\n", error);
> 14 return 0;
> 15 } else if(fd != NULL) {
> 16
>
> It's producing the following output:
>
> File could not be created
> Error: 0
>
> The app is generating a MIDI file but its size is 0 bytes.
>
> Any idea what's going on here?
>
> I'm using OSX 10.9.
>
> Cheers,
>
> Chris
>
Try using full path for filename parameter and make sure it points to
directory with file creation permission. Also, the second if statement
(because of the else clause) is superfluous.
--- Brian
|