Here's Your Live Arranger - 01/02/24 04:08 AM
Install Pre-Release SWS Extensions https://www.sws-extension.org/download/pre-release/
This should work to play the sections the same way I demonstrated with a Video Here It's the same now how the Plugin inserts all the sections and Reaper plays them back yet it will be using the source files direct without loading into a Reaper track, you will have virtual tracks.
So you load all the track data for the chosen style,
When a chord is entered it will look for a chord section for each track from a source file,
The CF_Preview_GetValue(track1, "D_POSITION") will get the current play position in the file until that chord ends
it will then play another section with the same chord or until user changes chords.
You can reaper.CF_Preview_Stop(track1)
or reaper.CF_Preview_StopAll()
I used defer:
reaper.defer(function)
Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to runloop().
Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.
You can try it this way using the Reaper C++ API and later you maybe able to get the BBvst to do it all allowing the BBPluginStandalone to be used ?
https://www.extremraym.com/cloud/reascript-doc/#CF_CreatePreview
https://www.extremraym.com/cloud/reascript-doc/
search CF_Preview
Code
file1 = "E:\\bb\\RealTracks\\Bass, Electric, BritInvasion Ev 120\\BS1691.wma" wma_source1 = reaper.PCM_Source_CreateFromFile(file1) track1 = reaper.CF_CreatePreview(wma_source1) reaper.CF_Preview_SetValue(track1, "D_VOLUME", 1) reaper.CF_Preview_SetValue(track1, "D_POSITION", 4) reaper.CF_Preview_SetValue(track1, "D_PITCH", 2) reaper.CF_Preview_SetValue(track1, "D_PLAYRATE", 1) reaper.CF_Preview_SetValue(track1, "B_PPITCH", 1) reaper.CF_Preview_Play(track1) retval, current_pos = reaper.CF_Preview_GetValue(track1, "D_POSITION")
This should work to play the sections the same way I demonstrated with a Video Here It's the same now how the Plugin inserts all the sections and Reaper plays them back yet it will be using the source files direct without loading into a Reaper track, you will have virtual tracks.
So you load all the track data for the chosen style,
When a chord is entered it will look for a chord section for each track from a source file,
The CF_Preview_GetValue(track1, "D_POSITION") will get the current play position in the file until that chord ends
it will then play another section with the same chord or until user changes chords.
You can reaper.CF_Preview_Stop(track1)
or reaper.CF_Preview_StopAll()
I used defer:
reaper.defer(function)
Adds code to be called back by REAPER. Used to create persistent ReaScripts that continue to run and respond to input, while the user does other tasks. Identical to runloop().
Note that no undo point will be automatically created when the script finishes, unless you create it explicitly.
You can try it this way using the Reaper C++ API and later you maybe able to get the BBvst to do it all allowing the BBPluginStandalone to be used ?
https:/
https:/
search CF_Preview
Code
The preview object is automatically destroyed at the end of a defer cycle if at least one of these conditions are met: - playback finished - playback was not started using CF_Preview_Play - the output track no longer exists)", }, { APIFUNC(CF_Preview_GetValue), "bool", "CF_Preview*,const char*,double*", "preview,name,valueOut", R"(Supported attributes: B_LOOP seek to the beginning when reaching the end of the source B_PPITCH preserve pitch when changing playback rate D_FADEINLEN lenght in seconds of playback fade in D_FADEOUTLEN lenght in seconds of playback fade out D_LENGTH (read only) length of the source * playback rate D_MEASUREALIGN >0 = wait until the next bar before starting playback (note: this causes playback to silently continue when project is paused and previewing through a track) D_PAN playback pan D_PITCH pitch adjustment in semitones D_PLAYRATE playback rate D_POSITION current playback position D_VOLUME playback volume I_OUTCHAN first hardware output channel (&1024=mono, reads -1 when playing through a track, see CF_Preview_SetOutputTrack) I_PITCHMODE highest 16 bits=pitch shift mode (see EnumPitchShiftModes), lower 16 bits=pitch shift submode (see EnumPitchShiftSubModes))", }, { APIFUNC(CF_Preview_GetPeak), "bool", "CF_Preview*,int,double*", "preview,channel,peakvolOut", "Read peak volume for channel 0 or 1. Only available when outputting to a hardware output (not through a track).", }, { APIFUNC(CF_Preview_SetValue), "bool", "CF_Preview*,const char*,double", "preview,name,newValue", "See CF_Preview_GetValue.", }, { APIFUNC(CF_Preview_SetOutputTrack), "bool", "CF_Preview*,ReaProject*,MediaTrack*", "preview,project,track", "", }, { APIFUNC(CF_Preview_Play), "bool", "CF_Preview*", "preview", "Start playback of the configured preview object.", }, { APIFUNC(CF_Preview_Stop), "bool", "CF_Preview*", "preview", "Stop and destroy a preview object.", }, { APIFUNC(CF_Preview_StopAll), "void", "", "", "Stop and destroy all currently active preview objects.", }, { NULL, } // denote end of table };