BASICally: a new module for writing code within Rack

Ergomomically it is not right that there,s a button on the panel (RUN) that you can manually switch on but you can,t switch off.

But okay, it is what it is… I,ll live with it. :wink:

Hi @StochasticTelegraphnext, I’d need a bit of confirmation …

I read that in general “all variables start with the value 0.0 when first read”. But I’ve just realized that if STYLE is set to “start on trigger, don’t loop” variables aren’t reset to 0.0 on trigger receipt. It is like this by design, isn’t it?

I like this behavior very much actually! I just would like to make sure that it is not a mistake (and so I can build on this).

For example here OUT1 would return 0, 1, 2, 3, and then 4 in this order on receiving triggers. (Instead of 1,1,1,1, and then 1.)

image

Ah, yes, “start” is perhaps more ambiguous than I anticipated. That description might be better as “run on trigger, don’t loop”.

The behavior you’re seeing is the intended one. There are only two events that set all the values to zero:

  1. Loading up the module.
  2. Running a “clear all” statement.

Make sense?

1 Like

Excellent! Thank you!

It’s kind of inspired me to write (eventually GPL3) a module wrapping J the language. I think I’d find it amusing. Running a dll loading thread …

EDIT: It will need someone to build a mac-arm64 of jsource and zip up the bin directory for mac. (Maybe).

1 Like

Here is my demo using BASICally to allow computer keyboard control of my Meander harmony engine by increments of 5ths and 4ths.

2 Likes

Wow nice work :slight_smile:

1 Like

Thanks :grinning:

Note: following question is not a hidden feature request. It is only a question. I’m curious.

@StochasticTelegraph There isn’t any way to loop through the sockets by a ‘for’ loop, is there?

Just to show a simplified example what I mean:

for i=0 to 5
  out1+i=nx[random(0,9)]
next

(Thank you for the not-a-request note.)

No, there is not.

And there’s a perhaps unwelcome surprise in your shorter for-loop version, in that a NEXT has a implied WAIT 0 in it, meaning that the for-loop version would only update, say, out1, every six samples, whereas the flat version will update every sample. Depending on desired outcome, that might be an issue.

I put in the implied WAIT 0 into loops because I didn’t want to make it too easy to stall or stutter Rack by naively taking a long time while iterating over a For loop. But it’s non-obvious at times.

1 Like

Chances for ‘functionnal programming’ in roadmap?

If you mean a true functional language, like a Haskell, Erlang, Scheme, or LISP, mmmm, that would certainly be a different module, and, I would currently expect, one with a far smaller potential audience. But I’d be curious what an example or two of that would look like, in your imagining.

If you instead mean being able to define and then call functions, that seems a lot more tractable, and I’ve certainly encountered the desire for that myself. I don’t relish the thought of trying to explain and document variable name spaces and countless other issues functions could introduce, but functions sure would be nice sometimes…

Javascript is a perfectly usable functional language, isn’t it? Aren’t there any JS modules for VCV? Or was that only in some never updated module?

Are you thinking of this?

It looks like this was less an attempt to surface JS to the user and more to use it within the module’s code?

1 Like

Yeah, I was thinking more of this:

2 Likes

Yeah - I’ve never understood why that has not been ported to V2. A lot can be done with docB Formula One and BASICally, but VCV Prototype had some nice features that I miss. In particular was the ability to format and display multi-line text.

2 Likes

:+1:‍‍

Absent any actual information on motivations, I can imagine a few reasons:

  • This paragraph in the docs gave me pause: “When opening a patch containing a VCV Prototype script, a security warning is displayed before it runs. Only load scripts from patch artists you trust. *Running Prototype scripts from untrusted sources may compromise your computer and personal information.” Yeah, running any random schmoe’s code is a vast security hole. No amount of, “well, you clicked OK” would untarnish VCV’s reputation as “VCV hacked my laptop!”
  • Similarly, I would think that fatal bugs in client code (like divide by zero) would be impossible to protect against. “VCV crashes randomly” is another reputation hit you don’t want. Admittedly, this can happen with modules too, but that code is to some extent reviewed by VCV, I believe.
  • Even less serious bugs stop Prototype’s process engine, implying “VCV can’t be used onstage, it will stop making the right sounds.” While creating BASICally, I realized that halting runtime errors had to be eliminated from the language, even though it makes the language be pretty odd.
  • While I love being catered to, I suspect the audience for Prototype was, eh, not huge?

Again, this is just me speculating from afar.

Not used ‘prototype’,but seriously,good idea module

Lua jit,VUlt,Faust,Super Collider

I’m going to bet your are wrong on this. Shall we say $5?