int trackSize;
int repeat = 0;
int repeatCount = 0;
- char vol = '%';
- int volInterval = 0;
for (count = 0; count < AV_MIDI_NOTE_MAX; count++) {
restSpec[count] = 0;
repeatCount = 0;
}
- if (vol != '%') {
- switch (vol) {
- case '+':
- midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] + VOL_INTERVAL;
- break;
- case '-':
- midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] - VOL_INTERVAL;
- break;
- default:
- break;
- }
-
- if (Melody[0].vol != '%') {
- switch (Melody[0].vol) {
- case '+':
- midiData[52 + (6 * noteCount + 1)] += VOL_INTERVAL;
- break;
- case '-':
- midiData[52 + (6 * noteCount + 1)] -= VOL_INTERVAL;
- break;
- default:
- break;
- }
- }
-
- if (midiData[52 + (6 * noteCount + 1)] > MIDI_LIMIT)
- midiData[52 + (6 * noteCount + 1)] = MIDI_LIMIT;
-
- if ((midiData[52 + (6 * (noteCount - 1) + 1)] == 0 || midiData[52 + (6 * (noteCount - 1) + 1)] == 7) && vol == '-') {
- midiData[52 + (6 * noteCount + 1)] = 0;
-
- if (Melody[0].vol == '+')
- midiData[52 + (6 * noteCount + 1)] = 12;
- }
-
- if ((midiData[52 + (6 * (noteCount - 1) + 1)] == 12 || midiData[52 + (6 * (noteCount - 1) + 1)] == 19) && vol == '-' && Melody[0].vol == '-')
- midiData[52 + (6 * noteCount + 1)] = 0;
- }
-
- else if (Melody[0].vol != '%' && vol == '%' && repeat != 0) {
- switch (Melody[0].vol) {
- case '+':
- midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] + VOL_INTERVAL;
- break;
- case '-':
- midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] - VOL_INTERVAL;
- break;
- default:
- break;
- }
-
- if (midiData[52 + (6 * noteCount + 1)] > MIDI_LIMIT)
- midiData[52 + (6 * noteCount + 1)] = MIDI_LIMIT;
-
- if ((midiData[52 + (6 * (noteCount - 1) + 1)] == 0 || midiData[52 + (6 * (noteCount - 1) + 1)] == 7) && Melody[0].vol == '-')
- midiData[52 + (6 * noteCount + 1)] = 0;
- }
-
- else if (Melody[0].vol == '%' && vol == '%' && repeat != 0)
- midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)];
-
- volInterval = midiData[52 + (6 * noteCount + 1)] - midiData[53];
-
- for (repeatCount = 0; repeatCount < repeat; repeatCount++)
- for (number = 6 * noteCount * repeatCount + 1; number < 6 * noteCount * (repeatCount + 1); number = number + 6) {
- midiData[52 + (number + 6 * noteCount)] = midiData[52 + number] + volInterval;
-
- if (midiData[52 + number] + volInterval > MIDI_LIMIT)
- midiData[52 + (number + 6 * noteCount)] = MIDI_LIMIT;
-
- if (midiData[52 + number] < volInterval * (-1))
- midiData[52 + (number + 6 * noteCount)] = 0;
- }
-
for (number = 1; number < 6 * noteCount * (repeat + 1); number = number + 6) {
if (midiData[52 + number] > MIDI_LIMIT)
midiData[52 + number] = MIDI_LIMIT;
pMelodyBuf = pMelodyStart;
count = noteCount;
- if (repeat != 0) {
- while (*pMelodyBuf != '@')
- pMelodyBuf++;
-
- pMelodyBuf++;
-
- if (vol != '%')
- pMelodyBuf = pMelodyBuf + 2;
-
- while (!(*pMelodyBuf == '*' || *pMelodyBuf == '#' || *pMelodyBuf == '&' || *pMelodyBuf == 'r' || *pMelodyBuf == 'V' || *pMelodyBuf == 'E' || (*pMelodyBuf >= 'a' && *pMelodyBuf <= 'g')))
- pMelodyBuf++;
- }
-
if (*pMelodyBuf != 'E' && *pMelodyBuf != ':') {
pMelodyBuf--;