Programming Query: Translate Enterprise Wokstix to Locomotive BASIC

Started by AMSDOS, 12:24, 17 April 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AMSDOS

Feel free to move to Programming area if you feel it's necessary.


I'm posting here because this program was written for an Enterprise Computer System, though when one looks at this code, it looks like Locomotive BASIC, until you look at the SOUND & other related statements (used in Line 30). Unfortunately I don't know Enterprise BASIC (otherwise known as EXOS BASIC), and the program was sent to CPC-Power.


I have to wonder though if something like this already exists for the Amstrad because the program itself sounds rather interesting. Otherwise does anyone know how those Sound related commands could be rewritten in Locomotive BASIC?


[attachimg=1]

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

andycadley

It looks like the Enterprise sound command takes a pitch value, a duration, right and left volumes (between 1 and 100, always the same on both channels) and a source value which is presumably one of two channels. It shouldn't be too hard to map those onto Locomotive BASIC equivalents. Then you'd just need to replace the values that get read into the array with suitable pitches for the AY. The accompanying text tells that they are all sharps, so it's probably a reasonable assumption you start with C# and just move up the scale.

SRS

I guess @Geco can help about that.

He's one of the Enterprise experts here.

AMSDOS

Thanks folks, I'll contact @Geco if they haven't replied here.


Looks like the program might take some interpretation to get the same result from Locomotive BASIC. Line 30 is the one that puzzles me. I can see it would relate to our ENV command, but the semi-colon bit is confusing, and then moves onto RELEASE which I don't know if the Amstrad has, there maybe something in the Firmware which deals with Sound Release.

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Geco

I think this program can be implemented quite easily into Locomotive Basic, there is no special filter, or effect usage, just simple envelopes.
In Enterprise you can define envelopes from 1-255 ( envelope 0 silent, 255 max volume)
One envelope can contain more patterns each pattern is separated by ;
Ex.
ENVELOPE NUMBER 10; 2,8,63,50;0,24,-16,100;-5,47,-39,50
contains 3 patterns , and the identifier of the envelope is 10, 2nd number is the difference from the actual sound in half tones, 3rd number gives the changes of left speaker (maximum is 63, here increase the volume from the actual volume with 8/64), 4th number is the change of right speaker (here the volume goes to the max from the actual value), 5th number is the duration in 1/50 seconds, 6th,7th,8th,9th are the same like 2nd,3rd,4th,5th.

You should create separate ENV and ENT's for reach the same effect, and as I remember well, in the envelopes in CPC the new values are stored not the changes, so some calculation is necessary to creat the same envelope in CPC.
I made the same during Sorcery+ conversion.

Here is you can find the description of SOUND and ENVELOPE commands on 108-113 pages:
http://enterprise.iko.hu/books/EnterpriseProgrammingGuide.pdf


Geco

As I see the envelope in Wokstix is an easy one.
you need an ENV which increase the volume from 0 to the max in 1/50 second, then an envelop which holds the volumes on max for 10/50 sec (I guess it can be skipped, just use the sound command) and the last ENV which moves the volume to 0 in 30/50 second.
an ENT which increase tone by 2/5 half tone in 1/50 second then an ENT which decrease the tone by 2/5 half tone in 10/50 seconds, and the last part makes no effect on tone.

Geco

I forgot the release, it can cause some difficulties, if the sound is shorter than the envelope before then envelope processing will be finished at that time and play back will be continued in release phase.

The book has good description about it.

andycadley

I wouldn't worry that much about the envelope though, I suspect it's just there to add a slightly "nicer" sound to each note, probably to get something "piano-like".

AMSDOS

Quote from: andycadley on 20:35, 18 April 16
I wouldn't worry that much about the envelope though, I suspect it's just there to add a slightly "nicer" sound to each note, probably to get something "piano-like".


May not be a bad option since I understand the SOUND better than those ENVs & ENTs and work from there.

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

AMSDOS

Might also help if I download an Enterprise Emulator, any recommendations?

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Geco

Quote from: AMSDOS on 03:41, 20 April 16
Might also help if I download an Enterprise Emulator, any recommendations?
My recommendation is mailto:https://sourceforge.net/projects/ep128emu/ , this is the best EP128emu, it should be configured to be able to read a file from HDD, but if I see well you just want to type the program, and you can save it as a snapshot.
There is EP32 also, it is a quite old, but functioning well, and XEP128, it is under development.

AMSDOS

I'll give EP32 a go, my emulator computer is getting a bit old now.  ;D 

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Geco

Quote from: AMSDOS on 01:27, 21 April 16
I'll give EP32 a go, my emulator computer is getting a bit old now.  ;D
EP128emu ran well on a PIII 833MHz also :D (if I remember well I used EP128emu V2 on PIII) , but sure PII or PIII was enough for EP32 , and I guess you have much newer machine ;)

AMSDOS

Quote from: Geco on 09:35, 21 April 16
EP128emu ran well on a PIII 833MHz also :D (if I remember well I used EP128emu V2 on PIII) , but sure PII or PIII was enough for EP32 , and I guess you have much newer machine ;)


It's a 2005 computer running XP with Celeron processor running around 1GHz @ half a Gb.  :D

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Geco

Quote from: AMSDOS on 03:10, 22 April 16

It's a 2005 computer running XP with Celeron processor running around 1GHz @ half a Gb.  :D
It should be enough for EP128Emu, and for all other 8bit machine emulators :D (java emulators excluded :D )

Powered by SMFPacks Menu Editor Mod