PG Music Home
Posted By: musocity Here's Your Live Arranger - 01/02/24 04:08 AM
Install Pre-Release SWS Extensions https://www.sws-extension.org/download/pre-release/

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://www.extremraym.com/cloud/reascript-doc/#CF_CreatePreview

https://www.extremraym.com/cloud/reascript-doc/
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
};
Posted By: musocity Re: Here's Your Live Arranger - 01/03/24 12:22 AM
Using the D_FADEINLEN & D_FADEOUTLEN you can get it seamless to loop the same section or play into a new section.
Posted By: musocity Re: Here's Your Live Arranger - 01/03/24 06:55 AM
Live-Arranger-CF_Preview-3.mp4
This just works and I don't know how to get it not to work ?

This is the recorded video of the script CF_Preview_Play Bass and Drums from above syncing to the original track sections
[Linked Image]

Attached picture Reaper-CF_Preview-Sync-3.png
Posted By: musocity Re: Here's Your Live Arranger ...More - 01/04/24 04:20 AM
Originally Posted by Jim Fogle
Musocity, the above is one of the best tip descriptions you have made. Great visual step-by-step instructions.
That's from another post but I will try and do a simplified easy to understand version here.

When you choose a Style in Biab and generate it will read all the XT2 ST2 files for the RTs in that Style from the Soloists folder.
These contain all the solo and chord data for the RC, SMT & RT source files in the RealTracks folder.

[Linked Image]

The Live Arranger will work the same way, you set the Style, tempo and Key, you can also change these during the performance with keyswitches from the presets (Style Key Tempo),
when the user inputs a C chord and is in the Play Mode it will scan the data for a C chord section in the source files and start playing the file from the position "value" of the C chord in the source file, when the bars of that chord have played out it will have another from another section of the files lined up to play.
reaper.CF_Preview_SetValue(track1, "D_POSITION", 4)

If the source file is transposed 2 semitones
reaper.CF_Preview_SetValue(track1, "D_PITCH", 2)

If the source file bpm is 110 and it needs to playback @ 120 then the playrate is changed
reaper.CF_Preview_SetValue(track1, "D_PLAYRATE", 1.090909)

Once the values are set that file section is played
reaper.CF_Preview_Play(track1)

It's doing this at the same time for each track in the Style as I showed in the video above playing different sections with the Bass and Drums.

So as the user changes a chord it will instantly play all tracks from their required section from within the RT source files.
The Drums will follow the part A or B inputted by the user, this will say whether to play an A or B or A ending or B ending section of a RT.

I could make this all up myself to use Biab RTs RDs with Reaper but I would have to map out all the RTs to chord data file.
I would rather see PG do this as they already have all this data mapped out in the XT2 ST2.
Reaper will playback the Win Mac compressed formats wma & m4a the same with the BBPlugin now works in Reaper playing the source files direct.

Please post any feedback how you think it should work and any keyswitches you think it would need to perform Live.
I don't play keyboard, I'm not a musician so I'm at a lost to know exactly what you would need ?

This is an old one I made for Reaper that used the existing track regions to access different chord sections :
[Linked Image]

Attached picture Biab-Style-Track-Data-XT2-ST2.png
Attached picture Region-Chord-Player.png
Posted By: musocity Re: Here's Your Live Arranger ...More - 01/04/24 08:16 PM
Here's some info from a wishlist post.

Originally Posted by Ryan_R
Random arranger keyboard video for reference:

You can see right hand obviously plays a melody with a pre-selected instrument patch. A style is pre-selected on the keyboard for the accompaniment (similar to how we audition and select styles in BB). The keyboard has a row of buttons to start/stop the accompaniment, to switch between A/B/C/D variations, to increase/decrease tempo, and there may also be special Intro/Outro variations (with predefined chords based on a key) and drum fills that can be triggered and well as rests.


To recreate a similar set of features, it could either be built somewhere into BB or perhaps as a standalone app.

Before live playing, the following settings could be adjusted:
* Tempo
* Select style (existing BB popup window)
* Mixer (solo/mute/select track/erase track - reuse from BB)
* Choose instrument (MIDI patch or an external plugin such as Komplete or Arturia V-Collection or Spitfire)
* Choose split point (which is the lowest note that will play a note instead of being recognized as a chord)


Prominent buttons in the interface which can be clicked and linked to computer keyboard shortcuts and also MIDI controller buttons (CC mapping)

Buttons and possible keyboard shortcuts:
* Tempo Up (A) / Down (Z) / Default Recommended Tempo for style (Q or A+Z together)
* Play/Pause (SPACE)
* Drum Fill (X)
* Variation A (1) / B (2) / C (3) / D (4), etc where applicable for multi-styles
* Bass vol increment (D) / decrement (C)
* Piano vol increment (F) / decrement (V)
* Drums vol increment (G) / decrement (B)
* Strings vol increment (H) / decrement (N)
* Guitar vol increment (J) / decrement (M)

Don't read into the keyboard shortcut letters too much, it's more about their relative positions next to each other (i.e. A + Z, D + C are like Up/Down buttons).


Perhaps before playing live, users must click a Generate button after selecting a new style. This could generate various temporary WAV files for each real track with every possible chord and variation. Percussive tracks would of course be easier/different. When playing live and you press G+C+E keys on the left side of your MIDI (musical) keyboard, the program would intelligently find the pre-generated section for each real track for the current variation where a C/G and play that instantly (at the next 16th of a bar, now possible with BB 2022).

Inspiration for other features/settings could come from analyzing Yamaha/Roland keyboards further. If this were a separate feature I'd honestly pay a one-time extra $40 or $50 for it.

If PG-Music wishes, I could mock up a simple UI design for it.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/04/24 08:18 PM
Thanks to Icelander for keeping us updated on this
https://www.pgmusic.com/forums/ubbthreads.php?ubb=showflat&Number=735024&page=all
EVENT
http://www.ketronmusic.co.uk/products/Ketron/arranger_keyboards/EVENT.html
US$5000 !!

"We did not stop until we reached the highest quality standards, so that cutting-edge technology could also
generate the most realistic sounds.

The result of our hard and passionate work is EVENT: try it out and experience what it means to play
accompanied by a full band of real musicians."

Biab
UltraPAK+ US$569
Audiophile US$669
Doesn't the Conductor Window in BBW already let you go to specific sections during playback by pressing buttons? (and the transitions in BBW seem smooth if setting the "Mode (when to do action)" properly).
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/05/24 01:47 AM
I could never get that to work with QWERTY or the midi keyboard input, the GoTo Section works but that's jerky.
If it works seamlessly like Reaper's smooth seek you could use the Midi Chord Input detection (Windows > MIDI Chord Detection)
to go to any chord section but having only 255 bars, chords and variations would be limited when you first generate up.
That's why with userstracks you need more SGUs to give variation because of the 255 limit.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/05/24 08:33 AM
This is a post by the creator cfillion
Quote
Use a section source to specify playback start/end time or reverse:
Code
local source  = reaper.PCM_Source_CreateFromFile(file)
local section = reaper.PCM_Source_CreateFromType('SECTION')
reaper.CF_PCM_Source_SetSectionInfo(section, source, ...)
reaper.PCM_Source_Destroy(source)
local preview = reaper.CF_CreatePreview(section)
reaper.PCM_Source_Destroy(section)

reaper.CF_Preview_SetOutputTrack(preview, nil, track)
reaper.CF_Preview_Play(preview) -- after configuring the preview
reaper.CF_PCM_Source_SetSectionInfo(PCM_source section, PCM_source source, number offset, number length, boolean reverse)
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/06/24 08:17 PM
This demo script showcases the entire preview API: https://gist.github.com/cfillion/7718bd7d3566a94c308ca7a5fdee8105
right click Save Link/Target As: sws_preview_test.lua
EDIT: you need the ImGui for that script via Reapack
https://forum.cockos.com/showthread.php?t=250419
EDIT: also install Reapack > Browse packages.. in Filter paste js_ReaScriptAPI
right click > Install > Apply
for reaper.JS_Dialog_BrowseForOpenFiles

more here
[Linked Image]

[Linked Image]

Attached File
sws_preview.gif  (236 downloads)
Attached picture ReaImGUI.png
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/07/24 12:21 AM
In the demo script it will load the 1 wma from the RT source files and instantly seek to any chord within it, this just seems to be making things so easy for you thanks to Christian Fillion a fellow Canadian.
Posted By: jmorgan Re: Here's Your Live Arranger ...More info - 01/07/24 12:45 AM
Very interesting. Thank you for your creative and hard work.

Is it possible to do a version for Studio One users?
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/07/24 05:40 AM
It's very hard to get any information on Studio One scripting. If you can ask in the Presonus forums you might find someone with information that can help, as here: Studio One Section Transfer

You have the Arranger Mode and you have midi chord input detection so creating a script to go to a section (chord) when you input a chord should be possible in Studio One as I have demonstrated in this Reaper Video.
You could just use the BBPlugin/s in S1 to generate up all the chord sections you will be using that will correspond to the arranger sections. You can set the arranger sections to Loop so the chord keeps playing until you change chords. Two or more BBPlugin can be used to get more material/chords as you can set Plugin 2 to start on another bar over the 255 limit. When they get the RT source tracks playing direct in the BBPlugin this will be very quick to do. So yes I think post this in the Presonus forum an see if anyone comes back with scripting info on how this may be accomplished. Lawrence used to be the goto guy but I don't see him around anymore.

Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/08/24 12:24 AM
This also allows the BBPlugin to play back the "Bass - 1255 Bass, Electric, PopShiningA-B Ev 120.di" track files direct inside the Plugin and follow any varying tempo map as in the demo script you can seek instantly and change the playback rate on the fly.

[Linked Image]

Attached picture VST6-Play-Direct-CF_Preview.png
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/08/24 04:58 AM
For the ReaImGUI
Install reapack.com/ > In Reaper menu Extensions > Reapack > Browse packages.. in Filter paste js_ReaScriptAPI
right click > Install > Apply
for reaper.JS_Dialog_BrowseForOpenFiles
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/09/24 11:38 PM
Using Reaper will allow you to track out the Live Arranger session if need be, that let's you keep arrangements/progression/ideas you come up with on the fly rather than having to type chords in, generate and try.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/10/24 02:57 AM
From the main Biab forum:
Originally Posted by musocity
Originally Posted by PeterGannon
Thanks! We are also still working on direct-play for the plugin, which would be a big step for the plugin (all DAWS including Reaper). The Live Arranger idea is great, and hopefully applicable to many DAWS.
That will be good if you get the files playing direct inside the plugin, this allowing the plugin to work as a Live Arranger also and being able to record the track's data that was played and then playback or send/transfer/render into the DAW if need be.
I noticed in some of the videos, some apparent 'glitches' in the sound. Do you know if these are artifacts of the faster generation and arranger behaviour, or if they're glitches in the recording?

Are you aware of any hardware controller for managing the arranger, that could be set up similar to the main live controls of arranger keyboards? If not, do you think there may be some mileage in creating one? Electronics and software are my game, so I wonder if there's an opportunity to produce something, though at my age I'd need to think how such a thing might live on beyond me.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/10/24 06:12 PM
In the Reaper Arranger video it had glitches from screen recording software and trying to capture the video and audio at the same time with the onboard audio device as well as too many other things running at the time, if you try Reaper with the BBPlugin and smooth seek enabled in the prefs/audio/seeking while you play Reaper back with the BBPlugin following then click on another bar and it will go there smoothly.
The Arranger script I made simply works by reading the midi chord input and going to a random chord region of the selected color and loop it until another chord is entered it will then to that chord/color region.
You can set smooth seek to change on next marker or next bar/s.
You should try out the smooth seek using the BBPlugin and you will see how well it works you won't get any glitches.
Just generate up all the chords you need 4 or more bars long for each chord.
If you use 2 BBPlugins you can have all the blue and blue ending in BBPlugin 1 and all the green and green ending in BBPlugin 2 and Plugin 2 is set to sync start on the bar after BBPlugin 1 ends.
You can drag the C7 out into Reaper to get the chord markers, drag the BBPlugin 1 C7 to first bar and BBPlugin 2 C7 to where it starts.

That new RT RD Ketron Event keyboard uses an OS as it has an SSD in it, could be a damn small linux ?
Originally Posted by musocity
In the Reaper Arranger video it had glitches from screen recording software and trying to capture the video and audio
That's as I'd expected. I doubted you were tolerating the glitches in real use. I must find some time to have a go. I think I would find it useful.

Originally Posted by musocity
That new RT RD Ketron Event keyboard uses an OS as it has an SSD in it, could be a damn small linux ?
It could well be, though there are also true RTOSs out there that might be better still for the job.

I have a photo of the insides of the EventX and it has a processor module and a second board pick-a-backed onto a larger board. The CPU board looks like one of these: +++ here +++

There's are some fairly large chips on the other daughter board, possibly a DSP and some RAM. Most other stuff looks like I/O. There's a 240GB SSD drive in the one I saw. One big PCB for the front panel, likely with a bought-in display stuck on it.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/11/24 12:34 AM
I made a video of the smooth seek, so rather than playing the rendered wavs in the SavedTracks folder within the Plugin it's playing all the sections the new way directly in Reaper.
VST6-Smooth-Seek.mp4

Those keyboards are around $5000 compared to $569 for Biab.
I said years ago to have a hardware version of Biab with an LCD touch Screen.
Originally Posted by musocity
I made a video of the smooth seek, so rather than playing the rendered wavs in the SavedTracks folder within the Plugin it's playing all the sections the new way directly in Reaper.
VST6-Smooth-Seek.mp4
Yes, that sounds fine. I did believe you, though smile

Originally Posted by musocity
Those keyboards are around $5000 compared to $569 for Biab.
I said years ago to have a hardware version of Biab with an LCD touch Screen.
Indeed. All the better arranger keyboards are that kind of price. Ketron's SD90 (module, no keyboard) is significantly less and pretty good.
I have a touch-screen on my older laptop, though it's a rather short of power for this, the screen's small and beyond the keyboard, so not really ergo-friendly. I have vArranger on it, but don't use vArranger for that reason. My large touchscreen has lost touch, so to speak, but that may be just a USB-cable problem.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/12/24 07:32 AM
Ketron Event
Live Drums: 580 Live Drums with a complete Arranger structure (3 Intros, 3 Endings, ABCD, 4 Fills, 4 Breaks). Reverb and 3 band Parametric Equalizer with 10 presets, programmable on each style. Drum Boost. Possibility to load external User Live Drums. Drum Lock.
Grooves: 3 x independent Groove sections. Huge library of more than 780 Latin percussions, Electro and Acoustic Drum loops, Single percussion hits. Groove to Variation. Separate volume and controls.
Live Guitars: 216 sliced Guitar patterns including Long Chords. Separate volume and controls.
Real Chord: More than 300 Real audio accompaniments covering a full chord range (up to 13 different chords). A wide variety of electric, acoustic, and jazz guitars patterns and other orchestral sequences perfectly synchronized to Midi. Dedicated Insert EFX with full editor, programmable for each style. Possibility to load external User Real Chords.
Real Bass: 256 Real audio Basses synchronized to Midi. Twin Bass: possibility to switch Midi or Audio on the same style. Support to external User audio Basses. 3 band Parametric Equalizer with 10 Presets, programmable on each style. Possibility to load external User Real Basses.

Compare that with what Biab will give.
I'm not arguing for or against either BIAB or a hardware arranger here, just comparing some ergonomic factors and wondering in part if there might be enough interested people to justify a hardware button-panel to put the direct arranger buttons close to the player's hands. I'm suspecting not, or perhaps a simple matrix-controller is enough anyway. Akai LPD8, Presonus Atom or some such. Lots of controller keyboards already have a matrix, which also suggests "no real market for such a keypad". My stage piano does not, though.

Where I think there should be be an important comparison is in the reliability/robustness area. Dedicated hardware should be dedicated to the task and not dependent upon what other software is running on a PC, and there are lots of those on most PCs. In principle dedicated hardware should be closer to "bullet proof", but in practice I'm not so sure in practice that it is. There seem to be more than a few bugs in some of these hardware arrangers. No names.

BTW, I'm not sure that comparing things like number of styles really tells the story. One could easily argue that the number of actual styles is number of base styles x number of intros x number of variations x number of endings, even before one starts selecting different styles within a single song or adding intros mid-song.

I think BIAB's strength is the ability to pre-build custom styles and structure for specific songs and assigning those by section-name, rather than having to prompt/remember that the one has, e.g., to "start with intro 2, go to style 2 for the verse, go to style 3 for the bridge, back to style two for the final eight then to ending 4". It gives the potential to have my into, my variations and my ending for each song. Conventional arrangers don't really do that, though customised styles go part way towards it.

I write here with very little actual arranger experience.
Posted By: musocity Re: Here's Your Live Arranger ...More info - 01/13/24 09:36 PM
"might be enough interested people to justify a hardware button-panel to put the direct arranger buttons close to the player's hands"
Yes that sounds good, have it as optional so you don't need to have it to use the Live Arranger but it will make things easy.
© PG Music Forums