Old 11-16-2019, 05:02 AM   #1
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,131
Default JS Notepad?

Just an idea, because the required skills i unfortunately lack.

Would be nice to have one as a native (as it were) Reaper plugin, if the scripting language is at all suitable for the task.
Buy One is offline   Reply With Quote
Old 11-16-2019, 10:42 AM   #2
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 5,844
Default

In regards to notes or a notepad, these options currently come into mind:

If you're referring with 'JS Notepad' to something else: can you please elaborate or post more details about what features you're looking for.
__________________
ReaLauncher

Last edited by solger; 11-16-2019 at 11:20 AM.
solger is offline   Reply With Quote
Old 11-16-2019, 02:01 PM   #3
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,131
Default

Thank you for suggestions. Of these I'm aware, Lokasenna's text editor as far as I understand is not an independent utility. It seems to only work as part of complete scripts and is not meant to accept text in real time.

I envision a JS plugin which can be loaded alongside FX on a track much like Notepad VSTs of which there're a few in existence.

The functions can be the most basic without fancy formatting options and even font selection.
Probably provide as much as the ability to adjust font size which can have variable within the code itself without GUI controls, be able to wrap text to fit the window which can be resizable, and generate vertical scroll bar.

I assume the FX rack is one of the most frequented locations in the program and with a JS Notepad loaded on a particular track a user will always have the notes at their fingertips. And it also would be readily accessible in the MCP from the insert slot.

Last edited by Buy One; 11-16-2019 at 02:09 PM.
Buy One is offline   Reply With Quote
Old 11-16-2019, 02:43 PM   #4
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,416
Default

Quote:
Originally Posted by Buy One View Post
<snip>

I envision a JS plugin which can be loaded alongside FX on a track much like Notepad VSTs of which there're a few in existence.

<snap>
What is wrong with using any of these existing ones?
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 11-16-2019, 03:34 PM   #5
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,131
Default

Nothing wrong. On the other hand with JS Notepad Reaper would have its own, and provided it's added to the ReaPack, its users would as well.

In essence Reaper didn't have to include JS plugins at all if it was able to load and run VSTs, but it does offer them, so why not a Notepad as well?
Buy One is offline   Reply With Quote
Old 11-17-2019, 09:50 AM   #6
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,827
Default

Melda plugins have a free pack, one of the plugins is a notepad .
https://www.meldaproduction.com/MNotepad
pepe44 is offline   Reply With Quote
Old 11-17-2019, 09:55 AM   #7
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,131
Default

Appreciate the suggestions however the thread is not about lack of VST notepads as such on the market, it's about what's stated in the initial post.
Buy One is offline   Reply With Quote
Old 11-23-2019, 02:37 AM   #8
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 305
Default

I don't know is it still need or not but I've just came across on that
http://blog.wavosaur.com/7-free-utility-vst-plugins/

edit: I didn't notice last post

Last edited by Ivannn Bennnettt; 11-23-2019 at 02:49 AM.
Ivannn Bennnettt is offline   Reply With Quote
Old 11-25-2019, 06:57 AM   #9
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

I'm not sure how useful a JS notepad would be, because JSFX can't access the OS clipboard, so you wouldn't be able to copy/paste to/from it.
Tale is online now   Reply With Quote
Old 11-25-2019, 08:48 AM   #10
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,827
Default

Quote:
Originally Posted by Tale View Post
I'm not sure how useful a JS notepad would be, because JSFX can't access the OS clipboard, so you wouldn't be able to copy/paste to/from it.
Not quite sure that is true, just did some text in notepad and copy /paste to a JSFX and it worked!
pepe44 is offline   Reply With Quote
Old 11-25-2019, 09:33 AM   #11
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by pepe44 View Post
Not quite sure that is true, just did some text in notepad and copy /paste to a JSFX and it worked!
You mean into a slider input box, right? If so, then do note that you can only paste numbers. Also, a JSFX notepad would need to have a graphical interface, and AFAIK there is no way to paste anything into gfx_getchar().
Tale is online now   Reply With Quote
Old 06-02-2021, 09:37 AM   #12
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,499
Default

Quote:
Originally Posted by Tale View Post
You mean into a slider input box, right? If so, then do note that you can only paste numbers. Also, a JSFX notepad would need to have a graphical interface, and AFAIK there is no way to paste anything into gfx_getchar().
https://geraintluff.github.io/jsfx-u...on-text-inputs

I have no understanding how any of this works but does this mean it would be possible to add text inputs?
Pink Wool is offline   Reply With Quote
Old 06-03-2021, 12:03 AM   #13
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Pink Wool View Post
I have no understanding how any of this works but does this mean it would be possible to add text inputs?
I guess it would, nice! But only if you have a custom GUI, and AFAICT you still can't copy-paste from/to the clipboard.
Tale is online now   Reply With Quote
Old 06-03-2021, 04:37 AM   #14
Zeno
Human being with feelings
 
Zeno's Avatar
 
Join Date: Sep 2018
Location: HH
Posts: 916
Default

Quote:
Originally Posted by Tale View Post
You mean into a slider input box, right? If so, then do note that you can only paste numbers. Also, a JSFX notepad would need to have a graphical interface, and AFAIK there is no way to paste anything into gfx_getchar().
But in gfx you could display what is in a textbox.
Zeno is offline   Reply With Quote
Old 06-03-2021, 04:44 AM   #15
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Zeno View Post
But in gfx you could display what is in a textbox.
Yeah, I guess... I don't think I really understand what you mean?

FWIW, here is as far as I got with an actual JSFX notepad. It's a long way from being actually useful, and like I said, the bigggest problem is that it can't communicate with the OS clipboard, making it kinda useless (IMHO, YMMV).

Code:
desc:JSFX notepad
options:want_all_kb

@init

gfx_ext_retina = ext_noinit = 1;
gfx_clear = 0xFFFFFF;

function home(idx)
  global(buf)
(
  while(idx > 0 && str_getchar(buf, idx - 1) != '\n' ? idx -= 1);
  idx;
);

function end(idx)
  global(buf, len)
(
  while(idx < len && str_getchar(buf, idx) != '\n' ? idx += 1);
  idx;
);

function insert(idx, c)
  global(buf, len)
  local(tmp)
(
  idx < len ? (
    strcpy_from(tmp = #, buf, idx);
    strncpy(buf, buf, idx);
    str_setchar(buf, idx, c);
    strcat(buf, tmp);
  ) : (
    str_setchar(buf, idx, c);
  );
  len += 1;
);

function delete(idx)
  global(buf, len)
  local(tmp)
(
  idx + 1 < len ? (
    strcpy_from(tmp = #, buf, idx + 1);
    strncpy(buf, buf, idx);
    strcat(buf, tmp);
  );
  len -= 1;
);

@serialize

file_var(0, len);
file_string(0, buf);

@gfx 20 1

gfx_set(0);
gfx_setfont(1, "Arial", 15 * gfx_ext_retina);

tab = gfx_texth * 2;
gfx_setcursor(32513, "text");

c = gfx_getchar();
c >= 1 ? (

  c == 'left' ? (
    idx = max(idx - 1, 0);
  ) :

  c == 'rght' ? (
    idx = min(idx + 1, len);
  ) :

  c == 'down' ? (
    j = end(idx);
    j < len ? (
      i = home(idx);
      j += 1;
      loop(idx - i, j < len && str_getchar(buf, j) != '\n' ? j += 1);
      idx = j;
    );
  ) :

  c == 'up' ? (
    j = home(idx);
    j > 0 ? (
      i = home(j - 1);
      idx = min(i + idx - j, j - 1);
    );
  ) :

  c == 8 ? (
    idx > 0 ? delete(idx -= 1);
  ) :

  c == 'del' ? (
    idx < len ? delete(idx);
  ) :

  c == 'home' ? (
    idx = home(idx);
  ) :

  c == 'end' ? (
    idx = end(idx);
  ) :

  c == '\r' ? (
    insert(idx, '\n');
    idx += 1;
  ) :

  c == 'ins' ? (
    mode = !mode;
  ) :

  c >= 32 && c < 127 ? (
    mode ? (
      str_setchar(buf, idx, c);
      len = max(len, idx += 1);
    ) : (
      insert(idx, c);
      idx += 1;
    );
  );
);

gfx_x = gfx_y = 0;
x2 = mouse_x + 2 * gfx_ext_retina;

i = ofs;
j = -1;

while(i <= len && gfx_y < gfx_h) (
  i == idx ? (
    x = gfx_x;
    y = gfx_y;
  );

  x2 >= gfx_x && mouse_y >= gfx_y ? j = i;

  i < len ? (
    (c = str_getchar(buf, i)) == '\n' ? (
      gfx_x = 0;
      gfx_y += gfx_texth;
    ) :
    c == '\t' ? (
      gfx_x = (floor(gfx_x / tab) + 1) * tab;
    ) : (
      gfx_drawchar(c);
    );
  );

  i += 1;
);

(mouse_cap & 1) && !(cap & 1) && j >= 0 ? idx = j;
cap = mouse_cap;

idx < ofs ? ofs = home(idx) :
idx >= i && y >= gfx_h ? ofs = end(ofs) + 1;

!gfx_ext_flags && (blink < 6 || !len) ? (
  gfx_x = x;
  gfx_y = y;
  gfx_drawchar(blink >= 6 ? ' ' : mode ? '_' : '|');
);

(blink += 1) >= 12 ? blink = 0;

Last edited by Tale; 08-01-2021 at 01:09 AM. Reason: Added @serialize section, added left mouse click, fixed/ignore non-ASCII chars, don't blink when embedded, added 20:1 .
Tale is online now   Reply With Quote
Old 06-04-2021, 04:04 AM   #16
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,795
Default

Hi Tale thanks a lot for your Js notepad, i like that we can embed it on TCP.
When it's embedded we can't write something on it, would it be possible to support this feature? Thanks!
Vagelis is offline   Reply With Quote
Old 07-08-2021, 11:42 PM   #17
USR
Human being with feelings
 
Join Date: Jun 2018
Posts: 138
Default

I used Tale's JS Notepad in my project, and noticed that the note isn't saved in the project file, so gets lost when you reopen it...Otherwise this would be very useful.
USR is offline   Reply With Quote
Old 07-29-2021, 04:23 PM   #18
dagamusik
Human being with feelings
 
dagamusik's Avatar
 
Join Date: Aug 2020
Location: Colombia
Posts: 165
Default

Quote:
Originally Posted by USR View Post
I used Tale's JS Notepad in my project, and noticed that the note isn't saved in the project file, so gets lost when you reopen it...Otherwise this would be very useful.
Have you tried saving it as a preset?
dagamusik is offline   Reply With Quote
Old 07-29-2021, 05:37 PM   #19
USR
Human being with feelings
 
Join Date: Jun 2018
Posts: 138
Default

Quote:
Originally Posted by dagamusik View Post
Have you tried saving it as a preset?
I've just tested what happens when it's saved as a preset and an fx chain, but no luck unfortunately.
USR is offline   Reply With Quote
Old 07-29-2021, 11:33 PM   #20
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

You're right, the code I posted doesn't @serialize the data.
Tale is online now   Reply With Quote
Old 07-31-2021, 03:33 AM   #21
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

I've just added a simple @serialize section to the code I posted earlier, so now it should save the text with your project.

EDIT: I've also added left mouse click support, and I've fixed non-ASCII characters by ignoring them.

Last edited by Tale; 07-31-2021 at 04:19 AM.
Tale is online now   Reply With Quote
Old 07-31-2021, 11:03 PM   #22
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,499
Default

Thank you for this Tale! It saves perfectly now!

How (if possible) would I have to edit the code so that when the effect is embedded, the cursor would stop blinking? Not a big deal but would be nice!

Also, anyway to add the option to write on it when embedded without opening the effect?


Last edited by Pink Wool; 07-31-2021 at 11:14 PM.
Pink Wool is offline   Reply With Quote
Old 07-31-2021, 11:24 PM   #23
USR
Human being with feelings
 
Join Date: Jun 2018
Posts: 138
Default

Thanks, Tale! This is great.

I modified the gfx width/height ratio, so the embedded GUI doesn't get tiny when the track height is small. 20:1~30:1 seems like a sweetspot. (It was talked about in another thread here: https://forum.cockos.com/showthread....72#post2451172)

And I also think it would be nice if we could hide the cursor in the embedded GUI. The more instances of this you use, the more blinking cursors you see, which can be annoying for some.
USR is offline   Reply With Quote
Old 08-01-2021, 01:09 AM   #24
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Pink Wool View Post
How (if possible) would I have to edit the code so that when the effect is embedded, the cursor would stop blinking? Not a big deal but would be nice!

Also, anyway to add the option to write on it when embedded without opening the effect?
But how would you know where you would write without the blinking cursor? That being said, it would seem that embedded JSFX don't get keyboard input, so it isn't possible to anyway.

But I have just added a !gfx_ext_flags check, so the cursor isn't displayed at all when embedded.
Tale is online now   Reply With Quote
Old 08-01-2021, 05:08 AM   #25
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,499
Default

I know this is probably way too advanced stuff to ask here but can JSFX inherit properties from a track? What I mean, would it be possible to have the notes inherit bg colouring from a track?
Pink Wool is offline   Reply With Quote
Old 08-02-2021, 11:39 PM   #26
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

I don't think JSFX can do that, at least not directly. I guess it might be possible to figure out the track color some other way, and then pass this info to a JSFX plugin.
Tale is online now   Reply With Quote
Old 03-25-2022, 02:03 PM   #27
Pluq Studio
Human being with feelings
 
Join Date: Jul 2017
Posts: 10
Default Embedded MCP UI

Hi I tried the Notepad JS effect and love the idea! For me it would be a whole lot better if the embedded MCP UI would work (only the embedded UI in the TCP works at the moment). Is there a way to have the height of the UI in the mcp depend on the lines typed in the notepad?
Pluq Studio is offline   Reply With Quote
Old 05-24-2022, 02:48 AM   #28
aklo sabbaoth
Human being with feelings
 
Join Date: Nov 2019
Posts: 16
Default Change color text

Wow! this plugin is amazing, the only thing I would like to change is the text color. I can change the background color from: FFFFFF to 141414 (which is a nice dark color), but don´t find any code for the text color. Would this be possible to do?
Thanks in advance and thank you very much for the code.

p.s.: JFSX plugins are written in javascript or it is another language?

Last edited by aklo sabbaoth; 05-24-2022 at 04:08 AM. Reason: c
aklo sabbaoth is offline   Reply With Quote
Old 05-24-2022, 06:53 AM   #29
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by aklo sabbaoth View Post
I can change the background color from: FFFFFF to 141414 (which is a nice dark color), but don´t find any code for the text color. Would this be possible to do?
Yeah sure, just replace gfx_set(0) (just below @gfx) with gfx_set(r, g, b). Note that r, g, and b are values between 0.0 and 1.0 (not 0 and 255), so e.g. this would set the color to orange:

Code:
@gfx 20 1

gfx_set(1.0, 0.5, 0.0);

Quote:
Originally Posted by aklo sabbaoth View Post
p.s.: JFSX plugins are written in javascript or it is another language?
They are written in EEL2, although I usually refer to it as simply "JSFX".
Tale is online now   Reply With Quote
Old 05-24-2022, 10:48 AM   #30
aklo sabbaoth
Human being with feelings
 
Join Date: Nov 2019
Posts: 16
Default

Quote:
Originally Posted by Tale View Post
Yeah sure, just replace gfx_set(0) (just below @gfx) with gfx_set(r, g, b). Note that r, g, and b are values between 0.0 and 1.0 (not 0 and 255), so e.g. this would set the color to orange:

Code:
@gfx 20 1

gfx_set(1.0, 0.5, 0.0);


They are written in EEL2, although I usually refer to it as simply "JSFX".
Thank you very much man! I´ll check it out right now.

Ok, so I already changed it, nice dark background color, with a light gray text color and in bold font, so it makes it easier on the eyes, specially at 4 am. Here´s what I changed:

1) here´s for the background color:

Code:
@init

gfx_ext_retina = ext_noinit = 1;
 gfx_clear = 0*141414;
2) Here´s for the font size, color and bold style:

Code:
@gfx 20 1
gfx_set(0.7, 0.7, 0.7);
gfx_setfont (1, "Arial" , 20 , 'b'  * gfx_ext_retina);
I´ve asked about the code because I want to make a contribution to the community and make simple, but perhaps, some useful plugins that suits more people, like an horizontal Loudness Meter, an automatic VU gain staging plugin, a native gain rider and so on. And perhaps then more complex and useful ones.

Last edited by aklo sabbaoth; 05-24-2022 at 11:25 AM.
aklo sabbaoth is offline   Reply With Quote
Old 10-13-2022, 02:47 AM   #31
dimitris_T
Human being with feelings
 
dimitris_T's Avatar
 
Join Date: Jan 2012
Location: Greece
Posts: 95
Default

Quote:
Originally Posted by solger View Post
In regards to notes or a notepad, these options currently come into mind:

If you're referring with 'JS Notepad' to something else: can you please elaborate or post more details about what features you're looking for.
The "Extensions -> Notes" is great! Global notes, track notes, item notes, and more
dimitris_T is offline   Reply With Quote
Old 07-01-2023, 06:50 PM   #32
NickJA
Human being with feelings
 
Join Date: Nov 2019
Posts: 15
Default

Thank you for creating and editing this JSFX plugin Tale and everyone.

For getting around copy/paste issue, I use this short AutoHotKey(V1) script to send keystrokes from the clipboard via a keyboard shortcut.

Code:
SetKeyDelay, 35
1:: Send % Clipboard
NickJA is offline   Reply With Quote
Old 09-09-2023, 02:27 PM   #33
smda123
Human being with feelings
 
Join Date: Nov 2021
Posts: 13
Default background opacity

Is there a way to make the background transparent? thank you
smda123 is offline   Reply With Quote
Old 09-10-2023, 02:55 AM   #34
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by smda123 View Post
Is there a way to make the background transparent? thank you
AFAIK that's not possible in JSFX.
Tale is online now   Reply With Quote
Old 10-31-2023, 02:50 AM   #35
robotron
Human being with feelings
 
Join Date: May 2020
Posts: 337
Default

Thanks for making this, just what I was after.

One thing that's occurring for me is that it's not adding a space when hitting the spacebar, although Shift+Space enters a space ok. I'm on a UK keyboard in case that's relevant.
robotron is offline   Reply With Quote
Old 11-01-2023, 12:34 AM   #36
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by robotron View Post
One thing that's occurring for me is that it's not adding a space when hitting the spacebar, although Shift+Space enters a space ok. I'm on a UK keyboard in case that's relevant.
Same here, but if I right-click on the plug-in name after adding it, and enable "Send all keyboard input to plug-in", then I can use the spacebar.
Tale is online now   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 01:51 AM.


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