Adding New Voices In RISC OS
Angel Perez (2908) 84 posts |
I recently found a source code to add new voices to the standard 9 for the audio generator in the RISC OS operating system. I had upgraded the Raspbian and RISC OS systems on my Raspberry Pi 2 and while I was editing one of my BASIC programs in RISC OS, I suddenly discovered 8 new voices added to the usual “WaveSynth”, “StringLib” and “Percussion,” sounds. These include “Bell”, “HammondOrgan”, “Saw”, “ChurchOrgan” and “Flute” but I don’t know where they came from. It revealed to me, though, that through the “Sound_InstallVoice” and any others tied to this, thus through SWI calls, I can create my own custom sounds, in the “slots” (as indicated in the BBC BASIC manuals) 1 to 32. But I need a better, more comprehensive way to do this. I prefer to leave the “voice” installation slots 1 to 9 as-is and instead use voice slots 10 to 32. I need to know the proper syntax via the SYS statement in BASIC for sound commands such as Sound_InstallVoice. The source code I found revealed DATA statements with the names of the sound indices and 26 bytes of hexadecimal numbers. The latter suggests that the values entered to create the new sound are similar to how you entered the parameters through the BASIC statement ENVELOPE. Since the ENVELOPE statement is useless in RISC OS on the Raspberry Pi, I had to study the nature of the way that the sound commands like Sound_InstallVoice work. I just want to create a new voice individually at any sound index from 10 to 32. I need an explanation on how the 26 bytes of hexadecimal code affect that particular sound index. Again, I believe it is similar to the way the ENVELOPE statement was used on earlier Acorn Computers. Another thing I noticed that, instead of being retained after shut down of the Raspberry Pi, the OS resets back to just the 9 basic sound indices. My purpose is especially for classic arcade games. Among the 26 bytes of hex data (according to that same source code) areas affected may include envelope, pitch portamento and waveforms. |
Chris Hall (132) 3559 posts |
The voices you mention came from !SignalBox in the Diversions folder. |
Angel Perez (2908) 84 posts |
You mean the SimCity-like railroad game? |
Angel Perez (2908) 84 posts |
But when I ran a check on the user library of voice generators, I ran into Chapter 6 of the Archimedes Gamemakers Manual. There I found a BASIC program called MusicMaker. Sadly, though I found a source code there to do what the !SignalBox executable does to the sound module of RISC OS, the code is riddled with typos and compilation errors that lead me to the "Missing "{"" and “Arrays cannot be redimensioned,” Therefore, I will need a source code for !SignalBox (probably written in C) to verify the writings and compare the source code to that of MusicMaker. But thank you so much for the heads-up on the !SignalBox game application as the source of the new voice generators I discovered! But it’s not over yet! Thank you again! |
Steve Pampling (1551) 8172 posts |
As I said in a post after I properly woken up yesterday, the download link at the top of th page with the broken MusicMaker code on it does work and the zip file contains the original BASIC files. |
Angel Perez (2908) 84 posts |
That is the reason why it is a better habit to use line numbers in BASIC coding than none at all. If you shell into BASIC by pressing F12 and type BASIC, if you attempt to load a BASIC program edited with StrongED (for example) that is written without line numbers, you will get a “Bad program” message from the BBC BASIC interpreter. Where is that *.zip file, though? In that same page I described to you? You mention that MusicMaker runs full screen in an old-style numbered mode. Again, we must maintain the habit of using line numbers in BASIC no matter how modern the operating system. This helps settle those specific compatibility issues as far as line numbers are concerned. All MODE statements in BASIC will always display what is programmed full-screen. Depending on the monitor you use and the resolution and the frequency emulated, there are modes that cannot be used through the use of today’s monitor displays (HDMI) and therefore the MODE statements will automatically set the colour palette to 256 colours instead of the 2, 4, 8 or 16-colour palettes as in the case of VGA monitors, for instance. Thanks again, Steve-O! |
Steve Pampling (1551) 8172 posts |
Top of page http://www.riscos.com/support/developers/agrm/index.htm
I have a habit of skipping upward in a web page hierarchy to the master page and then nosing around. In this instance it gets you a link to all the programmes covered in the complete article/book |
Angel Perez (2908) 84 posts |
I should say, Steve, that I have been writing programmes in BASIC now for over 30 years and still counting! The RISC OS environment breathed new life into my tradition gaming programming in BASIC. Remember, of course, that the BASIC interpreter included in RISC OS descends from the BBC BASIC interpreter found in the BBC Micro computers. The Archimedes series was an obvious answer to the Apple Lisa and Macintosh. I find RISC OS much more pleasant to surf the web than on a Windows computer, though the mechanism for signing up to create new accounts while browsing with NetSurf is extremely defensive and don’t take to “bots.” I’ll look up that link and find out more about that download. |
Steve Pampling (1551) 8172 posts |
I never really thought of the Archimedes like that at all. That was possibly because my support work for IT kit took me into a couple of offices with equipment bought in by Apple fans and I found the Mac to be rather primitive compared to the Archimedes I had at home. |
Angel Perez (2908) 84 posts |
Windows is still a bad joke, my friend! Now there are rumours that old PC computers that left the factory with Microsoft Windows from Vista and up would be automatically programmed by Microsoft via the Internet to update to Windows 10 (and later) against the users’ will! But even before that, I had a Hewlett-Packard XL-768 that I bought for $1,600 at the end of 2000. As soon as I plugged it in… the immediate response I got was “Your PC is dangerously low on resources,” It had a 60GB hard drive, a multi-media CD/DVD/CD-R/CD-RW drive, a Pioneer DVD-115 DVD player and 128MB of RAM. It was total rubbish in a life span of less than 3 years! It used Windows Me. The grpahics card went to the bowels of Nottingham, the DVD player seized and finally the hard drive got swallowed by The Lady Of The Lake! As for the BASIC programs from the Archimedes Gamemakers Manual, I downloaded the whole bundle and, at last, MusicMaker works just the way it is supposed to. But unlike executables like !SignalBox, though, when you exit the program it reverts the voice generators back to the normal RISC OS settings. This could well greatly help with my arcade game programmes and helps simplify coding. Plus, programs such as Music and Scroll are bound to further help with scrolling games and looping background music – considerably! I had a bit of trouble with looping background music and the “Music” programme may help resolve that issue concerning the sudden silence when I attempt to play back long song plays. |
Fred Graute (114) 645 posts |
If you save a file from StrongED typed as BASIC it will always be tokenised with line numbers. If you save the file with any other filetype then it won’t be tokenised so it’s always a “bad program”. |
Steve Pampling (1551) 8172 posts |
I work in support, failings in MS Windows create the need for part of the work I do and that pays my mortgage.
Glad to hear it. |
Chris Hall (132) 3559 posts |
I will need a source code for !SignalBox (probably written in C) Download the app from !Store – the BASIC source (15907 lines of BASIC) is included. But there is a bout twice as much BASIC that generates the data files and the sound module elsewhere which I have not released. |
Rick Murray (539) 13851 posts |
Ah, yes, because everybody uses Linux now. Oh, wait, no they don’t…
“Rumours”? Obvious FUD is obvious FUD. Newer versions of Windows will nag you incessantly to upgrade to Win 10, and may even trash your allowance if you’re on a crappy ISP that would penalise you for several gigabytes (which isn’t a lot the days), but the final decision to install or not rests with the user. It may only be one button that promises the moon on a stick, but it’s a very different proposition to installing itself.
That usually means somebody has been installing crap on it. Was it a showroom model? I got my first Windows PC circa 1997 and it was chock full of rubbish. The best way to resolve the issue was to reformat the harddisc and reinstall Windows and Works and go from there.
Definitely sounds like somebody had been messing with the machine. For several years my main XP box was a 20GiB drive and 32MiB RAM. It was a bit tight, but not impossible. Turning off some unnecessary services helped as well.
Isn’t that about the expected lifespan of a computer? Sure, we can make ours last longer (my EeePC must be about seven or eight now), but in consumer terms I think three years is typical.
Well there’s your problem. The Win32 system was crap. It was abandoned shortly after for XP based upon the NT kernel. Given ME was released in 2000 and XP in 2001, I rather imagine the good programmers were working on XP and the “stagiaires” (work experience) programmers were doing ME just so Microsoft had something to release that year.
My NAS box’s graphics card has failed (the fan no longer works) and the thing crashes at anything over flat VGA (imagine XP at 640×480!). The DVD writer is now in the P4 box. The two harddiscs are IDE so I’ll have to see if I can piggyback them on to the CD-ROM cable (one by one) of the P4 box long enough to dump the video files (my early animé) onto DVDs. Then I’ll probably salvage – spare FDD, spare PSU, etc. I don’t believe in chucking out a computer because a part has failed if the other parts can be recovered and used elsewhere. That’s why at one time my RiscPC had four harddiscs hanging out the back of it. ;-) |
Angel Perez (2908) 84 posts |
Nevertheless, Steve, in 2004 I got a far superior PC than my only HP ever owned, an e-mahcines T-3904. It had nearly 3 times the GB disk space in the hard drive (160GB,) 512MB of RAM and an AMD processor with Windows XP. As far as history in my personal collective can describe, Windows XP ranks as the best Microsoft operating system I ever used. In longefity? It outlasted the putrid HP XL-768 in daily use – well past 10 years! It died as a result of memory failure of a removeable memory chip and easy to repair but that was all. Meanwhile… it seldom hung or failed. Its Internet connection slowed down merely by age but otherwise it ran like a dream. It would be my last desktop computer I would ever purchase. |
Angel Perez (2908) 84 posts |
So !SignalBox was written in BASIC before it was ported into an executable? So far I only got the !SignalBox file itself but not the BASIC source code. It must be in the other file listing at the !Store, with an “X” as part of the naming. |
Chris Hall (132) 3559 posts |
No – open !SignalBox and inside is the BASIC programme SigBox. It was written in BASIC and then compiled using Silicon Vision’s RiscBASIC compiler. When 32 bit came along I had to rewrite it so that the horribly buggy and idiosyncratic ABC BASIC compiler could be used to generate 32 bit code. I also ported it to Windows, using BBC BASIC for Windows, for which I created an exe using the BB4W compiler. The Windows source BASIC has not been released. |
Angel Perez (2908) 84 posts |
Hmmm… how do I actually “open” the !SignalBox file which you describe that inside is the BASIC programme? The RiscBASIC compiler must have been what made it into an executable with the sound module included in the executable. |
Chris Hall (132) 3559 posts |
SHIFT-double click. |
Angel Perez (2908) 84 posts |
I have been doing a little work and having fun with the MusicMaker utility. I managed to create a few sound effects with that brilliant sound module creator programme. |
Angel Perez (2908) 84 posts |
What I intend to do is examine !SignalBox and determine if a custom sound module is included in it. |
Angel Perez (2908) 84 posts |
Chris Hall: There is one problem with MusicMaker. The sound modules created with it are not compatible with the 32-bit system. Either the program should be rewritten or I need to convert the modules to 32-bit. |
Chris Hall (132) 3559 posts |
Well it’s 14 years ago so I can’t remember what I did! I think I just fiddled with the header to add the 32bit flag. |
Angel Perez (2908) 84 posts |
And after Fred Graute gave me a piece of code to correct that issue, now I am prompted with “‘%’ in module title,” I don’t know where that “%” is but it is the one remaining detail to conquer. |
jon scott (1841) 23 posts |
I am a bit late to the party, A few years ago I created/recreated a couple of applications for creating relocatable sound modules, I think I hacked in some HAL test code into the module, these create 32 bit OS compatible sound modules, not particular great quality being 8 bit (I believe) but they may be of use if not the code may be useful. The programs are !Wavegen and !Voicegen32. They are available at |