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

Reply
 
Thread Tools Display Modes
Old 05-02-2022, 11:51 AM   #1
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default [Alpha Release]Reaffer:Guitar/Bass MIDI editor based on Ample Sound riffer

UPDATE:
As I promised here's a very very rough working version. Please treat it as something to play with rather than any kind of useful software. Also please use it in a test project!
Please bear with me if you see code that pokes eyes. Lua beginner here ��
Link to GitHub repo and installation instructions down below.

So what is it?
In its simplest form, it's just a MIDI editor tailored for guitar/bass. Instead of a piano roll, it uses a tablature-like fretboard representation but includes note duration too. While not a full-featured MIDI editor, it adds guitar/bass specific features like clamping the notes to their string range, displaying fret position, setting the string count, etc.
What it aims to be is a companion for guitar VSTs, with the ability to set plugin-specific articulations. This is not implemented at all yet, I still need to think of a good way to do it, since not all VSTs have the same articulations, nor do they treat them the same way.
The end result is just a generated MIDI item, created at the edit cursor on the selected track.
The plan is to stick to what Ample Sound's riffer does, for the most part, while changing/adding little things here and there.


Notable things not implemented/half-working/buggy
  • When reducing measure-count notes can end-up outside of the range too.
  • No string tuning ability.
  • No articulations. Generated MIDI just exports notes.

Installation and Use
Download the repo from here:
Navigate to Reaper's script path. On Windows it should be C:\Users\<YourUserName>\AppData\Roaming\REAPER\Scr ipts
Preferably, create a folder in there and extract the downloaded files.
In Reaper: Actions->Show action list...->New action...->Load Reascript..
and find Reaffer.lua in the folder you have extracted the files. Click run.

If you want to audition inserted notes, add a VST on a track (doesn't have to be guitar-specific), record-arm the track, ans set the Input to MIDI (VMK or All MIDI Inputs)
Hover the (?) icon for quick help on shortcuts and usage.

Here's an old video


Here it is in comparison with riffer:
__________________
https://pragmata.webflow.io/

Last edited by immortalx; 06-01-2022 at 07:54 PM. Reason: First public release (alpha)
immortalx is offline   Reply With Quote
Old 05-03-2022, 03:04 AM   #2
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,178
Default

COOL!
Quote:
Originally Posted by immortalx View Post
I'm still not sure if this will be useful at all to anyone...
Definitely will! Good luck.
Daodan is offline   Reply With Quote
Old 05-03-2022, 04:08 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Very nice usage of ReaImGui !
X-Raym is offline   Reply With Quote
Old 05-03-2022, 08:02 AM   #4
XIAOXI
Human being with feelings
 
Join Date: Nov 2021
Posts: 14
Default

What theme do you use? It looks beautiful.
XIAOXI is offline   Reply With Quote
Old 05-03-2022, 10:38 AM   #5
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by XIAOXI View Post
What theme do you use? It looks beautiful.
It's an unfinished theme I'm working on.
I borrowed a few icons from this theme: https://forum.cockos.com/showthread.php?t=214041
but other than that I started from scratch, so it's only the tcp for now.
I initially made a mod of the aforementioned theme just to learn about WALTER, but it didn't turn-up good, so I decided to make my own minimal theme.

Other than the tcp it's unusable at this state, so when I finish it I'll post it in the themes forum.
immortalx is offline   Reply With Quote
Old 05-05-2022, 07:36 PM   #6
kartalex
Human being with feelings
 
Join Date: Dec 2015
Posts: 172
Default

Looks awesome! How did you make those icons in ImGui?
kartalex is offline   Reply With Quote
Old 05-05-2022, 09:31 PM   #7
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by kartalex View Post
Looks awesome! How did you make those icons in ImGui?
Thank you very much!
Since ReaImGui doesn't currently support Image loading/rendering, these are just an icon-font. So I just used fontello.com to generate a custom icon-font and then loaded it with standard ImGui functions.
immortalx is offline   Reply With Quote
Old 05-06-2022, 01:50 AM   #8
kartalex
Human being with feelings
 
Join Date: Dec 2015
Posts: 172
Default

Quote:
Originally Posted by immortalx View Post
Thank you very much!
Since ReaImGui doesn't currently support Image loading/rendering, these are just an icon-font. So I just used fontello.com to generate a custom icon-font and then loaded it with standard ImGui functions.
Great, thank you!
kartalex is offline   Reply With Quote
Old 05-06-2022, 10:10 PM   #9
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

It took me a while to stop fighting the language and switch to 1-based indices. I don't know why Lua creators chose this but it's certainly a headache when you're not used to it.

So I just implemented note-entry with dragging left/right to set duration, and up/down to set pitch. Still tons of things to do but it's a start.
immortalx is offline   Reply With Quote
Old 05-09-2022, 01:51 PM   #10
Pintspiller
Human being with feelings
 
Pintspiller's Avatar
 
Join Date: Apr 2020
Location: Northern Ireland
Posts: 72
Default

I will be trying this when you release it.
Pintspiller is offline   Reply With Quote
Old 05-10-2022, 01:23 AM   #11
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Thanks! I'm trying to have a rough working version soon. It seems it'll need more work than I expected but I'm hoping to pull it off.

Also, @X-Raym, I now realize that you're the one behind tons and tons of scripts and tutorials that I've followed. I didn't connect the dots at first when I saw your username, but now that I do, thank you for all the hard work!
immortalx is offline   Reply With Quote
Old 05-10-2022, 04:56 AM   #12
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@immortalx
Glad my work has been useful to your script journey. It seems that you are already on high level with this script, well done :P
X-Raym is offline   Reply With Quote
Old 05-10-2022, 08:40 AM   #13
The-Zeronaut
Human being with feelings
 
Join Date: Mar 2009
Posts: 309
Default

Seems amazing!
Maybe I can finally stop writing bass parts in guitar pro 5 after all these years XD


In an ideal world, we would be able to add/activate custom keyswitches
with buttons down below in that free space or maybe a menu with right click

maybe save them as presets ? (ezbass keyswitch preset, ample sound preset, submission audio preset. etc...)
The-Zeronaut is offline   Reply With Quote
Old 05-10-2022, 09:07 AM   #14
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by The-Zeronaut View Post
Seems amazing!
Maybe I can finally stop writing bass parts in guitar pro 5 after all these years XD


In an ideal world, we would be able to add/activate custom keyswitches
with buttons down below in that free space or maybe a menu with right click

maybe save them as presets ? (ezbass keyswitch preset, ample sound preset, submission audio preset. etc...)
Thanks!
You're almost on my mind. My plan is to add an articulation "lane" below the strings, and then have a dropdown-box where you can select articulation presets for some known VSTs.

Then you could add notes in that lane, and their "allowed" pitches would correspond to articulations of the selected preset. And of course you would be able to set their duration and velocity.
I may have to add a button with which you could add more lanes, because it's possible to have more than one articulation at the same time (eg: Sustain + Downstroke noise).

I'm not sure yet if this is a realistic plan, or If I'm missing something, so I'm open to ideas.
immortalx is offline   Reply With Quote
Old 05-15-2022, 09:51 AM   #15
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Updated first post with a video of the progress.
Implemented multiple selection and editing of notes. It works for the most part but needs polishing.
With left mouse drag, you can set the pitch and duration, and with right mouse drag, the velocity.
Selection of existing notes can be done with Select/Move/Draw tools, so that the user doesn't have to switch tool all the time.
Also added the ability to change which property is displayed over notes.

EDIT: Forgot to mention that you can audition notes when you insert or select them
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 05-16-2022, 03:47 PM   #16
Dordan1993
Human being with feelings
 
Join Date: Mar 2020
Posts: 7
Default

Any chance you could clone the Strummer portion of ample sound?
Quote:
Originally Posted by immortalx View Post
Thanks!
You're almost on my mind. My plan is to add an articulation "lane" below the strings, and then have a dropdown-box where you can select articulation presets for some known VSTs.

Then you could add notes in that lane, and their "allowed" pitches would correspond to articulations of the selected preset. And of course you would be able to set their duration and velocity.
I may have to add a button with which you could add more lanes, because it's possible to have more than one articulation at the same time (eg: Sustain + Downstroke noise).

I'm not sure yet if this is a realistic plan, or If I'm missing something, so I'm open to ideas.
Attached Images
File Type: jpg IMG_20220516_154706.jpg (151.1 KB, 108 views)
Dordan1993 is offline   Reply With Quote
Old 05-17-2022, 02:03 AM   #17
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by Dordan1993 View Post
Any chance you could clone the Strummer portion of ample sound?
I'll have to finish this one first, as the strummer is a whole program on its own!
Seems like an interesting challenge though. Thanks for the idea!
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 05-17-2022, 02:09 AM   #18
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Looks very cool, thanks for sharing.
In case you want another challenge, what I would like to have as a general musical concept: How to add feeling to those notes, by drawing lines, using a pen on a graphics tablet, which would denote the loudness / volume, so you could say play those few notes getting calmer, or the opposite, play those a bit louder and staccato (adding circles on top of the notes). As a summary, for a beginning there could be 3 types of drawings in the category list:
1. linear line, going up (play louder)
2. linear line, going down (play calmer)
3. circle above note (play staccato)

But not sure if you can add a "drawing area" via lua, in Reaper, under your tool. I think that would be cool.
TonE is offline   Reply With Quote
Old 05-17-2022, 09:54 AM   #19
The-Zeronaut
Human being with feelings
 
Join Date: Mar 2009
Posts: 309
Default

The update looks cool

can the audition be turned off?

also the option to display FRET number then pitch at the same time would be amazing
(you already have the reverse option for pitch THEN fret number)

Could we delete using a key+click? (example alt) instead of having to select the eraser every time
The-Zeronaut is offline   Reply With Quote
Old 05-17-2022, 10:39 AM   #20
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by TonE View Post
Looks very cool, thanks for sharing.
In case you want another challenge, what I would like to have as a general musical concept: How to add feeling to those notes, by drawing lines, using a pen on a graphics tablet, which would denote the loudness / volume, so you could say play those few notes getting calmer, or the opposite, play those a bit louder and staccato (adding circles on top of the notes). As a summary, for a beginning there could be 3 types of drawings in the category list:
1. linear line, going up (play louder)
2. linear line, going down (play calmer)
3. circle above note (play staccato)

But not sure if you can add a "drawing area" via lua, in Reaper, under your tool. I think that would be cool.
You have some nice ideas there. For this project though I'm trying to stick to what the original program does, for the most part, and only changing small bits & pieces.
But what you suggest seems very cool.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 05-17-2022, 11:06 AM   #21
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by The-Zeronaut View Post
The update looks cool

can the audition be turned off?

also the option to display FRET number then pitch at the same time would be amazing
(you already have the reverse option for pitch THEN fret number)

Could we delete using a key+click? (example alt) instead of having to select the eraser every time
Thanks. I'll add an option to enable/disable audition.
Also yes, the fret/pitch order can be reversed. I'll add an option for that.
I'll have to think a way to add options like these in a popup or something, because it already starts to get cluttered.

As for the modifier+click question, right now it works like this on the selected notes:
Whatever tool you have active (except the eraser),
Left_click + drag horizontally sets the duration.
Left_click + drag vertically sets the pitch.
Right_click + drag vertically sets the velocity.
Right_click + SHIFT + drag vertically sets the off-velocity.

So I'll add one for the eraser. Good idea.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 05-18-2022, 09:14 AM   #22
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Updated first post with first public release.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 05-20-2022, 11:34 AM   #23
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Undo/Redo system implemented but not tested thoroughly. Changes pushed to GitHub (See first post)
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 05-20-2022, 03:08 PM   #24
danielhalond
Human being with feelings
 
Join Date: Jul 2020
Posts: 15
Default

wow!
danielhalond is offline   Reply With Quote
Old 06-01-2022, 08:07 PM   #25
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Pushed latest changes to the Main branch.

Things added:
  • Keyboard shortcuts
  • Undo/Redo
  • Marquee-select multiple notes
  • Auto-scroll when dragging near the editor edges
  • Clipboard Cut/Copy/Paste
  • Show preview of notes before paste
  • Option to display MIDI pitch
  • Various fixes

I'm sure there will be lots of bugs as I barely did any tests.
I'll focus on polishing things up and then start implementing articulations.
I'd appreciate some feedback on how to do that.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 06-03-2022, 01:48 AM   #26
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

I just recorded a LiceCap to post on the Dear ImGui galleries, so I'm posting it here too. This version has the features listed in my previous post.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 07-07-2022, 04:47 AM   #27
concaocao
Human being with feelings
 
Join Date: Jan 2020
Posts: 25
Default

Thanks for sharing it, looking amazing.
Not sure if I missed something when I tried running it but got this below error

...io\AppData\Roaming\REAPER\Scripts\Reaffer-main\Input.lua:4: attempt to call a nil value (field 'ImGui_Key_ModCtrl')
concaocao is offline   Reply With Quote
Old 07-07-2022, 08:06 AM   #28
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by concaocao View Post
Thanks for sharing it, looking amazing.
Not sure if I missed something when I tried running it but got this below error

...io\AppData\Roaming\REAPER\Scripts\Reaffer-main\Input.lua:4: attempt to call a nil value (field 'ImGui_Key_ModCtrl')
Thank you.
Unfortunately, I can't reproduce that on my end (using latest Reaper on Windows 11).
Chances are, you have an older version of ReaImGui. Try updating it by going to Extensions->ReaPack->Synchronize packages.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 07-09-2022, 01:24 AM   #29
concaocao
Human being with feelings
 
Join Date: Jan 2020
Posts: 25
Default

Further error in the console output:

ImGui assertion failed: (g.CurrentWindowStack.Size == 1) && "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?"


I'm running Win10
Reaper 6.63
Reapack 1.2.4.1
ReaImGui version = 1.83 / 0.5.2

I'm not familiar with ImGui, do I need to install Dear Imgui as well?

Thanks
concaocao is offline   Reply With Quote
Old 07-09-2022, 01:47 AM   #30
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by concaocao View Post
Further error in the console output:

ImGui assertion failed: (g.CurrentWindowStack.Size == 1) && "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?"


I'm running Win10
Reaper 6.63
Reapack 1.2.4.1
ReaImGui version = 1.83 / 0.5.2

I'm not familiar with ImGui, do I need to install Dear Imgui as well?

Thanks
Just update ReaImGui. You're running a very old version (0.5.2). Current one is 0.7
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 07-09-2022, 04:23 AM   #31
concaocao
Human being with feelings
 
Join Date: Jan 2020
Posts: 25
Default

Oh perfect, all good now thanks
concaocao is offline   Reply With Quote
Old 07-14-2022, 12:40 PM   #32
krahosk
Human being with feelings
 
Join Date: Jul 2009
Location: Germany
Posts: 2,375
Default

This is an awesome tool to actually write logically and intuitively for the guitar.
Does Reaffer support MIDI channels? Channel 1 = String 1, Channel 2 = String 2 and so on?
krahosk is offline   Reply With Quote
Old 08-10-2022, 09:44 AM   #33
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by krahosk View Post
This is an awesome tool to actually write logically and intuitively for the guitar.
Does Reaffer support MIDI channels? Channel 1 = String 1, Channel 2 = String 2 and so on?
I'm terribly sorry for the late reply but I didn't get a forum notification for your question.

Sorry, for the time being it outputs notes only on channel 1.
I was planning of having a setting to output each string's notes to a different channel, but due to lack of motivation I haven't worked on it since my last post.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 06-11-2023, 01:42 AM   #34
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 650
Default

I posted this for somone and I checked if it even works.

So this program doesn't work with updated 0.8.6.1 ReaImGui, it works with 0.7 version.

Giving me error:
Code:
App.lua:107: attempt to call a nil value (field 'ImGui_AttachFont')
on Windows 11.
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
strachupl is offline   Reply With Quote
Old 06-11-2023, 06:08 AM   #35
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by strachupl View Post
I posted this for somone and I checked if it even works.

So this program doesn't work with updated 0.8.6.1 ReaImGui, it works with 0.7 version.

Giving me error:
Code:
App.lua:107: attempt to call a nil value (field 'ImGui_AttachFont')
on Windows 11.
That's because this function changed name to ImGui_Attach. You can change it or add in the beginning of the script this line:
Code:
dofile(reaper.GetResourcePath() .. '/Scripts/ReaTeam Extensions/API/imgui.lua')('0.7')
vitalker is offline   Reply With Quote
Old 06-11-2023, 07:44 AM   #36
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by vitalker View Post
That's because this function changed name to ImGui_Attach. You can change it or add in the beginning of the script this line:
Code:
dofile(reaper.GetResourcePath() .. '/Scripts/ReaTeam Extensions/API/imgui.lua')('0.7')
Thanks for the heads up! I updated the function name.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 06-12-2023, 04:40 AM   #37
carbon
Human being with feelings
 
carbon's Avatar
 
Join Date: Feb 2008
Location: Eesti
Posts: 2,721
Default

Is it possible to change the string count to 10?
__________________
projektorn
carbon is offline   Reply With Quote
Old 06-12-2023, 06:13 AM   #38
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by carbon View Post
Is it possible to change the string count to 10?
Not currently but I can make a change if you wish. Just tell me the tuning.
__________________
https://pragmata.webflow.io/
immortalx is offline   Reply With Quote
Old 06-12-2023, 06:53 AM   #39
carbon
Human being with feelings
 
carbon's Avatar
 
Join Date: Feb 2008
Location: Eesti
Posts: 2,721
Default

Quote:
Originally Posted by immortalx View Post
Not currently but I can make a change if you wish. Just tell me the tuning.
It's the Stick Matched Reciprocal tuning:
https://www.stick.com/instruments/tunings/10/mr/

First 5 strings tuned in 4ths last in 5ths.

01. C4
02. G3
03. D3
04. A2
05. E2 (like standard guitar 6th string)

06. C1 (like 5 string bass 5th string 1-st fret)
07. G1
08. D2
09. A2
10. E3

I think I got the octave numbers right, but in Reaper they might be offset by one, don't know for sure.

Thanks for considering!

The tuning might be best to be adjustable since somebody else might like to use a different tuning.
__________________
projektorn
carbon is offline   Reply With Quote
Old 06-12-2023, 11:12 AM   #40
immortalx
Human being with feelings
 
Join Date: Dec 2009
Posts: 69
Default

Quote:
Originally Posted by carbon View Post
It's the Stick Matched Reciprocal tuning:
https://www.stick.com/instruments/tunings/10/mr/

First 5 strings tuned in 4ths last in 5ths.

01. C4
02. G3
03. D3
04. A2
05. E2 (like standard guitar 6th string)

06. C1 (like 5 string bass 5th string 1-st fret)
07. G1
08. D2
09. A2
10. E3

I think I got the octave numbers right, but in Reaper they might be offset by one, don't know for sure.

Thanks for considering!

The tuning might be best to be adjustable since somebody else might like to use a different tuning.
I just updated it with a 10 string. Please re-download and tell me If I got the tuning as you wanted.
You're right, tuning should be customizable but I didn't consider it at the time I initially wrote it.
I also fixed the plugin complaining about the modifier keys. That means you need the latest ReaImGui version for it to work.
__________________
https://pragmata.webflow.io/
immortalx 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 04:33 PM.


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