BASICally: a new module for writing code within Rack

Fantastic. My largest BASICally scripts work fine with 2.0.7 I was able to create a live performance setup using BASICally with Meander diatonic harmony and melody octal radix CV control. I will have to give some thought to posting it here soon. It is a variation of the several ~Misha inspired patches that other have done here.

I like your idea of passing data between modules. One version of the above I did like that, but very simplistically. I believe that this will open up some new ideas for patching and control. II think I qualify as an ā€œuber-nerdā€ :wink:

Also, thanks for the log functions. I will have to try out the unclamped ports.

Good job!

2 Likes

Quick question. Letā€™s say I set the STYLE to ā€œstart on trigger, loopā€ and then I press the RUN button to start the loop.

Is pressing RUN again meant to stop the loop?

That would seem to be logical for me but I canā€™t switch off that lighting RUN manually.

image

In that style, once started, the only way to stop running would be executing an ā€œEXIT ALLā€ statement.

If you want starting and stopping to be completely under external control, then I would consider:

  1. Using the Gate style or
  2. Having a button connected to, say, IN9, and then have a
WHEN trigger(IN9)
  RESET
END WHEN

I think thatā€™ll work?

Oh, just to note, if you are using blocks, Iā€™ve added this to the docs:

NB: Remember that all variables, including the loop variables in FOR-NEXT loops, are in the same variable space. If you are using blocks which might be running at the same time, make sure you use different loop variables in different blocks. Not doing so leads to VERY confusing behavior when running.

I was convinced there was some terrifically subtle bug in the compilation until I realized I was looping over ā€œiā€ in multiple blocks. Thereā€™s some good reasons most languages donā€™t have global variables!

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