Forums > MaxMSP

How export generated sound into audio file

Apr 15 2012 | 10:30 pm

Hi guys, i’ve a problem. I created a keyboard application that records what i play, but i can listen the melody only through the max application. I just want to export the sound into an audio file, for example mp3 file. How can i do?

Edit: oh well, i found the way to export the audio through "write" element. The application saves it as a midi file, there’s someway to export as mp3?

Apr 17 2012 | 1:24 pm

If you’re using MSP, you’d use sfrecord~. But it sounds like your patch is just generating MIDI that is being rendered by your computer (ie, by the OS and audio hardware, and not by Max/MSP). You could re-route the sound card output with Soundflower or similar and then record to sfrecord~.

Last time I looked sfrecord~ would only save non-compressed audio (AIFF, WAV, etc.) and not MPEG3. There are a number of standalone apps that will convert non-compressed to compressed audio for you, though. For instance, iTunes.

Apr 21 2012 | 12:23 pm

Thany u very much for answering. Aiff or wave format are good for me, but i really don’t understand how to record the midi sound generated from my keyboard application and save it on pc in aiff/wave through "sfrecord". I’m reading a tutorial and it says:
"sfrecord~ records to disk whatever signal data it receives in its inlets. The signal data can come directly from an adc~ or ezadc~ object, or from any other MSP object."
Well i made as shown in the example.. how i have to do? Here is my example patch.

  1. prova.maxpat
Apr 21 2012 | 2:19 pm

your patch demonstrates an error in understanding: MIDI is not sound.

Your Max patch is generating MIDI numbers (notes, velocity etc) which are sent to a MIDI synth – your computer has one built into the soundcard.

[sfrecord~] is for recording AUDIO only, and as Peter says, you need some way to route the audio from this MIDI synth back into MaxMSP.

There is no way in Max alone to record audio output of a non-native GM synth. I’ve never used the [vst~] object but perhaps you can plug a synth in here and get audio output?

This patch is a quick fix, and sounds sh*te because it’s recording the laptop mic picking up the speakers’ output.

— Pasted Max Patch, click to expand. —


Apr 21 2012 | 3:31 pm

Thank u. So MIDI is a set of informations sent to PC MIDI synth, and i need to turn back the audio to max? I found this
it might be a solution? Anyway in this case (where i download this application) it’s only me that can export the generated sound as a aiff/wave file right? No one could do the same using my patch on your own PC.

Apr 21 2012 | 3:59 pm

If you’re referring to LoopBe, this app passes MIDI to/from another DAW or audio program. Audio re-routing needs something else, like Soundflower – which I think is Mac only. I think. Not aware of any PC version, but you could always just buy a cheap external soundcard and connect out to in (carefully)…..

Apr 21 2012 | 4:13 pm

I’ve heard of "Jack" for Windows, which routes audio. Should be OK. Also the vst~ is an option, though each will have its own sounds. If you want the General MIDI sounds that you’re getting right now, the easiest option is to have another computer record it :) I would use Audacity, which can convert to mp3 as well, with the encoder installed.

Apr 22 2012 | 1:46 pm

Thank u all for the informations. Anyway i think i’ll follow the vst way, ‘cos i wanna my patch be universal. I’m checking it, here is the patch. I’m sure i’m wrong ‘cos i don’t know well how to link kslider to vst, and i’m not sure if "s_ tosvts_" is necessary too. I know i’m a noob. Any help will be much appreciated.

-- Pasted Max Patch, click to expand. --

Apr 22 2012 | 10:08 pm

no Max here so I can’t see the patch, but just be sure you’re sending "midievent" commands to the vst~ object. so

midievent 144 60 100 = noteon channel 1 middle C at velocity 100
midievent 144 60 0 = noteoff of the same (velocity 0 = noteoff)

hopefully I remembered that right ;)

Apr 27 2012 | 3:53 pm

Thanks i inserted them, but now i need to know how to play vst with kslider. Please help!

Apr 30 2012 | 3:31 pm

Ok guys i made it, but now just a curiosity. If i save an application there’s the possibility to "save" the vst instrument i loaded? I mean.. i would that vst could be always loaded in the patch everytime i open it, without load it everytime i use the saved application through the "plug" message.

Viewing 11 posts - 1 through 11 (of 11 total)

Forums > MaxMSP