{MusicMo1.inc by Kari Lammassaari 1996 contains following independent and standalone procedures and functions: (REMOVE Procedures/Functions You don't need or make them separate inc-files.) - Procedure WriteAudioRegister(Register,Value:Byte); (Stands alone !) - Function ReadAudioRegister(Register:Byte):Byte; (Stands alone !) - Function MusicModuleExists:Boolean; (Needs Write/ReadAudioRegister) - Procedure WriteAudioRam(StartAddr,SourceAddr,Bytecount:Integer); (Stands alone !) - Procedure ReadAudioRam(StartAddr,DestinationAddr,Bytecount:Integer); (Stands alone !) (REM StartAddr refers to 4 byte groups, NOT sequential bytes in AUDIO RAM. Ie. You can set starting point of write/read in audio ram in 4 byte steps, ie. StartAddr = refers byte 0 in audio ram, AudioArrd=1 refers byte 4 ... Writing/reading occurs ,of course, to every byte. SourceAddr and DestinationAddr refer to data areas in conventional RAM.) - Function AudioRamSize:Integer; (Needs Write/ReadAudioRam.) (Returns the size of AudioRam in kilobytes ie. 32 or 256 .) (Updates variable SizeOfAudioRam :Real) - Procedure Sample(StartAddr,SampleLenght,SampleFrequency:Integer; SwitchOnValue:Byte); (ADPCM) (Stands alone !) (SwithcOnValue 0..127 = the loudness, which turns sampling on. Test the loudness with PcmSample to find out the right value.) - Procedure PlaySample(StartAddr,SampleLenght,SampleFrequency:Integer; Volume:Byte); (ADPCM) (Stands alone !) - Procedure RepeatSample(StartAddr,SampleLenght,SampleFrequency:Integer; Volume:Byte); (ADPCM) (Stands alone !) ( REM Max. SampleFrequency is 16000 Hz, Volume = 0..255. StartAddr and SampleLenght refer 4-byte groups in AUDIO RAM.) - Procedure StopSamplePlay; (ADPCM) (Stands alone !) - Procedure SaveSample(FileName:StringType;AudioAddress:Integer;Bytecount:Real); ( Needs MsxDos2.inc ) ( REM Special value ,ByteCount = 0, means that all the AUDIO RAM will be saved. In this case use function AudioRamSize to update automaticly variable SizeOfAudioRam.) - Procedure LoadSample(FileName:StringType;AudioAddress:Integer;Bytecount:Real); ( Needs MsxDos2.inc ) ( REM Special value , ByteCount = 0, means that all the file will be loaded. ) ( Accessing audio ram during playback stops playback ! ) - Procedure PcmSample(DestinationAddr,SampleLenght,SampleFrequency:Integer; ValueToAdd:Byte); (PCM) (Stands alone !) (Samples PCM-data via MSX Audio register $1a directly to DestinationAddr in conventional RAM. Data is in the form of 2's complement. SampleLenght = count of sampled bytes. ValueToAdd, if not zero, this value is added to sampled data to produce easily required graphic coordinate. If zero adding is ignored ) - Procedure PcmSwitch(SwitchVolume:Byte); (Values 0..127) (Stands alone !) (PCM) (Waits sound loudnes to reach given SwitchVolume level and returns doing nothing else. Used to switch the PcmSample on. ) - Procedure PcmPlay(SourceAddr,SampleLength,SampleFrequency:Integer; Volume:Byte); (REM Volume 0..7) (PCM) (Stands alone !) (Plays back PCM data from conventional memory.) (Occupies totally Z80 !); - Variable SizeOfAudioRam:Real , which is updated by function AudioRamSize; }