A late Christmas present : The return of the SOUND and ENVELOPE commands...
Pages: 1 2
Anthony Vaughan Bartram (2454) 458 posts |
Just looked at Cybertron source code and could update this to work with OS Word 7 & RDSP with very little effort. It currently re-directs to SoundControl. So all envelopes will fail to play. Might act as a fun test case for the *rlegacy mode. |
Anthony Vaughan Bartram (2454) 458 posts |
Well I’ve just been manually writing an assembly code veneer around the buffer fill routines to shared sound so I can honour the shared sound API (by setting R3 on exit properly) and its inter-operating with DigitalCD correctly. The DSP function itself is C, but all inlined and with no library calls (C or any other kind) at all. So I think I can leave the stack at the default. Basically its equivalent to prettified assembler. What I’m currently doing
Once I’ve made those changes, I will produce another Alpha. The code will only go to beta once I have been allocated an SWI chunk by ROOL. |
Anthony Vaughan Bartram (2454) 458 posts |
I have implemented my dynamic range compressor. 8 channels playing a triangle wave at maximum volume no longer clips (distorts) at all. It uses a simple rolling average “avg = (avg + level) >> 1” to check for clipping (based on threshold ranges tested against avg). Low average amplitude input drops the compressor to 1/16th volume when not playing a sound, thus ensuring that a loud sound will not cause overdrive when the compressor has not had time to react. Then it ramps up or down over approximately 3 miiliseconds. So now I can increase this Virtual Sound chip to 16 channels safely… I think… Now need to make the compressor configurable (as well as optional)…. It made the drums sound lovely but the short attack is making some of the samples sound like they came off of a cassette tape. |
Anthony Vaughan Bartram (2454) 458 posts |
I’m looking forward to writing up a proper PDF and website pages so that other people can use this to improve the sound in existing RISC OS applications. It would be nice if I this were built into RISC OS so that we had more than the system beep, when something went wrong… |
Anthony Vaughan Bartram (2454) 458 posts |
Adding *help for the RDSP BASIC and ENVELOPE commands at the moment together with example commands. I plan to release a second alpha next week. |
Anthony Vaughan Bartram (2454) 458 posts |
I’ve now fixed the ADSR so it works correctly. Added the SWI ranges etc. However, I’ve now linked the sample playback to the envelope command as well. So ENVELOPE 129 etc will allow one of the 256 samples that can be loaded to be selected instead of one of the simple waveforms. Before the beta release (which I am including within the Mop Tops game release) I am also going to add the sample loop feature. I will include an example for this within the RDSP examples directory of BASIC programs. So this effectively brings sample & synthesis technology (i.e. similar to Korg M1) to RISC OS too. e.g. flute or piano waveforms. |
Anthony Vaughan Bartram (2454) 458 posts |
I’ve upgraded RDSP to 16 sound channels. For fun I’m going to add an optional override (* RLegacy 1 |
Anthony Vaughan Bartram (2454) 458 posts |
I’ve uploaded a new version: http://www.amcog-games.co.uk/downloads/rdsp-beta2-0_22.zip This is beta 2. The RDSP included in Mop Tops is the same module binary. However, I have improved the examples including a new effects demo.. Added:
|
Anthony Vaughan Bartram (2454) 458 posts |
Well this should perhaps read early christmas present… The third beta of RDSP is in progress. I’ve just made RDSP support stereo panning :-) I’m trying to write a short music demo with it… Also, trying to get that sound queuing feature done to. |
David Feugey (2125) 2709 posts |
New possibilities. Great :) |
Anthony Vaughan Bartram (2454) 458 posts |
I’ve now got the sound queuing feature working. This will be released in beta 4 tomorrow. Incidentally, the third beta of RDSP was quietly released to add stereo sound support for the drag’n’drop music example recently. I thought I would do an announcement once I had a few features added. I’ve also fixed a nasty bug in the XOR feature – which now works properly & sounds much better & is more versatile. I’ve got to update Cyborg to make proper use of that. Now I’m going to add the chorus effect shortly to also include in the new version. |
Anthony Vaughan Bartram (2454) 458 posts |
v0.31 has now been uploaded and may be downloaded from An example has been included which uses waveforms. Patrick – I’ve not tried splitting and queuing the two parts of a sample yet. But will add an example of this to the examples directory soon. I expect you are writing in C – so this will be a good excuse for me to test my SWI calls and write a regression test for those APIs. The OS_Word 7 calls will work ok. I should add a SWI so that you can supply a sample in memory that can be copied into RDSP so you avoid hitting the disc. Please let me know if you have any code that you can share with me so I can help with integration. I’ll do a general release e-mail and forum post tomorrow (time permitting). |
Anthony Vaughan Bartram (2454) 458 posts |
I’ve just got the Chorus effect working. I’ve implemented this using a simple single tap delay modulated by a low-frequency-oscillator. The effects bus plays back the modulated delay output. Hence – a chorus or phase effect can be created using a single SOUND channel (rather than 2) & more dynamic chorus effects are possible. I’ve also fixed the error reporting. So I’m now ready to do a release e-mail &upload version 0.40 this evening… (As I’ve had enough of RDSP coding for a bit :-) ) |
Patrick M (2888) 126 posts |
Hi Tony,
I have a very early and simple test program, which only ‘plays’ a song out into a raw PCM file and then exits. I’ve uploaded it here in case it’ll be useful: http://dusthillguy.ddns.net/folder/files/quickupload/MusicPlayerEarlyTestProgram.zip Patrick |
Pages: 1 2