I have added a feature to BricxCC to convert MIDI files to NQC, MindScript,
LASM, brickOS C, and brickOS Pascal code. It seems to work quite well with
the first three languages (i.e., the sound generated by the RCX closely
resembles the MIDI file played via Media Player). But with brickOS the
notes just don't seem to match what they are named.
In theory these two should sound very similar:
// code generated by Bricx Command Center
task main() {
Wait(120);
PlayTone(415,1);
Wait(7);
PlayTone(659,2);
Wait(8);
PlayTone(1175,1);
Wait(7);
PlayTone(1480,6);
Wait(8);
}
// code generated by Bricx Command Center
#include <config.h>
#include <dsound.h>
static const note_t music[] = {
{ PITCH_PAUSE, 120 },
{ PITCH_Gm4, 1 },
{ PITCH_PAUSE, 7 },
{ PITCH_E5, 2 },
{ PITCH_PAUSE, 8 },
{ PITCH_D6, 1 },
{ PITCH_PAUSE, 7 },
{ PITCH_Fm6, 6 },
{ PITCH_PAUSE, 8 },
{ PITCH_END, 0 }
};
int main(int argc,char *argv[]) {
dsound_set_duration(10);
dsound_play(music);
return 0;
}
Shouldn't they sound about the same? On my RCX the 3rd and 4th notes played
by the brickOS program seem lower than they ought to be.
John Hansen
|