Hi, let me introduce myself since I’m new to this forum, my name is Alejo Ponce. I have been using Csound since last year and at the end of last year I started using Cabbage, I liked the program a lot since it seemed quite friendly and I was able to quickly start making some vst instruments knowing something about Csound previously.
The biggest drawback I’ve found in Csound is the lack of an oversampling implementation to avoid aliasing. Although I have been able to create custom bandlimiting tables with Vco2init and Vco2ft, I still believe that the aliasing that processes such as FM, Ring modulation, effects, etc. can produce. could be inconvenient. I know that the issue has been discussed in these forum before and that 2 .csd files with possible solutions were shared. With none of those 2 I had any luck. However I have found some possible workarounds that involve the use of external software. I’m going to start talking about these solutions because I think that maybe it could help other people and also it would be a good way to understand the question that I would like to ask about the oversampling .csd uploaded by Rory.
What I have done is this: I have created a simple instrument the is same as the initial instrument but with the only difference that instead of having a Vco2 Saw oscillator it uses an oscili opcode that reads an non-limited table therefore it produces aliasing. As I said before I know that this can be fixed with band-limited waveforms but I did this for testing oversampling solutions.
The workaraounds that I have found are:
Reaper : in the latest version it has a feature that can apply oversampling to VST instruments and plugins. I have tried loading the test instrument that creates aliasing in Reaper and when applying oversampling the aliasing disappears at all. It seems to be the best and easier workaround (for the people who use Reaper).
Metaplugin -DDMF: this is a plugin wrapper that loads other Vst instruments inside, it has an oversampling option. I tested with this instrument and it does the same that Reaper, turned oversample on and the aliasing was totally gone. It is not as easy than the option in Reaper (which is just pushing a button) but it is not difficult at all and it works.
Ableton: I discovered that offline render at higher samplerates that the project (96000, 192000, etc. if the original sample rate is 44100 or 48000,) forces the plugins to run at higher sr and the result is that the aliasing is gone in the rendered audio file without being foreced to change the audio hardware sr. This seems to be something unique from Ableton because I tested the same in Cubase and Studio One and the alliasing was still in the audio files. It seems that with other daws the plugins work at the original sample rate and then are converted.
4)Puredata: A Cabbage/Csound vst colud be used inside puredata with the vstplugin~ object and PD has a simple way to oversample with the block~ object. There is an example at help—browser—audio examples—J07. oversampling. I`ve used the test instrument in combination with that patch and the aliasing was gone.
Although these solutions are useful, I think they are not ideal since they all involve the use of some external complement, and it would be very cool if there was a solution from within Cabbage/Csound.
In the search of that solutions I have tested the test instrument with the patch “oversampling_Rory_august_2020.csd” I’ve tried to do something simple and just connect the test waveform with aliasing to see if oversampling would fix it like happened with the alternatives mentioned above and it didn’t work for me. I’ve just tried to remove the code related to the transfer function and connect the aliased saw waveform to the oversampling and see if it fixes it, probably I’m doing something wrong and wanted to ask @rorywalsh f it’s possible to take a look at it and tell me what is wrong with the code. The only difference I hear is that the oversampled version sounds quieter. I attach the simple instrument with which I have done the tests and the modified oversampling patch.
With the patch from @Oeyvind, I did not have luck in making it work also.
I apologize if this post has been a bit long, but I really think that since Cabbage is such a nice and usefullsoftware it would be good to find a solution to this and if it is not possible I hope that at least the workarounds could help someone, thank you very much in advance.
Test instrument.csd (631 Bytes)
oversampling_Rory_august_2020 (mod).csd (1.9 KB)
oversampling_Rory_august_2020.csd (1.7 KB)