New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

All aspects of programming on the Commander X16.
BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by BruceMcF »



On 8/31/2020 at 4:26 AM, DusanStrakl said:




Very cool! No I don't preserve registers.



OK, I've added PUSH, and PULL, to "comma" ("copy data into the current spot in the dictionary") whichever register storage to the hardware stack is required by the implementation.

I've only recently downloaded the CX16 emulator, and I don't have sound, but I'm pretty sure it will be straightforward. I don't touch interrupts at all at this point in Forth compiler development.

mobluse
Posts: 175
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by mobluse »


I tried both EFFECTS and EFFECTSHI with my program Aritm, but in both cases it deletes the screen and changes background color after the sound, and then you cannot see what you type. I use R38 of the emulator in most updated Windows 10.

I added these lines to Aritm:


Quote




10 IF PEEK($9000)=0 THEN LOAD"EFFECTSHI.PRG",8,1,$9000



3612 SYS $9000






Quote




10 IF PEEK($400)=0 THEN LOAD"EFFECTS.PRG",8,1,$0400



3612 SYS $400



 

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
User avatar
DusanStrakl
Posts: 127
Joined: Sun Apr 26, 2020 9:15 pm
Location: Bay Area, California
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by DusanStrakl »



On 9/12/2020 at 7:15 AM, mobluse said:




I tried both EFFECTS and EFFECTSHI with my program Aritm, but in both cases it deletes the screen and changes background color after the sound, and then you cannot see what you type. I use R38 of the emulator in most updated Windows 10.



I added these lines to Aritm:



 



Thanks for the comment Mikael. It seems that there was some interference between effects library and some VERA related actions from BASIC programs, specifically in your case, scrolling of the screen. I added some code to save and restore VERA state inside the IRQ Player. I tried both EFFECTS.PRG and EFFECTSHI.PRG with your program and it seems to work without problems now. 

mobluse
Posts: 175
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by mobluse »



22 hours ago, DusanStrakl said:




Thanks for the comment Mikael. It seems that there was some interference between effects library and some VERA related actions from BASIC programs, specifically in your case, scrolling of the screen. I added some code to save and restore VERA state inside the IRQ Player. I tried both EFFECTS.PRG and EFFECTSHI.PRG with your program and it seems to work without problems now. 



Yes, both EFFECTS and EFFECTSHI works for me in Aritm now. In order to use it with the "Try it now" button one would have to be able to upload disk images or have some way of including the sound effects library in a single file with my BASICv2-program. Edit: The "Try it now" button for Aritm with sound works now. I put both files in a zip-file and updated. It automatically selected the right file, but if it should choose wrong you can edit which file is the main program.

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
mobluse
Posts: 175
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by mobluse »


In the table EXPLODE and ZAP should switch places.

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
User avatar
DusanStrakl
Posts: 127
Joined: Sun Apr 26, 2020 9:15 pm
Location: Bay Area, California
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by DusanStrakl »



4 hours ago, mobluse said:




In the table EXPLODE and ZAP should switch places.



Thanks. Corrected.

mobluse
Posts: 175
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by mobluse »



On 9/25/2020 at 9:43 PM, DusanStrakl said:




Thanks. Corrected.



Yes, it's fixed in the first post here, but the table is still wrong on the file download page: https://www.commanderx16.com/forum/index.php?/files/file/62-simplest-sound-effects-library-for-basic-programs/

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
User avatar
DusanStrakl
Posts: 127
Joined: Sun Apr 26, 2020 9:15 pm
Location: Bay Area, California
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by DusanStrakl »



5 minutes ago, mobluse said:




Yes, it's fixed in the first post here, but the table is still wrong on the file download page: https://www.commanderx16.com/forum/index.php?/files/file/62-simplest-sound-effects-library-for-basic-programs/



Darn it. Thanks, you have eagle eyes. I hope that is fixed now too.

paulscottrobson
Posts: 305
Joined: Tue Sep 22, 2020 6:43 pm

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by paulscottrobson »


Did you used to own an ORIC ?

User avatar
DusanStrakl
Posts: 127
Joined: Sun Apr 26, 2020 9:15 pm
Location: Bay Area, California
Contact:

New community dev tool uploaded: Simplest Sound Effects Library for BASIC programs

Post by DusanStrakl »



4 hours ago, paulscottrobson said:




Did you used to own an ORIC ?



Ha, ha, yes I did. It was my first computer. Anybody who did will know these four sound effects ? 

Post Reply