To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3103
3102  |  3104
Subject: 
MIDI conversion
Newsgroups: 
lugnet.robotics.rcx.legos, lugnet.robotics.rcx.nqc
Date: 
Thu, 16 Jan 2003 00:12:35 GMT
Viewed: 
5494 times
  
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



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR