From the original SynthMaker forum (2004–2014), with its members’ names and dates.
smokeysteve22 ·
Hi, did anyone find a way to save wav's using the Wavesave primitive, with a larger outcome than 86.1kbs @ 16 bit int, 44.1khz? (approx. 1 second of playback)
I tried stacking up a bunch of mono to float primitives into a float stack but didn't work very well recorded for a little longer but the quality wasn't great.
Currently im using Mono to graph into float array - mem into wavesave primitive. (with the highest samples per second on the graph primitive)
Just want to use for 16 bit at 44.1khz.
Does anyone have a solution to this?
Is possible to create more 'memory' to record with, with the createmem function into the wavesave primitive? If so how much data would be needed/would it be possible to create memory that can adjust/be expanded to the size of wav being recorded? (hope that made sense if not sorry 😊 ).
Thanks in advance. 😀
trogluddite ·
smokeysteve22 wrote: Is possible to create more 'memory' to record with, with the createmem function into the wavesave primitive?
Yes, you are thinking along the right lines with the mem create.
Once you have created a larger 'mem', it is possible to record directly into it using the 'Wave Write' primitives. You might not see those in your toolbox, as they are hidden by default. To reveal them, go the the 'Options->Advanced' menu, and tick the box for 'R&D Components'. This reveals quite a few new goodies, and despite the warnings about 'in development' etc., they all seem to be perfectly stable.
The way they are hooked up to write to the 'mem' is a bit weird - for an example how to use them, check out the sampler schematic posted HERE.
The only slight problem is that you cannot dynamically resize the 'mem' while you are recording to it - you have to reserve enough memory for your longest recording in advance. However, once you finish recording, you can trim the 'mem' by converting to a float array, doing an 'Array section', and converting back to mem - so that you only save the bit that you want.
smokeysteve22 ·
Thanks for your reply, very helpful.
I was playing earlier and was able to create a much larger memory space (10mb+) by using 2 memcreate into the save wave primitive and then attached the audio into the savewave but it still only records 1 second or so of audio and the rest silent, althought the file is 10mb. 🙁
This is still at 16 bit 44.1khz
Can anyone explain why?
Also, i dont quite fully understand the writewave primitive primarily the 'index' function, is it where the location of the memory is temporally stored in layman terms before being saved at the desired location by the savewave?
It has a stream input, should this be code/asm input? (I don't know much code 🙁)
I will look into your recorder in more depth, thank you.
any help is appreciated greatly! 😀
cyto ·
smokeysteve22 wrote: Also, i dont quite fully understand the writewave primitive primarily the 'index' function, is it where the location of the memory is temporally stored in layman terms before being saved at the desired location by the savewave?
If you think of the wave as one long array of values, the "index" is the position where the writewave primitive will write the current sample. So yes, you need some type of "counter" to input to this. It must be done at sample-rate so you're pretty much restricted to code or assembly.
Here's a quick little example that I threw together that demonstrates how the whole thing might go together (including a very rudimentary counter)...
Remember, too, that when you create a memory buffer, the size of it is in bytes, not samples. As each float value takes up four bytes, you need to multiply your wave length (in samples) times 4. If you are recording in stereo, you need to multiply it by 8.
-cyto
smokeysteve22 ·
Thank you for that example! Perfect for what i was looking for.
You say that the counter you wrote is a very basic example, how is it limited/restricted and how to improve it? and why does it need to be improved? and how does it improve it?
Sorry for the questions!
I appreciate your time for helping me (to both)
This is probably very basic but im new im eager to learn. 🙂
Thank you again!
cyto ·
smokeysteve22 wrote: You say that the counter you wrote is a very basic example, how is it limited/restricted and how to improve it? and why does it need to be improved? and how does it improve it?
It's probably perfectly okay for most applications. I'm just a little uneasy about having to rely on the external triggering to control it. As it stands now, I imagine that it continues to "count" for potentially several hundred samples as it waits for the tick-25--->m2f--->s&h--->etc. routine to make its way back around. I'm sure there is a much more elegant way to approach this.
smokeysteve22 wrote: This is probably very basic but im new im eager to learn.
Not at all. I've been meaning to experiment with just this type of thing for awhile now, so thank you for getting the wheels in motion. I'm interested to see where this thread goes. Hopefully, more people can lend their expertise.
-cyto
smokeysteve22 ·
Thanks for replying man.
cyto wrote:
smokeysteve22 wrote: I'm sure there is a much more elegant way to approach this.
I see, it would more economical to use another method or approach, thank you for the example anyway 🙂
So your example allows me to record a 10 second .approx clip (1.6mb e.g.)
Memory buffer size is calculated by 44100 x 8 when using 44100 (khz) samples per second in stereo, should be around 3.3mb of memory if ive understood correctly.
So from this how do we create 'more' memory for the wave files (feel like ive completely misunderstood somewhere)?
Isit possible?
If its not, isit possible to set up a series of memory buffer 'events' through triggers once the 'memory size' has been reached trigger onto another memory buffer or reset to continue the recording process? so its a continuous process rather than individual 'samples'.
I hope i made sense and again, i appreciate all of your help!
cyto ·
smokeysteve22 wrote: So your example allows me to record a 10 second .approx clip (1.6mb e.g.)
Memory buffer size is calculated by 44100 x 8 when using 44100 (khz) samples per second in stereo, should be around 3.3mb of memory if ive understood correctly.
I'm sure there is someone on here that can explain this better than me, but I'll take a stab at it. SM appears to need to store the samples for the recording in the float32 format, hence the need for the samples X 4bytes X 2channels memory buffer size. However when you go to save the "wav" file, you can choose from many different sample formats. Since in the example I left the format input blank, it defaulted to the int16 sample format. I'm pretty sure this is what accounts for the discrepancy in the memory sizes. Someone, please correct me if I'm wrong.
smokeysteve22 wrote: So from this how do we create 'more' memory for the wave files (feel like ive completely misunderstood somewhere)? Isit possible?
Sure, but as trog said earlier, the size must be predetermined. You can't add more as you're recording. In the example, you can fill in any size you want into the "samples" box...
Doing so updates the counter and the memory buffer size. I would imagine things would start to get really "clunky" if you put too big a buffer size, though. I'm pretty sure the devs were only intending the export of wave forms and one-hit type files. Until we get stream-to-disk capabilities (don't hold your breath), I wouldn't count on this scheme to accomplish any major music rendering.
-cyto
smokeysteve22 ·
I see now, thank you for explaining that.
About the stream to disk, isnt it technically possible to create that but without realtime 'streaming'?
Say with your example, instead of using file dialog to save, use a boolean to trigger (false) from the true/false recording boolean into the save wave trigger with a default location so the file is saved automatically once it has finished recording.
but before being saved we run the saved memory back into a float array to 'cut down' the extra space used from the memory buffer then back into the save function.
e.g. 441000 of space - 15 seconds recording approx half of that space is silence. (trog touched upon this)
Once you click record again, trigger resets the memory buffer and counter to record.
We use a string array stack to push a string up into the default location adding a number say 1-10 to the current string.
for example say. C:\recording.wav ... then when to record again the string is pushed up to the top of the stack into the string - C:\recording1.wav etc..
this would be possible using like an arrangement depending on the number of characters?
I tried expanding the memory buffer pretty large something like '44100-00' and it didn't seem to be too bad was around 14 minutes of playback. Maybe not that economical but it works.
I can't really see many people recording past 14 minutes + unless recording a mix or something but then its still possible.
May sound very ambitious but it sounds realistic to me, is this possible?
sorry i keep saying 'we' 😀 haha.
Appericate the help as always!
tester ·
I'd like to record 60 minutes or more... 😉
tester ·
I used the example above, connecting self-running generator to the inputs. But... Soundcard is on; if I click reset, then record (and wait until boolean changes to false again) and then save - then I should get an output file? The problem is, that after saving dialog - I'm getting no file at all. What I'm missing? How can it be fixed?
tektoog ·
tester wrote: What I'm missing? How can it be fixed?
Just enter a full file name specifying the file extension when entering your file name after the dialog box asked you for it e.g: Mywavfile.wav
cyto ·
I just tested it and tektoog is right. As long as you have a valid name and extension, it should save just fine. If you want, you can add an value to the "filt" input of the file dialog so it always defaults to the .wav format. Like so...
-cyto
DigitalWhiteByte ·
I have tested the schematic, in WIN7 it always add estesion .wav in automatic when save.
what OS are you using?
tester ·
XP SP2 or 3. But oS adds extension automatically only if application tells the OS what the extension (filetype) should be.
I have downloaded it again, to have unmodified fresh schematic. Added that string. PC keyboard on, soundcard on (44.1kHz 16bit, stereo), reset, record (is recording = true), key tone until recording changes to false (scope shows the wave too), save - dialog opens and asks where to save the file, I give the name having the wav extension, and click OK. No file on harddisk.
Any ideas?
I know that this should work, even creating empty file, but creating anything.
tester ·
I found something.
When I try to save the wave to disk directly - no subfolders, like "D:\" - then it creates no file at all.
When I try to save the wave to any subfolder - like "D:\temp\" - it creates the file correctly.
Any ideas why?
Second problem.
Connected my free runing generator, so after the soundcard was "on" - the sound was "on" too. However created wav file has a few seconds of silence on the beginning; at default schematic - bit more than 2 seconds and I'm guessing this has to do with memory allocation period. Any ideas how to fix it?
//edit:
Second probem seems to be... unpredictable. Sometimes appears sometimes not. Has to do with memory reset?
Wrote something here? To have a post removed or your name hidden, write to [email protected].