Old 11-16-2019, 05:02 AM   #1
Buy One
Human being with feelings
 
Join Date: Sep 2019
Posts: 508
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,381
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
 
Join Date: Sep 2019
Posts: 508
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: 6,636
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
 
Join Date: Sep 2019
Posts: 508
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,536
Default

Melda plugins have a free pack, one of the plugins is a notepad .
https://www.meldaproduction.com/MNotepad
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060 -Merging Anubis AD/DA
pepe44 is offline   Reply With Quote
Old 11-17-2019, 09:55 AM   #7
Buy One
Human being with feelings
 
Join Date: Sep 2019
Posts: 508
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,239
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 offline   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,536
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!
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060 -Merging Anubis AD/DA
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,239
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 offline   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: 757
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,239
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 offline   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: 514
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,239
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 offline   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: 1,470
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: 91
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: 123
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: 91
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,239
Default

You're right, the code I posted doesn't @serialize the data.
Tale is offline   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,239
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 offline   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: 757
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: 91
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,239
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 offline   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: 757
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,239
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 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:37 AM.


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