Stereo WAV file recorder (Ruby)

Post any examples or modules that you want to share here
Post Reply
User avatar
User108
Posts: 37
Joined: Thu Apr 18, 2013 9:52 pm

Stereo WAV file recorder (Ruby)

Post by User108 »

Hi all! I've made some changes to original mono wave recorder schematic found somewhere here. Now it supports mono /stereo recording not only streaming to disk, but also in memory (for slow hdd).
Also added an "Add" mode when recording appends to a previous one.
Could not make Add mode to work in disk record mode - that's why this mode works only in Disk Rec mode off.
Attached a simple delay to right channel to make stereo out of mono input. Hopefully will be of use to someone. I once stumbled upon somebody asking for this feature on StackOverflow, using the same Ruby wave class and mono wave recorder schematic..
Attachments
Wave file stereo recorder.fsm
(93.17 KiB) Downloaded 1217 times
HiAsm - A Visual Programming IDE for ALL programming languages:
https://hiasm.com
User avatar
User108
Posts: 37
Joined: Thu Apr 18, 2013 9:52 pm

Re: Stereo WAV file recorder (Ruby)

Post by User108 »

I think I should add indication of memory usage when recording to RAM - by counting recording buffer array size. But not shure of exactness of this method, because arrays in Ruby also use some other information for self organization.
HiAsm - A Visual Programming IDE for ALL programming languages:
https://hiasm.com
User avatar
User108
Posts: 37
Joined: Thu Apr 18, 2013 9:52 pm

Re: Stereo WAV file recorder (Ruby)

Post by User108 »

Here's an updated version. Old version used a lot of CPU > 70% in FL Studio when used as a plugin. I've changed for other audio library - WaveFile, first described here: http://www.dsprobotics.com/support/view ... f=3&t=1393
I have ported to its newest version 0.8 compatible with FS Ruby version 1.9.3.
Now CPU consumption is about 2%. Also tried to use its wave player capabilities, but it is still far from perfect due to my lack of knowledge.. I had to use some empty Ruby code with ticker in the schematics for player to work, for no obvious reasons. Who can fix this please do..
Also added some wave sound generators: sine, triangle, saw, square and 3 types opf noise - white, pink, brown.
All example code was written with a lot of help from ChatGPT 4.
Attachments
wave file stereo recorder - player and sound generator.fsm
(218.82 KiB) Downloaded 1205 times
HiAsm - A Visual Programming IDE for ALL programming languages:
https://hiasm.com
Post Reply