Author Topic: SCI0: gTheMusic Roland MT32  (Read 2699 times)

0 Members and 1 Guest are viewing this topic.

Offline robbo007

SCI0: gTheMusic Roland MT32
« on: February 10, 2023, 07:30:38 AM »
Hi everyone,
I'm trying to get music playing with my test room. I've added the midi sound resource to SC named 299 in my case. I've added to my room script:

Code: [Select]
(send gTheMusic:number(299)loop(1)play())
I get errors compiling that. SCI1 documentation uses a different syntax and that does not work either.

Code: [Select]
// Set the game's music to sound resource 101:
(gMusic1:
    number: 101
    loop: 1
    play:
    hold:
)

I see gTheMusic is defined in the main.sc init section also. I've looked on the wiki's can't seem to find anymore info regarding the sound system. I've seen Grumpy's scripts to use audio but I want to use real Roland MT32 hardware under MSDOS. Is there somewhere else where I need to declare the music script before adding the lines above?

Is there are information on how instrument patches are used and intialised to the Roland when the game starts? Do they need to be declared or imported into SC also?

Thanks,







Offline Kawa

Re: SCI0: gTheMusic Roland MT32
« Reply #1 on: February 10, 2023, 07:46:31 AM »
1. We don't recommend using the SCI Studio syntax anymore. The second code block is in Companion syntax, which is closer to Sierra's.

2. Make sure you have at least one track of your song assigned to play on the MT-32.

3. If your main.sc has a gTheMusic, use that instead of gMusic1. Also the number is wrong.

4. Assuming you're testing the game on a modern system via DOSBox, you'll need something like MUNT to simulate the MT-32, and set up DOSBox to use it for MIDI output instead of the default. If you use DOSBox-X, this functionality is built in. In either case, read the documentation for DOSBox or DOSBox-X carefully.

5. Both the SCI0 and SCI11 template come with a patch resource for the MT-32 (patch.001 or 1.pat respectively) that contains all the necessary data. So you should already have them. Don't forget to change the game's configuration to use the MT-32 though! The SCI0 version is taken from Leisure Suit Larry 3 and has instrument patches specific to that game. SCI11 standardized to somewhat match General MIDI. Their formats changed a bit over time but that shouldn't be a problem here, unless you try to use an SCI11 patch in SCI0 or vice versa.

Offline robbo007

Re: SCI0: gTheMusic Roland MT32
« Reply #2 on: February 10, 2023, 09:27:09 AM »
OK thanks. Yeah I keep seeing examples on the forum but loads are SCI Studio scripts. So what I've been trying is to insert this code into my script init section after setting up Ego. It seems to be expecting a keyword. Do I need to use the send syntax? The Send syntax only seems to be used in the SCI studio scripts.

Code: [Select]
; Set up the ego
(SetUpEgo)
(gEgo init:)
(if (not (gEgo has: INV_WOOD))
(aWood init:)

)
)
)

(gTheMusic:
    number: 299
    loop: 1
    play:
    hold:
)

The other stuff (2,3,4,5 ) is clear. Thanks. 

Offline Kawa

Re: SCI0: gTheMusic Roland MT32
« Reply #3 on: February 10, 2023, 09:50:25 AM »
As you say, the send syntax is for SCI Studio scripts. You're using SCI Companion.

Very importantly, keep the indentations right. That'll make it much easier for you to see where to paste a block (and don't forget to adjust its indentation after) and for others to read what you share when asking for help.

It's asking for a keyword because you didn't paste the "play song 299" code inside of a procedure or method (in this case the room's init method). At least, that's what your broken indentation suggests to me.

Offline robbo007

Re: SCI0: gTheMusic Roland MT32
« Reply #4 on: February 15, 2023, 05:53:19 AM »
After some playing around I got it working :)

I needed this code under the INIT section of the room script.
Code: [Select]
(gTheMusic number: 299 loop: -1 play:)
Is this code below for playing sound effects only for SCI1.1? Or can it be used in SCI0 ? As I've read you can use the addwav.exe to add a 8bit wav file to a sound file? Would it be used in this case? My use case is add the LSL5 door soundfx to my opening doors code.

Code: [Select]
(instance openDoorSound of Sound
    (properties
        number 103 // Resource number 103
        priority 15
        flags 1
    )
)

// Then elsewhere ...

(openDoorSound play:)

I'm reluctant to use Gumby's SciAudio as I want to have the game files as small as possible. From what I've read it requires Windows only and also will increase the game size once using higher quality wav's.  The idea is to have my project install from real 5 1/4" disk media on real hardware (MSDOS) once completed.  Talking about space. My resource file with only about 8 room scripts, 10 pictures and a handful of views is already 340kb. That's massive. Is there a way to compress this after or bring this down. If not, there goes my dream to release on floppy disks. hahaha

Did SciAudio ever get moved over to use the Sound class? Or does it still require windows to run?

Thanks,







Offline Kawa

Re: SCI0: gTheMusic Roland MT32
« Reply #5 on: February 15, 2023, 06:28:23 AM »
For sounds, it doesn't really matter if it's a digital audio recording or a MIDI thing, sound is sound and you play them the same way.

(Note that gTheMusic itself resolves to a Sound instance, just like openDoorSound is one.)

The main difference is in how exactly the digital audio tracks are stored: In older SCI, they are part of the sound resources as a special kind of track and the big issue is how to insert such a digital audio track. This is how for example Roger can audibly think to himself "where am I" in the Space Quest 3 intro movie.

In SCI11 and later (perhaps SCI10 too but I'm not sure) there's separate audio resources. If there's a Sound instance like openDoorSound set to, say, number 103, and you tell it to play, the interpreter will check if there's an 103.aud resource and play that instead of 103.snd.

So if you were to open Space Quest 3 in SCI Companion and look at sound 100, you'd find a single "D" track that you can't play. If you look in SV instead, you see it has a digital track, 11khz, 8 bits mono, and you can play it. These are hard to replace but I managed it some time ago (I surprised myself when I pressed play and heard myself ask "waar ben ik"). These sounds can also have both digital and MIDI tracks, like SQ3 sound 74. If you look around the forum well enough you may be able to find the tool you need.

If you open Space Quest 5 instead, you'll see SCI Companion now has both a Sounds tab and an Audio tab. The side bar explains exactly how easy it is to import digital audio. Sound 202 is an explosion which is available in digital and MIDI versions, while #102 ("D'oh!") is digital-only.

Offline gumby

Re: SCI0: gTheMusic Roland MT32
« Reply #6 on: February 16, 2023, 09:23:00 PM »
I'm reluctant to use Gumby's SciAudio as I want to have the game files as small as possible.
Yeah, I wouldn't use that then.  If you are worried about your game size, it'll allow you to use mp3s instead, but the way it was implemented chews up a lot of heap space - just ask Doan, he pushed it as far as it could reasonably go with Betrayed Alliance.

Did SciAudio ever get moved over to use the Sound class? Or does it still require windows to run?
As far as I know it requires Windows to run.  I think at some point ScummVM added support for it, but I could be misremembering.  It'll never be 'native' in SCI games, it'll always be something that the operating system takes care of, external to the interpreter.  I did toy with the idea of tying it into the Sound class, but never did so - either way it doesn't change any of the implementation, adding it to the Sound class would have just made using it more consistent with the scripting language.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: SCI0: gTheMusic Roland MT32
« Reply #7 on: February 16, 2023, 11:03:02 PM »
At the time it was wonderful to be able to add PCM support to SCI0 games when all we could work with was SCI0. Now its time has passed given we can now do SCI1.1 games.
KQII Remake Pic

Offline robbo007

Re: SCI0: gTheMusic Roland MT32
« Reply #8 on: February 17, 2023, 04:13:03 AM »
For sure. Gumby did amazing work (kudos). I would use it under normal circumstances but really want to work with real floppy disks/hardware for the distribution (If I ever get there) .

Offline robbo007

Re: SCI0: gTheMusic Roland MT32
« Reply #9 on: February 17, 2023, 12:27:25 PM »
So on both my virtual machine (Dosbox Munt) and real hardware (IBM 5170 with Roland MPU401 and Roland MT32 + SB) midi works fine. I have Roland MT32 sound for the room using gTheMusic I spoke about earlier but I can't get the adlib track working. I have the same channels selected (As in lsl3) in the sound file 2,4,6,15 for adlib. Same results on virtual machine and real hardware. Any ideas? Virtual machine has dosbox config setup and real machine is using a soundblaster on 220, 7,1. LSL3 adlib track works fine on both.

Regarding the use of wav file for the door sound effects I've created a new sound file and used the addwav.exe to add a 8bit mono pcm wave file to it. Its the LSL6 open door wav converted to 8bit mono. It appears exactly like SQ3 sound.100 file with a D.

I've copied the MTBLAST.DRV from LSL5 and also the SNDBLAST.DRV into the game folder, configured the resource.cfg to reflect either one and both give an error on startup. I get the error "patch.4353 not found" What is that referring too? A patch file? LSL5 has 3 patch files 001, 003 and 101 and my game is using the SCI0 template with Roland, IBM, Adlib, Yamaha, Casio and CMS.

Thanks,




Offline Kawa

Re: SCI0: gTheMusic Roland MT32
« Reply #10 on: February 17, 2023, 12:38:38 PM »
LSL5 is not an SCI0 game. You shouldn't try to use SCI10 patches in an SCI0 game.

Wait, I may have misread. You're using LSL5's drivers in an SCI0 game. Now, SCI0 resources are <type>.<num> so you have "patch.001", but SCI10 resources are <number>.<typ>, so "1.pat". The driver may be causing some confusion, and that's why it's asking for a "patch.4353", which cannot exist in SCI0.
« Last Edit: February 17, 2023, 12:42:35 PM by Kawa »

Offline Doan Sephim

Re: SCI0: gTheMusic Roland MT32
« Reply #11 on: February 17, 2023, 03:20:49 PM »
Perhaps MusicallyInspired would be able to help. He seems to have a pretty good grasp on the music for SCI0 games

Offline robbo007

Re: SCI0: gTheMusic Roland MT32
« Reply #12 on: February 17, 2023, 06:07:43 PM »
It seems the patch error was coming from using mtblast.drv and sndblast.drv from LSL5 or 6. I tried the two files from EricOakford's Redux SCI0 template and managed to get my wav file to play and also the MT32 music. I'm not sure what versions those files are from his template and the differences but they work.

I still need to mess around with the code to get the wav file playing in the right place in my autodoor script statement. At present I can only get it to work with the gTheMusic statement and it plays when I enter the room. Not when I get close to the door and it opens. Strange.

I'll start another thread for the Adlib/CMS stuff as I've not figured out how to get those working yet.
Regards,




Offline Kawa

Re: SCI0: gTheMusic Roland MT32
« Reply #13 on: February 18, 2023, 04:52:31 AM »
It seems the patch error was coming from using mtblast.drv and sndblast.drv from LSL5 or 6.
GASP.
Quote
I tried the two files from EricOakford's Redux SCI0 template and managed to get my wav file to play and also the MT32 music. I'm not sure what versions those files are from his template and the differences but they work.
The difference is that the SCI0 drivers expect SCI0 resources, perhaps?

Offline MusicallyInspired

Re: SCI0: gTheMusic Roland MT32
« Reply #14 on: March 01, 2023, 01:23:35 PM »
You cannot use SCI1+ drivers with SCI0 games. You will need a MTBLAST and SNDBLAST that's specifically for SCI0. The driver structure is entirely different and SCI0 won't understand it.
« Last Edit: March 01, 2023, 01:25:13 PM by MusicallyInspired »
Brass Lantern Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.038 seconds with 22 queries.