Author Topic: Convert SCI0 vocab to SCI1 vocab?  (Read 549 times)

0 Members and 1 Guest are viewing this topic.

Offline EricOakford

Convert SCI0 vocab to SCI1 vocab?
« on: July 18, 2022, 01:35:41 PM »
My KQ4 upgrade patch is looking good. Now I've ported the game to interpreter S.old.010 (from the KQ1SCI demo).
With the system scripts updated, everything carries over with little issue, and there's MUCH more heap space available! Except... the main vocab is incompatible. Saving it as vocab.900 doesn't help.
Could SCI0 vocabs be converted to SCI1 vocabs? I know they were just compiled differently; the original source dictionary files are structured the same.

In the future, I plan to update the interpreter to 1.000.172 (from The Seasoned Professional). I know about this project which VGA-ifies the game. The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.


My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline troflip

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #1 on: July 18, 2022, 06:06:10 PM »
I don't think there's an easy way to do it. You can see the difference between the 000 and 999 vocab resources here:

https://github.com/icefallgames/SCICompanion/blob/e2b5891052f884180b3705c273941b69b8a9878b/SCICompanionLib/Src/Resources/Vocab000.cpp

It's not a huge difference in format, but you'd probably need to write your own code to read in one format and spit out the other.

If I'd had access to the original dictionary file formats back when making SCICompanion, it probably would have been a good idea to support import/export of them.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #2 on: July 18, 2022, 07:41:38 PM »
The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Export as MIDI and reimport?
KQII Remake Pic

Offline ZvikaZ

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #3 on: July 19, 2022, 03:56:54 AM »
I have faced similar problem when working on SQ3 Hebrew translation.
SQ3 uses the old, 7-bits, format. But for Hebrew I needed the new, 8-bit format.
Therefore, my scripts "export" the original vocab file to a .csv file (readable by Excel), the Hebrew translation was done in that file, and then another script "import"ed the .csv file to a vocab fie, in the new format.

You can see them at:
https://github.com/adventurebrew/re-quest/tree/master/tools/sci
  (we have recently moved them to a new repo)

The scripts of interest for you are 'vocab_export.py' (to create the .csv file) and 'vocab_import.py' (to read the .csv file and create 2 vocab files (!) - both are in the new format, but they have different names and locations - you can safely ignore that unneeded file, just make sure it doesn't delete any important file for you...)

The scripts also have (a basic) '--help' support.

If this information is enough for you - great.
If not, I will have time tomorrow to run it myself, and write detailed instructions what should you run.

Offline EricOakford

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #4 on: July 19, 2022, 12:37:55 PM »
Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.
Code: [Select]
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define:  SORTCOPY
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch:  {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch:  {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
    vocab_export(args.gamedir, args.csvdir)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
    write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
    dict_writer.writerows(vocab)
  File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
    return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set

The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.

When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline ZvikaZ

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #5 on: July 19, 2022, 01:43:38 PM »
Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.
Code: [Select]
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define:  SORTCOPY
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch:  {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch:  {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
    vocab_export(args.gamedir, args.csvdir)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
    write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
    dict_writer.writerows(vocab)
  File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
    return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set

The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.

When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.

Can you send me the vocab file?
I will check what's gone wrong in exporting.

Regarding the interpreter not recognizing - can you please try with ScummVM?

Offline EricOakford

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #6 on: July 20, 2022, 11:14:04 AM »
I've got the vocab files here. The original vocab (from 1.006.004), the exported CSV, and the re-imported vocab.900.

I can't test in ScummVM, since it's an unknown game variant.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline MusicallyInspired

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #7 on: July 21, 2022, 01:08:24 AM »
The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Export as MIDI and reimport?

Another problem is that currently there is no way to assign # of voices values to channels for SCI1+ sound resources (Adlib needs this). And you'd have to reimplement all the cue & loop points by hand.
Brass Lantern Prop Competition

Offline ZvikaZ

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #8 on: July 21, 2022, 05:07:01 AM »
Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.
Code: [Select]
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define:  SORTCOPY
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch:  {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch:  {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
    vocab_export(args.gamedir, args.csvdir)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
    write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
    dict_writer.writerows(vocab)
  File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
    return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set

The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.

When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.

OK, we have 2 distinct problems here:
1. The original vocab has 2 strange bytes, after 'anynumber' entry, on the beginning of '!*' entry. The csv writer couldn't handle those. I fixed it locally. Anyway,  I don't understand why are they there - any input will be great.
2. That's not the reason it failed to work for you - but rather that I had only ScummVM in mind when writing those tools. The vocab file has pointers in the beginning, that are unused by ScummVM, so I didn't bother to handle them.

I suppose I can add support for those pointers - however, it'd be much easier if someone can refer me to an explanation how they are working. I'm aware of http://sci.sierrahelp.com/Documentation/SCISpecifications/27-TheParser.html#AEN5794, but it describes only the old format (which uses 26 pointers, one for each letter) and not the new format (which uses 255 pointers).

EDIT
====
If I understand correctly SCICompanion's code, the 255 pointers are for ascii codes. Therefore, I can continue with this.
« Last Edit: July 21, 2022, 05:50:00 AM by ZvikaZ »

Offline ZvikaZ

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #9 on: July 21, 2022, 09:36:17 AM »
OK, I was wrong - those 2 'strange characters' were actually perfectly fine, it was a bug in my script.

Now everything is fixed, and should be working even with original Sierra interpreters (I hope...)
Please pull and check again.

Update how is it going.



Offline EricOakford

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #10 on: July 21, 2022, 11:01:22 AM »
It worked! Exported the original vocab, imported the CSV file back into vocab.900. Compiled all scripts, and the game recognizes commands now! I'll have to play through and check for any bugs.

The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Export as MIDI and reimport?

Another problem is that currently there is no way to assign # of voices values to channels for SCI1+ sound resources (Adlib needs this). And you'd have to reimplement all the cue & loop points by hand.

I had similar issues with the QFG1VGA upgrade. I exported the Mac version's sound files' General MIDI tracks as MIDI files and re-imported them. I had to manually re-insert the loop points, and the PC Speaker driver doesn't play any of the music.

Maybe I'll give LSL2 the same treatment, since I've fully decompiled that one, too. It'll give both games better compatibility for fan translations.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline ZvikaZ

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #11 on: July 21, 2022, 11:37:51 AM »
I'm glad to hear that it worked!

Regarding the sound issue, I might give a hand here, to automate the manual work needed, but I don't really understand the problem definition.
I have done some work on ScummVM's sound code, but I never touched the sound format itself.

Can you refer me to specs, if any exists, of the old and new formats? Examples of game or two that uses each format?
And what happened to loop points in the new format?
And I didn't understand the comment regarding # of voices channels.


Offline MusicallyInspired

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #12 on: July 22, 2022, 05:26:49 PM »
I'm glad to hear that it worked!

Regarding the sound issue, I might give a hand here, to automate the manual work needed, but I don't really understand the problem definition.
I have done some work on ScummVM's sound code, but I never touched the sound format itself.

Can you refer me to specs, if any exists, of the old and new formats? Examples of game or two that uses each format?
And what happened to loop points in the new format?
And I didn't understand the comment regarding # of voices channels.

Here is the SCI Sound format specifications by Ravi Iyengar. It's more focused on SCI0 sounds and Amiga and Macintosh SCI1 sounds for some reason. There's no information about standard SCI1 sound resource specs that I could find. I do know the difference between SCI0 and SCI1+ sound resources aren't much but among them is that SCI1 sounds can have multiple tracks per channel which makes it easier to assign instruments to different music devices because you can assign multiple music device instruments using their own tracks to a single MIDI channel. The interpreter just ignores the other tracks for the music devices not being used. SCI0 sounds can only have one track per channel so you're limited to 15 tracks and have to share notation with other music devices (Adlib and MT-32 for instance).

As for the "# of voices" thing, part of the SCI sound resource specification is to assign an "initial voices" value to each channel. This is a value that SCI reads and tells the Adlib music device specifically how many voices can sound at the same time. Adlib is limited to 8-voice polyphony and no more (unless you use the SBPRO driver which is stereo OPL3 and you have 16-voice polyphony instead). So each Adlib dedicated track/channel must have an initial voices value set to properly control the polyphony. Ravi's "SoundBox" was a program he wrote to convert MIDI files to SCI0 sound resources and it allows the user to assign the "initial voices" value for each channel. This feature is not implemented in SCI Companion because it was designed mainly around GM MIDI import only and never really considered other music devices.

As for loop/cue points, I'm not sure exactly what has changed there. I would assume it was the same. However, Collector was suggesting that one extract the SCI sound resources to MIDI and then reconvert them to SCI1 sound resources. This process wipes the cue and loop information because they don't have a standard MIDI format equivalent. Hence they'd have to be re-implemented by hand. Having a proper converter to convert SCI0 sound resources to SCI1+'s format would negate this issue. I've looked into it but my code fu is weak.
« Last Edit: July 22, 2022, 05:34:52 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline ZvikaZ

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #13 on: July 25, 2022, 12:14:34 PM »
Well, thanks to Phil's code I managed to get around SCI1+ format. The header is quite different. The payload is also slightly different.
I will open a different thread to discuss that.

Anyway, I have a (basic) tool ready:
https://github.com/adventurebrew/re-quest/blob/master/tools/sci/sounder.py

It currently can:
  • load SCI0 snd file (not early SCI0, but it's working for my GOG's KQ4 copy)
  • load SCI1+ snd file
  • load arbitrary MIDI file
  • show file's info (for Sierra's formats)
  • play the file
  • save the file as MIDI
  • save the file as SCI1+ snd file
  • save the file as MIDI, and later read it and save as SND, and keep cues and loop points (they are saved as MIDI meta-message)

Missing features and limitations (will be hopefully addressed in the future):
  • Digital samples are ignored
  • Saving as .SCI0 file is missing
  • SCI0: Playing only specific device (currently it plays all channels)
  • SCI1: Selecting device to play and midi file save (currently it uses only GM or MT32 if GM doesn't exist
  • Support early SCI0 (if anyone can lend me such a game, it will be easier :) )
  • SCI1 flags, 'poly' and 'prio' are ignored, both on save and load
  • Better support of saved file name

It's supposed to handle cue and loop points, but I haven't thoroughly verified it.
Generally speaking, it's not verified well enough, and probably has some bugs ;)

As for number of voices, for adlib - there's no place to save it SCI1+ format (as far as I understand) - so, it's a problem...
It's interesting to check with ScummVM (I might do it...), or original interpreter (even better but I couldn't find it in OmerMor's files; maybe it's in the adlib driver itself) how is it handled.
Maybe the interpreter selects these values by itself?

As usual, run with '--help' to get detailed information, or ask here if something isn't clear.

And of course, I'll be happy to get bug reports or feature requests.

EDIT
====
For more details, see https://sciprogramming.com/community/index.php?topic=2075.0

« Last Edit: August 05, 2022, 02:56:04 AM by ZvikaZ »

Offline MusicallyInspired

Re: Convert SCI0 vocab to SCI1 vocab?
« Reply #14 on: July 28, 2022, 06:40:13 AM »
Wow that's wonderful!
Brass Lantern Prop Competition


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

Page created in 0.121 seconds with 24 queries.