SynthMaker

writing audio to wav file

Archive · 2012 9 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

tester ·

I have a question regardding this. I assume, that it is possible to make "save/play audio to wav file" (some quick example or cues "how to" and how to set output time limit - appreciated). Some things concerm me however for standalone/exe synth, maybe you experimented with it.

Will it play at 1:1 speed or will it generate digital stream to file at the speed of computer?

If 1:1, then will be the recording complete (all audio data; if the synth is heavier than computer, then file generation will be just slower), or will it lose/skip some audio data (thus - produce dropouts) when dealing with computer slowdowns?

cyto ·

There is no "stream to disk" function in SM. However, you can write to a buffer (size must be predetermined) and then save that to a wav file. To do this this, you need access to some of the "R&D" components in SM (IIRC), which you can get by selecting the "show R&D components" (or something like that) in the advanced settings menu. There have been a few threads about this recently here on the forum, which you can find by searching.

-cyto

EDIT: here's one to get you started: Wave Save

tester ·

Thanks, just found the same thread.

oddson ·

You might find this helpful for sorting out how Save Wave works.

tester ·

Yhm... Second trigger from the left is responsible for saving the file. One writer module is unused and unneeded I assume. I guess, that I should connect stereo signal/audio output to the writer instead of "poly to mono connectors".

What can I remove from this schematic, to make it work with simple stereo (osc) module connected to the inputs? I see the index input is used in some way.

Ooops, time to get some sleep... It's morning again! 🙂

oddson ·

tester wrote: Second trigger from the left is responsible for saving the file.

Yes... the other makes the buffer. This is a fairly simple example and it's not meant to be how you'd use it for real but if you study this your more likely to work out what's needed than if you have to dig around in a more complex (but more real-world) example.

tester wrote: One writer module is unused and unneeded I assume.

Yes... it's there to show you that you can write mono data too. One tricky bit is that if you use the stereo primitive to grab data but don't tell the mem buffer that it's for two channels it will playback both the left and right samples in sequence as mono and it will sound one octave lower. The other tricky bit is to realize the buffer takes bytes as an input and you need four bytes per channel per sample.

tester wrote: I guess, that I should connect stereo signal/audio output to the writer instead of "poly to mono connectors".

It guess that depends on what you're doing. I used an example where the start is triggered by MIDI and therefore the writing to the buffer is also triggered (or can be). If you're grabbing from a stream of running data you'll need to trigger whatever you use for an index counter.

tester wrote: What can I remove from this schematic, to make it work with simple stereo (osc) module connected to the inputs? I see the index input is used in some way.

Why would you want to record the output from a simple oscillator? If it's MIDI triggered and has an envelope you'd want to do something similar to what I've done where the MIDI2Poly module's gate trigger is used to start the index counter. If you're grabbing from an ongoing stream you'll need a button to tell it start the index running.

Like I said this is a simple example to help you experiment with how it works. These primitives are a little tricky for the reasons I've indicated but I can't anticipate exactly what you're trying to do so I think you need to play around with it until you understand how they work.

Oh. there is one other tricky but that might confuse. The direction of data flow is backwards in the write module's connection to the Mem create. You create a memory buffer and then it's written to through the connection that makes it seem the data is flowing to the write module but it's really the reverse.

tester ·

@oddson

If one simple oscillator gets two channels, and a series of modulators and slow modulators on modulators, and is multiplied by dozens of independent such units - then it is no longer so simple as you think. It is also my adventure in optimizing the interface and aventure in finding interesting and practical solutions, useful. I'd like to record such sounds, because I deal with them in my daily life and work, and I reached certain level where the old syntrillium's cooledit is simple not a good companion anymore.

I'm not a midi person nor programmer; I just have sound related ideas, to which there is no software (or it's too complicated to know that this is it). I guess I begin to think about understanding how to inter-connect it to midi - when I finish the structure. The concept I'm working on now - is supposed to be multi-osc parametric soundscape generator, some kind of research/exploratory thing ("is 'what you see/think' the 'what you hear'" to provide an example). Keep in mind, that some people (like me) see decibels, hertzs, ratio relationships and such kind of things - in numbers and values and shapes. It does not means, that understanding SM is always easy. Most of what I'm doing is based on intuitive thinking, trial and error experimentation and reverse engineering so to speak. Some things I do - I don't understand them yet in details, but simply know where to put some value or cable or how to extend it by duplication of some of the elements.

What I do understand however - are the general cues of what I will need in any of my projects no matter what I do. Multi-panel guis, presets and sub-presets, writing results to disk as a wave file, linking sliders with each other and with corresponding numeric values, signal processing possibilities, complexity vs performance (realtime vs offline processing) if it gets more complicated and then - keyboard shortcuts integration and midi integration. These are basics for me. If I can get one concept/project to work, then I know, that any other will work too.

😉

oddson ·

Cool -- sorry if I sounded snooty about it...

I'm more than happy to help if you run into problems and have further questions. 🙂

tester ·

Thanks!

I'm glad too, that I can provide some useful gadgets, modifications or partials of more extended schematics. Last time I felt that way about 10-12 years ago, when the internet just began to evolve here. Some of my dreams are perhaps even 15 years old, but it is today when I can make them true 😉

If two or three weeks ago you would tell me that today - I will write an audio app - I would not believe 🙂

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.