diff options
author | Stepan Moskovchenko <stevenm@rockbox.org> | 2006-05-01 23:22:59 +0000 |
---|---|---|
committer | Stepan Moskovchenko <stevenm@rockbox.org> | 2006-05-01 23:22:59 +0000 |
commit | b2f1b5dd183b1171c81796946c868f2df8df9647 (patch) | |
tree | 3f2fcd3bdf2e2f9e00ad253d671b5c27a52280ad /apps/plugins/midi/guspat.c | |
parent | 9e3da0d6d5bc9d02b939dedd62e05f8893940c1a (diff) | |
download | rockbox-b2f1b5dd183b1171c81796946c868f2df8df9647.tar.gz rockbox-b2f1b5dd183b1171c81796946c868f2df8df9647.zip |
----------------------------------------------------------------------
Added Karl Kurbjun's sound output patch, cleaned up some output.
Main file is now midiplay.c, midi2wav is still in there for anyone who
wants it. Set sampling rate to 22k, and increased note decay time.
Reduced number of concurrent active voices and made new notes replace
used voices if none are available. This makes lag less apparent.
I really hope this wont go red. (turns around and runs)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9858 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/midi/guspat.c')
-rw-r--r-- | apps/plugins/midi/guspat.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/plugins/midi/guspat.c b/apps/plugins/midi/guspat.c index 6f1866cd58..4b5e7a6a28 100644 --- a/apps/plugins/midi/guspat.c +++ b/apps/plugins/midi/guspat.c | |||
@@ -31,11 +31,11 @@ unsigned int readDWord(int file) | |||
31 | 31 | ||
32 | struct GWaveform * loadWaveform(int file) | 32 | struct GWaveform * loadWaveform(int file) |
33 | { | 33 | { |
34 | struct GWaveform * wav = (struct GWaveform *)allocate(sizeof(struct GWaveform)); | 34 | struct GWaveform * wav = (struct GWaveform *)malloc(sizeof(struct GWaveform)); |
35 | rb->memset(wav, 0, sizeof(struct GWaveform)); | 35 | rb->memset(wav, 0, sizeof(struct GWaveform)); |
36 | 36 | ||
37 | wav->name=readData(file, 7); | 37 | wav->name=readData(file, 7); |
38 | printf("\nWAVE NAME = [%s]", wav->name); | 38 | /* printf("\nWAVE NAME = [%s]", wav->name); */ |
39 | wav->fractions=readChar(file); | 39 | wav->fractions=readChar(file); |
40 | wav->wavSize=readDWord(file); | 40 | wav->wavSize=readDWord(file); |
41 | wav->startLoop=readDWord(file); | 41 | wav->startLoop=readDWord(file); |
@@ -62,7 +62,7 @@ struct GWaveform * loadWaveform(int file) | |||
62 | 62 | ||
63 | wav->scaleFreq=readWord(file); | 63 | wav->scaleFreq=readWord(file); |
64 | wav->scaleFactor=readWord(file); | 64 | wav->scaleFactor=readWord(file); |
65 | printf("\nScaleFreq = %d ScaleFactor = %d RootFreq = %d", wav->scaleFreq, wav->scaleFactor, wav->rootFreq); | 65 | /* printf("\nScaleFreq = %d ScaleFactor = %d RootFreq = %d", wav->scaleFreq, wav->scaleFactor, wav->rootFreq); */ |
66 | wav->res=readData(file, 36); | 66 | wav->res=readData(file, 36); |
67 | wav->data=readData(file, wav->wavSize); | 67 | wav->data=readData(file, wav->wavSize); |
68 | 68 | ||
@@ -137,7 +137,7 @@ int selectWaveform(struct GPatch * pat, int midiNote) | |||
137 | 137 | ||
138 | struct GPatch * gusload(char * filename) | 138 | struct GPatch * gusload(char * filename) |
139 | { | 139 | { |
140 | struct GPatch * gp = (struct GPatch *)allocate(sizeof(struct GPatch)); | 140 | struct GPatch * gp = (struct GPatch *)malloc(sizeof(struct GPatch)); |
141 | rb->memset(gp, 0, sizeof(struct GPatch)); | 141 | rb->memset(gp, 0, sizeof(struct GPatch)); |
142 | 142 | ||
143 | int file = rb->open(filename, O_RDONLY); | 143 | int file = rb->open(filename, O_RDONLY); |
@@ -175,15 +175,15 @@ struct GPatch * gusload(char * filename) | |||
175 | gp->layerRes=readData(file,40); | 175 | gp->layerRes=readData(file,40); |
176 | 176 | ||
177 | 177 | ||
178 | printf("\nFILE: %s", filename); | 178 | /* printf("\nFILE: %s", filename); */ |
179 | printf("\nlayerSamples=%d", gp->numWaves); | 179 | /* printf("\nlayerSamples=%d", gp->numWaves); */ |
180 | 180 | ||
181 | int a=0; | 181 | int a=0; |
182 | for(a=0; a<gp->numWaves; a++) | 182 | for(a=0; a<gp->numWaves; a++) |
183 | gp->waveforms[a] = loadWaveform(file); | 183 | gp->waveforms[a] = loadWaveform(file); |
184 | 184 | ||
185 | 185 | ||
186 | printf("\nPrecomputing note table"); | 186 | /* printf("\nPrecomputing note table"); */ |
187 | 187 | ||
188 | for(a=0; a<128; a++) | 188 | for(a=0; a<128; a++) |
189 | { | 189 | { |