RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → General →

A late Christmas present : The return of the SOUND and ENVELOPE commands...

Subscribe to A late Christmas present : The return of the SOUND and ENVELOPE commands... 39 posts, 9 voices

Posts per page:

Pages: 1 2

 
Jan 5, 2017 12:36am
Avatar Anthony Vaughan Bartram (2454) 443 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.

 
Jan 15, 2017 2:23am
Avatar Anthony Vaughan Bartram (2454) 443 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
========
For ease of use and interoperability:
-————————————————-

  • Actioning remaining code review comments.
  • Now adding a dynamic range compressor so that the volume automatically adjusts based on how many channels are playing & I plan to increase the number of audio channels to 16 – and perhaps have an automatic channel assignment mode.
  • I need to honour the fractional sampling step – so I need to compute the time period that the fill-buffer has been requested to populate & then re-sample the output to the equivalent elapsed time of the caller’s buffer e.g. if hypothetically the system audio was limited to 22khz audio and DSP has to run at 44khz by design – therefore every other 16-bit value would be dis-guarded.
  • Adding stereo mix.
  • Then I’ll have a go at the legacy envelope parameters. If I switched on a legacy mode, then the envelope repeat pattern would need to start at a higher note (as my ‘virtual’ synthesiser chip has a wider range than the BBC did) and it will need to not wrap continuously.

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.

 
Jan 18, 2017 11:45pm
Avatar Anthony Vaughan Bartram (2454) 443 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.

 
Jan 19, 2017 12:00am
Avatar Anthony Vaughan Bartram (2454) 443 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…

 
Jan 26, 2017 12:07am
Avatar Anthony Vaughan Bartram (2454) 443 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.

 
Feb 21, 2017 12:24am
Avatar Anthony Vaughan Bartram (2454) 443 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.

 
Feb 22, 2017 1:34am
Avatar Anthony Vaughan Bartram (2454) 443 posts

I’ve upgraded RDSP to 16 sound channels.

For fun I’m going to add an optional override (* RLegacy 1 ) for SOUND 1,*,100,100 to override the system bell with a sample. Not sure its strictly road legal – but its only there as an optional mapping..

 
Mar 6, 2017 12:20am
Avatar Anthony Vaughan Bartram (2454) 443 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:

  • Support for modulating samples via the ENVELOPE command
  • Support for sample looping.
  • An ASM veneer for the shared sound call.
  • More examples including an ‘all’ obey file.
  • Crude bell override so that samples may be played for the system bell.
  • A master volume control.
  • Increased channels to 16.
  • Various bug fixes and code prettifying. Notably to ADSR so that decay now works and that the ADSR works more correctly with different volume levels.
  • SWIs based on allocated SWI range – although these have not yet been tested.
 
Nov 30, 2017 12:03am
Avatar Anthony Vaughan Bartram (2454) 443 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.

 
Nov 30, 2017 7:23pm
Avatar David Feugey (2125) 2628 posts

New possibilities. Great :)

 
Dec 27, 2017 2:21am
Avatar Anthony Vaughan Bartram (2454) 443 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.

 
Dec 28, 2017 12:59pm
Avatar Anthony Vaughan Bartram (2454) 443 posts

v0.31 has now been uploaded and may be downloaded from
RDSP
via the Download link
Download

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).

 
Jan 4, 2018 5:12pm
Avatar Anthony Vaughan Bartram (2454) 443 posts

I’ve just got the Chorus effect working.
Explanation of the Chorus effect on Wikipedia

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 :-) )

 
Jan 11, 2018 1:48pm
Avatar Patrick M (2888) 87 posts

Hi Tony,

Please let me know if you have any code that you can share with me so I can help with integration.

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

Reply

To post replies, please first log in.

Forums → General →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

General discussions.

Voices

  • Anthony Vaughan Bartram (2454)
  • David Feugey (2125)
  • Patrick M (2888)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys