Skip to content

Feature: Automatic Stem Exporting#2260

Merged
seangoodvibes merged 29 commits into
SynthstromAudible:communityfrom
seangoodvibes:Stem-Export
Jul 10, 2024
Merged

Feature: Automatic Stem Exporting#2260
seangoodvibes merged 29 commits into
SynthstromAudible:communityfrom
seangoodvibes:Stem-Export

Conversation

@seangoodvibes

@seangoodvibes seangoodvibes commented Jul 7, 2024

Copy link
Copy Markdown
Collaborator

Automated Stem Exporting

IMG_9747.mov

Description

Added STEM EXPORT, an automated process for exporting CLIP STEMS while in SONG VIEW and INSTRUMENT STEMS while in ARRANGER VIEW. Press SAVE + RECORD to start exporting stems.

Now with one quick action you can start a stem export job, walk away from your Deluge and come back with a bunch of stems for all your clips and arranger instruments.

Stems Folder

Stems get exported to a new SAMPLES/STEMS/ folder.

Within the STEMS folder, a folder with the SONG NAME is created for each stem export job which contains all the WAV file recordings.

If the same SONG is exported more than once, a 5 digit number incremental number is appended to that song's folder name.

Stem File Names

Stem's are given a meaningful name in the following format:

ClipType_ExportType_PresetName_FileNumber.WAV

For example:

SYNTH_CLIP_PRESETNAME_00000.WAV
SYNTH_TRACK_PRESETNAME_00000.WAV

Shortcuts to Start/Stop Stem Exporting

Starting Stem Export

  • Hold SAVE + Press RECORD while Playback and Record are disabled to launch Stem Export process
  • When the stem export is finished, a dialog will appear on the display that tells you that the stem export process has finished. Press SELECT, BACK or any PAD on the grid to exit the dialog.
  • Note 1: In Arranger View, any Instruments that are MUTED will be excluded from the stem export.
  • Note 2: Stems are exported without Master (Song) FX applied

Cancelling Stem Export

  • Press BACK to cancel Stem Export process
  • When you cancel stem export, a dialog will appear on the screen asking you to confirm if you want to cancel the export. Press on the SELECT encoder to confirm that you want to cancel. Press BACK or any PAD on the grid to exit out of the dialog and continue with stem export process.
  • Note: When you press BACK, the stem export still continues in the background until you confirm you want to stop.

Addresses: #2254

Videos

IMG_9757.mov
IMG_9771.mov
IMG_9773.mov

@github-actions

github-actions Bot commented Jul 7, 2024

Copy link
Copy Markdown
Contributor

Test Results

72 tests  ±0   72 ✅ ±0   0s ⏱️ -1s
11 suites ±0    0 💤 ±0 
11 files   ±0    0 ❌ ±0 

Results for commit 2e361c6. ± Comparison against base commit c57727c.

♻️ This comment has been updated with latest results.

@seangoodvibes seangoodvibes force-pushed the Stem-Export branch 10 times, most recently from dec2730 to 93d3169 Compare July 7, 2024 06:49
@sichtbeton

sichtbeton commented Jul 7, 2024

Copy link
Copy Markdown
Contributor

First of all: this is amazing. As far as I remember, this feature is the most requested of alle times in the community of the Deluge, by far. So thank you so much for doing this! Excellent:

Bugs i found so far:

  • a sample that started right at beginning was dropped, so it only got recorded after 1 bar
  • the mute buttons were not returned to the previous state

a couple of thoughts / improvements:

  • a final screen after export that show a little status report and doesnt go away, bc when you leave your deluge on for a complete song with maybe 30 minutes export time in total, you want to be sure, that everything was completed
  • export to subfolder
  • export with filenames that match the tracks / clips names (and even the song) for easier finding and reference
  • export the little export status screen into the folder as a simple text file, so you can quickly see what has been exported without needing to manually check every file
  • currentlyto cancel the export works with select but the resampling still want to finish and is not aborted. and hitting select feels unnatural. so maybe "back" to cancel and since some exports could take 20 minutes or more for complete songs, it would be good to have a confirmation: "do you really want to cancel?" so you don't accidentally cancel a lenghty process and have to it over and over again. also stopping the resampling after conformation would be less confusing to the user.

more additions, which are probably a different feature PR altogether:

  • resampling option menu while exporting
    • master dry, so no master compressor / fx / eq
    • master stereo / mono

but, besides the little bug not recording from the very first second on, even in this state it already is a MAJOR improvement for exporting tracks.

my prayers have been anwered.

thx!

@seangoodvibes seangoodvibes changed the title Feature: Automatic Stem Exporting [DRAFT] Feature: Automatic Stem Exporting Jul 7, 2024
@seangoodvibes seangoodvibes marked this pull request as draft July 7, 2024 17:04
@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Feedback from @trappar for future PR

I feel like a robust implementation for this should eventually support things like:

  • A menu that pops up when batch export is triggered with export options
  • Ability to mark/select/deselect tracks for export
  • Ability to optionally turn off various things like FX (reverb, delay, etc) and compression during export. Would need to temporarily set all these values and then restore them.
  • Disable sound output while exporting.
  • Ability to select an output directory and maybe auto name files in some slightly better way like including the preset name and an index.
  • Export functionality accessible via menu in addition to button combo.

@sichtbeton

Copy link
Copy Markdown
Contributor

And if this all wasnt too much of a wishlist:

  • a way to disable normalization while exporting to not mess up volume levels
  • mute a track in arranger to be excluded from exporting

@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Another request on Facebook:

  • configurable delay between exports to multi track record audio out of the deluge into an external device (eg daw)

@trappar

trappar commented Jul 7, 2024

Copy link
Copy Markdown
Contributor

Re: normalization

If you’re able to disable that I’d definitely make that an option rather than always disabling it. Personally if I was going to export stems for a regular DAW I’d prefer the samples be normalized so that I could do my mixing in the daw rather than baking mixing into samples.

I guess if the thing being exported is clips, I'd expect normalization. If it's exporting the arrangement (stems) I would not expect normalization. Perhaps these are really two different features?

@sichtbeton

Copy link
Copy Markdown
Contributor

Yep think so too, it should be optional. With for exporting stems and have the mix be kept intact or normalized for maximum levels.

@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Re: normalization

If you’re able to disable that I’d definitely make that an option rather than always disabling it. Personally if I was going to export stems for a regular DAW I’d prefer the samples be normalized so that I could do my mixing in the daw rather than baking mixing into samples.

I guess if the thing being exported is clips, I'd expect normalization. If it's exporting the arrangement (stems) I would not expect normalization. Perhaps these are really two different features?

I think a Normalization menu setting that has 4 options would work:

  • OFF - no normalization added at all to stem exports
  • CLIP - only adds normalization to stem export for clips
  • TRACK - only adds normalization to track export for arranger instruments
  • ALL - adds normalization to both clip and track stem exports

@seangoodvibes seangoodvibes force-pushed the Stem-Export branch 2 times, most recently from 5ccea28 to 0c6256a Compare July 8, 2024 07:01
Added automated process for exporting clip stems while in song view and instrument stems while in arranger view

Shortcuts are:
- Hold Save + Press Record while Playback and Record are disabled to launch Stem Export process
- Press Back to cancel Stem Export process
Don't start recording for MIDI and CV outputs

@m-m-adams m-m-adams left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a change to yield instead of using the timer manager I think this looks good!

Comment thread src/deluge/playback/playback_handler.cpp Outdated
Comment thread src/deluge/gui/views/session_view.cpp Outdated
Comment thread src/deluge/gui/views/arranger_view.cpp Outdated
meaningful wav file names are now set for stem exports in the format of:

OutputType_StemExportType_OutputName_IndexNumber.WAV

example: SYNTH_CLIP_BASS SYNTH_00000.WAV

example: SYNTH_TRACK_BASS SYNTH_00000.WAV
Updated stem exporting to use yield which removed need for timer and enabled me to clean up a lot of the extra variables that were added to manage the timer loop.

Removed code that was arming clips before recording as it was not necessary.
Added context menu for cancelling stem export so that you can confirm if you really want to cancel or not
If you're in the cancel context menu when the stem export job is completely finished, exit out of it
Accidentally moved the code for my previous fix to the wrong spot in one my refactorings oops
Excluded muted tracks in arranger view from stem export
Stem Exports are now exported before Master FX (Output source = MIX)

@m-m-adams m-m-adams left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit, looks good!

Comment thread src/deluge/storage/audio/audio_file_manager.cpp Outdated
Moved code for getting full stem file path out of audio file manager and into the stemExport class
@seangoodvibes seangoodvibes marked this pull request as draft July 10, 2024 20:41
Comment thread src/deluge/processing/stem_export/stem_export.cpp Outdated
Comment thread src/deluge/processing/stem_export/stem_export.cpp Outdated
Fixed bug where resampling wouldn't end when recording source was set to mix
@seangoodvibes seangoodvibes marked this pull request as ready for review July 10, 2024 21:13
@seangoodvibes seangoodvibes added this pull request to the merge queue Jul 10, 2024
Merged via the queue into SynthstromAudible:community with commit e43ad56 Jul 10, 2024
@alifeinbinary

Copy link
Copy Markdown
Contributor

Monumental PR. Thank you @seangoodvibes !

@feilsch-hering

feilsch-hering commented Aug 18, 2024

Copy link
Copy Markdown

Hi, first of @seangoodvibes all thanks for implementing stem-export!
I have a question/ problem though: I understood that when you are in arranger mode, and start the process, the whole arrangement of each instument would get exported in individual wav-files, but when I try it, I only get one bar of each instrument instead of im my case 5:20 min long wave files, which means I would have to recreate the arrangement in an DAW to have the complete arranged track.
So what did I get this wrong, or is there another way to manage to get the full arrangement with the individual wave-files?
thanks in advance

@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Hi, first of @seangoodvibes all thanks for implementing stem-export! I have a question/ problem though: I understood that when you are in arranger mode, and start the process, the whole arrangement of each instument would get exported in individual wav-files, but when I try it, I only get one bar of each instrument instead of im my case 5:20 min long wave files, which means I would have to recreate the arrangement in an DAW to have the complete arranged track. So what did I get this wrong, or is there another way to manage to get the full arrangement with the individual wave-files? thanks in advance

Hey, that shouldn't be happening. As you expected, it should be exporting each instrument up to the length of the arrangement. Other people have reported a similar bug. Are you able to share a collect all saved version of your song so I can try and see what's going on?

Can you confirm if this also happens with a new song?

Thanks

@feilsch-hering

feilsch-hering commented Aug 18, 2024

Copy link
Copy Markdown

Sorry I'm not sure what you mean with "collect all saved version". If you explain a bit more what exactly you need, I can try.
Anyways I started the track with a beta of community 1.1 if I remember right (5th of june) or maybe it was still Community 1.0, not sure and I updated to 1.1 while working on it. I tried the stem-export with the todays nightly and previously a nightly from ~2 weeks ago, both times I only had one bar of the instruments, which was strange because the rendering took quite long. Rendering of only one bar for each instrument should have been much faster, so it felt the whole song was rendered but the files written are just one bar.
I haven't try yet to create a new song from the nightlys yet and I would of course also hope for a working export of songs started in previous versions. But if it's important I can make a quick new one and report back.

@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Sorry I'm not sure what you mean with "collect all saved version". If you explain a bit more what exactly you need, I can try. Anyways I started the track with a beta of community 1.1 if I remember right (5th of june) or maybe it was still Community 1.0, not sure and I updated to 1.1 while working on it. I tried the stem-export with the todays nightly and previously a nightly from ~2 weeks ago, both times I only had one bar of the instruments, which was strange because the rendering took quite long. Rendering of only one bar for each instrument should have been much faster, so it felt the whole song was rendered but the files written are just one bar. I haven't try yet to create a new song from the nightlys yet and I would of course also hope for a working export of songs started in previous versions. But if it's important I can make a quick new one and report back.

Hey, so your description gives me a clue.

You said the recording took very long. Did it continue recording after the playhead reached the end of the instrument track? If so, it's possible you're experiencing a problem similar to what someone else reported.

Basically, by default, the stem export will record the full length of the arrangement, but it will also keep recording afterwards if the sound has not yet dropped to zero. This allows it to record tails in the stems.

There seems to be a scenario, which may or may not be a bug, where the tails keep playing and the sound does not fully drop to zero.

if you turn on the VU meter before starting the stem export, you can see whether or not the VU meter drops to zero at the end of the recording.

You can also try the release build from here:

https://github.com/SynthstromAudible/DelugeFirmware/actions/runs/10435480991?pr=2456

I've added an option in the SONG > STEM EXPORT > CONFIGURE menu where you can turn off EXPORT TO SILENCE

By doing that, it will not record tails and it will finish recording the stem at the end of the arrangement length.

Could you try and see if turning off "Export to Silence" solves your issue?

Thanks

@feilsch-hering

feilsch-hering commented Aug 18, 2024

Copy link
Copy Markdown

I tried with a new song now, and with a 4 bar arrangement I have now a 16 seconds long wave with a filesize of ~2mb. Previously I had filesize of 88MB but only 5 seconds even though it should have been 5:20 min, which is super odd.
I cant tell you what happened with the playhead at the end but I think it correctly changed to the next instument at the end. The track has not very long tails, maybe a few seconds the most from the delays.
I have to bring my kid to bed now which could take ~2 hours, afterwards I can try again with the VU-meter engaged. And also by exporting from the menu.

@feilsch-hering

feilsch-hering commented Aug 18, 2024

Copy link
Copy Markdown

I now tried with the VU meter and cross-screen engaged in order to see the behaviour at the end, but it pretty much directly at the end of the song jumps to the next instrument and at that moment VU shows silence.
The reason that exporting takes long in my case, is that the song has 17 instruments and each one takes more than 1 minute to render, so it's about 20 min total for one run.
In the current nightly I only see the Normalisation option. I haven't looked into making a custom-build yet, so I can't try the new option now. Please let me know if it's included in the nightly, then I can try again.
But like I wrote, I always get 82.7MB Wave files, which only contain a 5 seconds sound, which is something like 2 1/2 bars, so something is wrong with the way the waves are written, or despite the correct file size, the usable recording stops after a few seconds for no obvious reason.

@feilsch-hering

Copy link
Copy Markdown

Just to let you know, tonight I tried again with deluge-v1_2_0-beta+2024_09_02-6d9319b and afterwards with deluge-v1_2_0-nightly+2024_09_02-8d0d66d and my problem is still the same, all 80+ mb wavs play only 5 seconds of audio.

@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Just to let you know, tonight I tried again with deluge-v1_2_0-beta+2024_09_02-6d9319b and afterwards with deluge-v1_2_0-nightly+2024_09_02-8d0d66d and my problem is still the same, all 80+ mb wavs play only 5 seconds of audio.

Did you post in our discord earlier today about this?

if not, I'll suggest the same thing I suggested to that person:

  1. can you test with record to silence turned off in the stem export config menu. Does it make a difference?

  2. are you using the "freeverb" reverb model in your song or the "mutable" reverb model? There is currently a bug with the "freeverb" reverb model that hasn't been fixed yet. If you are using "freeverb" can you try changing to "mutable" and see if that fixes your problem?

If changing to "mutable" fixes your problem, can you try using "mutable" with "record to silence" turned on as well to confirm you can export successfully with record to silence as well.

Thanks

@feilsch-hering

Copy link
Copy Markdown

No I didn't post on Discord but on the Facebook-group about it. If you reread our above back and forth posts about the issue, I already tried your suggestions without that I managed to get a different outcome. And I'm using Mutable Reverb, so that shouldn't cause this issue. I tried engaging Stem-render per menu, turned off to silence, looked at the VU meter and it goes to zero at the end of the track, tried with and without FX, I always end up with ~80mb big wave-files with only 5 seconds playing.
In case you want to take a look at one of my 80mb/5sec wave files I could upload one for you for example with wetransfer.

@seangoodvibes

seangoodvibes commented Sep 3, 2024

Copy link
Copy Markdown
Collaborator Author

No I didn't post on Discord but on the Facebook-group about it. If you reread our above back and forth posts about the issue, I already tried your suggestions without that I managed to get a different outcome. And I'm using Mutable Reverb, so that shouldn't cause this issue. I tried engaging Stem-render per menu, turned off to silence, looked at the VU meter and it goes to zero at the end of the track, tried with and without FX, I always end up with ~80mb big wave-files with only 5 seconds playing. In case you want to take a look at one of my 80mb/5sec wave files I could upload one for you for example with wetransfer.

It sounds like you have the same issue as reported here #2573

Can you please upload a collect all version of your song to that issue (you can drag and drop a file into the comments box).

Can you also please confirm if this issue happens with all your songs or just this one.

Thank you

For future reference, please open an issue for problems like this instead of discussing it on the feature PR itself. That's what issues are for and it helps us keep track of things. I would not have known you commented here if GitHub didn't send me an email about it.

@feilsch-hering

Copy link
Copy Markdown

Yes, #2573 is exactly the bug I discussed with you 2 weeks ago.
How can I do a "collect all"? I already asked for a hint 2 weeks ago, otherwise I would have uploaded it for you already.
I tried with 2 different songs and both have the 5 seconds issue.
OK, shall we continue to discuss the bug here, or continue on the #2573 threat?

@seangoodvibes

seangoodvibes commented Sep 4, 2024

Copy link
Copy Markdown
Collaborator Author

Yes, #2573 is exactly the bug I discussed with you 2 weeks ago. How can I do a "collect all"? I already asked for a hint 2 weeks ago, otherwise I would have uploaded it for you already. I tried with 2 different songs and both have the 5 seconds issue. OK, shall we continue to discuss the bug here, or continue on the #2573 threat?

lets continue on #2573 please

you can collect all and save as follows:

press save, then press and hold select, it'll save the whole project into a folder

Then just zip the folder and upload it in the issue #2573

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants