Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 11-27-2020, 04:17 AM   #1
hlavsa
Human being with feelings
 
Join Date: Oct 2018
Posts: 17
Default Semiautomatic creation of SFZ samples from VST plugin or external hardware

I wanted to try if I can generate samples in SFZ format from MIDI instruments, for example to sample different hardware MIDI keyboards I have or to sample my favourite instrument VST plugins (for example to be able to use favourite VST instruments on Linux) etc.

I wrote a simple reascript to generate notes in different velocity layers and coresponding regions that I need to render samples. It also generates SFZ format file.

Anyone would like to test it?

Parameters:
velocity layers
notes from - to
length of notes
"shortening" of notes from the lowest to the highest
Path to generate SFZ format file
Samples directory under path

Workflow:
1. Insert an empty MIDI item
2. Select the MIDI item
3. Run lua script that will generate notes in the MIDI event and all regions
4. Set MIDI item length to fit all generated notes
5. Play MIDI notes to your hardware MIDI keyboard and record it to a new stereo audio track
or
Assign a VST plugin instrument to the MIDI track with generated notes and render the MIDI track to new stereo audio track
6. Check if recorded audio of notes is OK: length, clipping etc.
7. Render each region with settings:
Bounds: Project regions
Format: FLAC (SFZ format also accepts WAV and OGG format)
Directory: directory for samples
8. Now you can use your generated instrument with SFZ players like Sforzando from Plogue (https://www.plogue.com/products/sforzando.html) or tweek it if you understand SFZ format.
Attached Images
File Type: jpg sfz.jpg (63.8 KB, 121 views)
Attached Files
File Type: lua Generate all MIDI notes.lua (3.7 KB, 132 views)

Last edited by hlavsa; 05-05-2023 at 12:07 AM.
hlavsa is offline   Reply With Quote
Old 11-28-2020, 01:04 PM   #2
Arthur McArthur
Human being with feelings
 
Arthur McArthur's Avatar
 
Join Date: Sep 2016
Location: Toronto
Posts: 774
Default

Really cool idea, hlavsa. I found myself wishing for this functionality lately. I gave it a try and seem to be having issues getting the created regions to line up with the created midi notes: https://imgur.com/yqZt9AO

Am I getting the procedure wrong?
Arthur McArthur is offline   Reply With Quote
Old 12-07-2020, 04:02 PM   #3
hlavsa
Human being with feelings
 
Join Date: Oct 2018
Posts: 17
Default Error

Quote:
Originally Posted by Arthur McArthur View Post
Really cool idea, hlavsa. I found myself wishing for this functionality lately. I gave it a try and seem to be having issues getting the created regions to line up with the created midi notes: https://imgur.com/yqZt9AO

Am I getting the procedure wrong?
Sorry for late answer. There is an error in my code. It works well only at 120 BPM. I corrected the bug. Thanks for testing my script.

I enclose updated script.
Attached Files
File Type: lua Generate all MIDI notes.lua (3.7 KB, 111 views)

Last edited by hlavsa; 12-08-2020 at 05:33 AM.
hlavsa is offline   Reply With Quote
Old 12-08-2020, 03:13 PM   #4
pandabot
Human being with feelings
 
pandabot's Avatar
 
Join Date: Oct 2018
Posts: 367
Default

Alternatively you can render long stems of notes, cut them up, and then glue and rename them. That's what I do, here's one of my glue/renaming scripts
pandabot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.