Thanks for trying it out, all of you, and all the thoughtful comments! I was kind of expecting a bit of āno, no, no, modular is finding ways to do math with circuits, not codeā gatekeeping, so if those people exist, Iām glad they havenāt tried this yet
Iām going to answer some questions and probe for more details below, but none of my thoughts are final, to be clear.
@FiroLFO
- Is elseif going to be available?
Iāve bumped into wanting this as well. Iāll investigate.
- Is there a way to check if a cable is plugged in (see isconnected())?
Like isconnected(out1) or isconnected(in1)? Iām surprised this is desirable, since I feel like the author of the code would also be the person connecting cables to it (or not). Can you describe the situation youāre thinking of a bit more?
- Any trick to include a string variable (i.e. seq1=ā10101100ā)?
At first glance, this looks more like an array of booleans than a string. Iām thinking about arrays (see below), but would love to know more about how you want to use them in this case.
@main.tenant
Yes, arrays are of interest. In BASIC (at least the BASIC I grew up with), one would do a DIM[10] to make an array, but I think the need for explicitly setting array sizes is firmly in the past. But hereās a divisive question: 0-indexed or 1-indexed? I think 0-based, but that requires more explanation to new programmers.
There is a mod(a, b) function, which is really doing std::fmod(). I tend to think of ā%ā as a modulo operator for integers, and integers arenāt really a thing in BASICally. Also, approachability of the language is also of value to me (Iām assuming most VCV Rack users have never written a program), and I worry that punctuation marks are more off-putting than mod() or pow(). I like that mod(foo, 1) returns the part of foo after the decimal point.
Yeah, why BASIC? Itās not like Iāve written any since, uh, 1983-ish. Well, at first I was struck by the joy in Hainbachās voice when he realizes that he can program a tape machine with the language of his C64 childhood. And then I thought, you know, BASIC is still very approachable, in that I suspect that you can have no experience with writing software and be able to tweak examples to do what you want. BASIC was, after all, created to introduce inexperienced students to programming. I know there are academics who wish it hadnāt been, though.
Iām not suggesting that I would want to write longer programs in this tiny subset of BASIC, but the context (inside a modular system with a tiny UI) doesnāt really lend itself to long programs anyway*. Thereās plenty of environments that do code->music well (CSound, ChucK, Pure Data, live coding languages, etc.), but this doesnāt call for that, in my opinion; this is, like Perl and AWK, more of a glue language, enabling other modules to work together in a novel manner. Or at least a gesture in that direction.
But Iād be fascinated if someone else decided to cram some significant portion of Lua in Rack. And, well, I think one could slap a different parser on it and generate the same PCode from a pseudo-Python or what have you. I just didnāt feel like explaining Python indentation in the docs.
More INās and OUTās: I quickly noticed the need for more INs myself, so the current version of the module in development has 6 INs and 4 OUTs.
Iāve been considering pushing the edit window to the right enough to add another column of ports, which is probably enough for ~seven more ports. Iāve been thinking that 11 INs and 4 OUTs
would be pretty good (with room for a couple more controls).
Thoughts?
Have you found yourself needing more OUTs in particular? That (so far) is less compelling to me.
I personally dislike expanders, as they seem terribly undiscoverable to me (Iāve been using Rack for a year and only recently heard of them).
@k-chaffin I think this ārestartā behavior is a really good thing to point out. Since Iāve been thinking that one-time-per run code could go into an āON RUNā¦END ONā block as well (in part so they donāt get run every sample), I need to think more on how to make this essentially a pseudo-multithreaded system, and how these ON blocks might interact.
There is no set limit to how deep FOR-NEXT loops can nest. But do bear in mind the slightly surprising detail about FOR loops.
Arrays, yes, I agreeā¦
Thank you for the kind words. It feels like Iāve spent more time on the editor than on the compiler. I wish I had gone ahead and started with making my own version of TextField instead of subclassing it for as long as I did. The next version will have simple scrolling, which I think youāll all like.
@DaveVenom I know what you mean about some knobs, but then I feel like every time I see a knob I think, wait, what if I want to modulate it? Iām kind of frustrated that I canāt find a thin module with knobs/outputs/renamable labels, so I could just put it next to BASICally and hook them in. PatchMaster is almost there. So is MentalKnobs. So Iām torn.
Polyphony is really deep, as you describe. Iād love to have some use cases from you in the form of code and desired results to ponder over, since itās something I never use.
Make the editor disappear entirely; that seems very doable. Smaller STYLE knob is a good point.
As you can see from the screenshot above, the Good/Fix area will be different in the next version. But flashing is pretty distracting to me, so Iām disinclined to do that. I think the fact that the word changes (from Good to Fix) is helpful. I tried looking at the indicator via Edgeās color-blindness simulators, and while the difference is present, Iāll tweak the color and text shades a bit to clarify that they are different states.
Thanks again for sharing your experiences.
mahlen
*That said, I recall hearing that the authors of AWK were taken aback the first time they saw a 200-line AWK program.