Wednesday, April 29, 2020

SoundTracker Pro II - Progress #2

soundtrack2.png As I continue to program, I bumped into a problem with the soundtracker pro 2. The problem was the Portamento function, while in Protracker, you keep repeating the command on each row until the note is finished portomentoeing (however you spell this! lol) .

To tackle the way SoundTracker Pro 2 deals with this, you set the note and its command ONCE, and the player assumes the command is in effect until a new note or command is used. I had to create a translator for this, since this would be too slow to keep doing while playing on the fly. On the pattern loading it deals with the commands for us. Set the command once, and the translator will add the same commands to the sequencial rows until the same rule occured.

As a result, we got a nice portamento effect working. I’ve still yet to completely test as each pattern is loaded, there is a good chance the translation system could reset and leave a note half portamento’d… only time and testing will tell…MsMadLemon is going to have a field day listening to her tunes and pointing out the things that didn’t work or does’t sound right.

so the progress report is done here :)

Thank you for reading.

Tuesday, April 28, 2020

SoundTracker Pro II - Progress - Effects

soundtrack2.png The project is now taking on some real meat now. The sounds and effects are seemingly working without even trying now. I am suprised and thankful that most of the commands in the format seem to work very very much the same as protracker! I’ve spent HOURS on that

49xx - Protracker sampleoffset command. Start sample at offset $xx00.
4E6x - Protracker patternloop command. x=0:set loop, x=n, loop n times
4EEx - Protracker patterndelay command. Delay x notes after playing note
4Fxx - Protracker speed/tempo command. xx<$20: set speed, xx>=$20: set bpm.

with these available to me i’ve been able to implement the Sampleoffset and the speed and temp commands now!

Sunday, April 26, 2020

SoundTracker Pro II

soundtrack2.png After having a problem with reading the format provided by Marco Nelissen, I have to admit that the Psuedo code was a little hard for me to understand.

It wasn’t until ModPlug Tracker had they’re own loader written, C++, and when i looked into the file, things started to make sence.

As soon as I started to program my loader, the files .STP started to make sence, i’ve been since able to read the file as close to properly as possible.

As a result, I’ve been able to extract samples and their loop infomation, turns out i was able to extract each sample into a nice wav file for later use ;)

Then i found the patterns causing some issues. They could be any length from 1 - 9999! WHO USES THAT many rows in one pattern!! Anyways, I ended up having to use a sort of Pattern POINTER, its quick, and simple.

The messy part was, Load the Header, Look at the sample data, load the patterns and their info in to a bank of memory for the points, THEN re-read the sample data for their pointer locations.

I was then able to make patterns load and run. No effects, but the notes are almost identical to that of a Mod!
except i have to now work out the periods needed for the extra 2 octives!

here is the code i used to read through the file

void load_stp_header(FILE *file){
    unsigned char iOrder;
    fread(&mod, 1, 204, file);

    printf("HEADER: %srn", mod.ftype);
    btsEndien16(&mod.version); printf("VERS: %urn", mod.version);
    printf("patterns: %urn", mod.numOrders);
    printf("patternLength: %urn", mod.patternLength);

    btsEndien16(&mod.speed);      printf("speed: %urn", mod.speed);
    btsEndien16(&mod.speedFrac);  printf("speedFrac: %urn", mod.speedFrac);
    btsEndien16(&mod.numSamples); printf("numSamples: %urn", mod.numSamples);
    btsEndien16(&mod.timerCount); printf("timerCount: %u // %Xrn", mod.timerCount, mod.timerCount);
    btsEndien16(&mod.flags);      printf("flags: %urn", mod.flags);
    //btsEndien(&mod.reserved);   printf("reserved: %lurn", mod.reserved);

    printf("rnMidi Inforn");
    btsEndien16(&mod.midiCount);  printf("  MidiCount: %urn", mod.midiCount);
        //printf("    Midi[%2u] = [%2u]rn", iOrder, mod.midi[iOrder]);

    btsEndien16(&mod.sampleStructSize);  printf("rnsampleStructSize: %urn", mod.sampleStructSize);
    printf("-------------------------rnrn");

    Player.cia = mod.timerCount;
}

More to come…