Development Group: class library / sclang

I would have liked to participate in this group if my programming skills were good enough… Unfortunately I have no experience with C++ and my programming skills are very basic. (I am not a computer scientist.)

Anyway, I think it would be very useful if SC could support musicXML export, and I tried it for three weeks with a function. You can find it in the following thread

I do not know how many people in this group are interested in such work. I would like to participate in this group if my design could be a starting point for musicXML support in sclang.

Hi @prko - happily no C++ knowledge is needed to get started working on the class library since it is written in sclang. For what its worth, a number of people in this group, and indeed some of the maintainers of the project, come from a musical background rather than computer science.

1 Like

Hi All - Let’s convene a first meeting for the group! Dates will be not this weekend but next (Aug 5 and 6)

here’s a poll for meeting times: https://rallly.co/invite/1BDgUCAsYJ89

The meeting will be held on Jitsi: Jitsi Meet

Hope to see as many of you there as have interest!

2 Likes

The first meeting will be Sunday, Aug 6 at 10 AM PDT - 1PM Eastern - 6PM GMT

Anyone interested please do attend! (and feel free to broadcast via Discord etc)

The meeting will be using Jitsi

SC Class Lib Group Meeting

Join a WebRTC video conference powered by the Jitsi Videobridge

Excited to e-meet you all!!

Good to see the group taking shape :slight_smile:

For those of us that can’t regularly make the meetings, but would like to track the progress, it would be great to see the meeting minutes continue to be tracked.

Now that there are multiple working groups, perhaps a separate wiki of minutes for each group would make sense, or otherwise just a clear title denoting the working group for each entry (more convenient for readers IMO).

1 Like

Hello,

I would like to attend the meeting, but it is on Monday 7 August at 2:00 AM here in my local. So I may not be able to attend as I will certainly be asleep at that time.
I will try to attend the meeting, but I would appreciate it if the participants could discuss the classes and methods presented in the following post in case I am not at the meeting:

The methods and classes should be improved, but it seems not bad to discuss their implementation as primitives of sclang as an idea.

I am not sure

  • whether SPN should be a subclass of the collection class, or a class under the object class. N.B.: Scientific Pitch Notation is a naming system for pitches that combines pitch class and octave.
  • whether PitchClass could be added independently of @josh’s PitchClass. If it could, where should it be? a subclass of the collection class, or should it be a class under the object class?

I hope that SuperCollider users will be able to create musicXML files by simply using some subclasses of the collection class with sclang presented in the following post to further work seamlessly with their preferred notation software, and I think that implementing SPN and PitchClass is the first step towards making the function in this post a class with a method:

Thanks in advance!

1 Like

Hi @prko - if I do the next group poll, I will be sure to include better time choices for your time zone - still no guarantee that an acceptable time will be chosen but at least there will be a chance. My apologies for the poor planning. We will be sure to discuss your post.

@mike This strikes me as a good idea - (I would add, looking over the wiki it seems a lot there is out of date!)

1 Like

Thanks!

However, the meeting time should be chosen for the majority of attendees or for people who have an important role to play. I see there are too few users in Far East Asia. I have seen international online meetings at 2:00 a.m. in my local several times.

Also, my English is not fluent in speaking and listening. Suggesting my idea this way might be better than attending the meeting.

Please do not take my time zone into consideration.

I’ve kept quiet because of other obligations, but feel that the class library is where I can help out the most. (However, due to time zone, and also the fact that semesters get extremely busy, I don’t anticipate joining very many calls.)

On the question of breaking compatibility: If we want to do something about the long-standing complaint of “too many ways to do things,” I suppose that a gradual approach might be best.

First, identify areas where there are “too many ways,” and decide what should be the standard way going forward. (Here, there’s a SC-community cultural problem: Often, when someone asks a question on the forum, the answer is of the form “you could do it this way, or that way, or if you also need this, then there are these other three ways,” often spread out among several responses. This cultural bias toward multiple solutions would have to shift toward “here is the standard way, highly recommended.”)

Then, document recommended approaches and make the user community aware of that. (Tricky, because, as noted elsewhere, an unknown number of SC users don’t engage with the forum at all.)

Then start chopping. I’m not sure if it would be better to do this all at once (one big set of changes for everyone), or to do it incrementally.

~~

Now, here’s a big idea.

Something I’ve thought about for a long time, but don’t have the bandwidth to develop solely by myself, is a modular DSP approach built on top of nodes and buses.

Pain points such as: For many new users, buses are confusing. Groups and node order are confusing. “I have a synth argument and I want to set it to a UGen” is confusing. “I want to swap out the oscillator in my SynthDef” is currently possible only by rewriting the entire SynthDef and trashing the old node.

We could conceive of SynthDef as just one module in a larger structure, say, a PatchDef that defines connections between modules and provides named access to some or all modules (to support hot-swapping). Currently we make a Synth from a SynthDef. Making a Patch from a PatchDef would automatically allocate buses for each connection and create nodes in the right order. When the Patch ends, buses would be released. (Probably needs a different name, because crucial library already claims Patch.)

myPatch.set(\ffreq, Module(\myLFO)) could automatically grab a control bus and map.

myPatch.setModule(\oscModule, Module(\squareOsc)) or something would hot-swap.

JITLib already does a lot of this, but AFAIK there is no way to make multiple independent instances of a ProxySpace short of re-running the code. I’m proposing Synth is to SynthDef as PatchOrSomeOtherName is to PatchDef, but there is no “ProxySpace is to ProxySpaceDef.”

The broader point is that one of the hurdles in learning SC is that users have higher-level needs, but we are addressing them using low-level abstractions that are tightly coupled to scsynth’s architecture. So every user eventually runs into these problems, and every user has to grapple with manually managing buses, node order etc. But the whole point of abstraction is so that we can talk to the machine on our terms, and let the software handle the specifics. Of course, eventually you’ll run into a situation where you have to understand the architecture anyway – but currently, users hit that barrier early. Better abstractions could push that barrier further down the road, when the user has gained more knowledge. (That is, there would be a culture shift as well. Currently SynthDefs are normal – but what if Modules and Patches were normal, and you use SynthDef directly only for special cases where there is no way other than to dig into the guts?)

I guess… take it or leave it…? I haven’t done this myself because it would require very good object design, and I’m just not good enough at software design for this (I’m aware of my limits here). I’d be willing to participate.

hjh

4 Likes

sclang/ClassLib Dev Meeting 2023-08-06

  • Attendees: Josh, Michael, Mike, Mike, Stefaan, Jordan

Thanks to all who attended! Please raise any issues that weren’t captured in these minutes and I’ll update here and on the minutes archive wiki.

Dev process

Started out discussing the Dev process. At a high level, we’d like to see:

  • Clear development cadence for a sense of momentum and that SC is a live project.
  • Communicate the dev process more clearly so people new to contributing have a sense of the process, and where they can start.
  • Focal “projects” to rally around, that can also drive release milestones.

Focal projects

Ideally these would consist of small working groups (or very motivated individuals) that do the varied work of large changes:

  • E.g. state the problem clearly to the community, field their ideas in response, triage and prioritize requests, set the milestones and provide periodic summaries to keep the community updated and solicit targeted feedback.
  • A couple examples of focal projects might be:
    • Cleaning up the quark system: systematically identifying and removing pain points
    • Refactoring the class library
    • Outreach and documentation around dev processes
  • An example of a project suited for a personal initiative:
    • Make the Quark library more deeply searchable (keywords, class names, etc.)
  • Not everyone wants or has time to be involved with larger focal projects, we should still be actively supporting individual initiatives for those with passion projects (more exploratory, open-ended, or less deadline-driven)

Refactoring / trimming the Class Library

Some initial discussion took place…

  • The existing directory structure in SCClassLibrary already suggests what might stay and what might better be a Quark.
  • Any group implementing this would, in the course of testing, come up with a “Vanilla SC install”, akin to pd-vanilla. This is essentially the goal of the project: to make SC itself “vanilla”.
    • So as a thought experiment: in lieu of consensus or of a successful refactor, what about the possibility of an officially maintained fork: sc-vanilla.
      • there were murmurs of skepticism, w.r.t. counterproductively growing the maintenance base, but… worth considering?

Low-hanging fruit

How do we move through “low-hanging fruit” on the ever-growing Issues list?
Meanwhile we have people eager to become new contributors!

  • New Contributors are confused on how to get started and on the review process.
    • What’s the review process? Who are reviewers?
    • How do we get more people to join the review process?
      • We have “good first issue” for contributors, how about a “good first review” for reviewers?
  • We can try to make more effort to usher in and follow through with “Good first issue” contributors.
  • This has been discussed many times on various forums, it’s worth revisiting those posts…

Documentation

The never-ending Project

Self-advocacy

We recognize dev efforts are spread thin, if you have an open issue or PR, you may need to follow through with pings/reminders.

  • Don’t be afraid of being annoying, showing enthusiasm and commitment is generally a good thing :wink:

“Projects” as swappable quark packages

A kind of meta quark that would install all required quarks for your project

  • Temporarily remove non-project quarks?
  • Would help when sharing/migrating your project to new systems.
  • There is partial support for this already, but could definitely be smoothed out.
  • Examples:
    • Your art project has x, y, z dependencies. You sit down to work on it, when opening that project you can expect all the quarks to be loaded/pulled down, and none you didn’t need.
    • For contributing to the SC, you want to make sure you’re not accidentally including Quark-dependent methods, so you load “SC Dev” Project that removes/disconnects all quarks so you can be sure you’re just compiling the default classlib.

Namespaces

…aren’t technically supported (maybe SC 4 X-P), but for Quark authors, a prefix on class names is helpful. Ex: Josh’s CTK quark.

  • keep in mind that if you modify your existing quarks, it can break for users that currently use it. Make use of the quarks versioning feature so users can check out old versions!

This brings up the question: do we have a Tutorial on publishing quarks?

  • Does it highlight all the features? In particular, versioning/tagging. #GoodFirstIssue

Search-ability of Quarks

Many quarks are black boxes… Are the current metadata fields enough to learn about the quark at-a-glance?

  • Should we add more metadata fields?
  • Should they be displayed differently in the list view?
  • Many Quark authors haven’t made use of the existing metadata features, most importantly the description! Should PUNISH them??? Well ok, no… but we can
    • do a public service campaign to encourage them to put at least a description
    • sort the Quark list in the GUI so that those with descriptions are listed first

Pitch class

There’s been a spirited discussion around inclusion of a Pitch class to SC.

  • There are lots of conventions to consider, with variations in, e.g., scales and nomenclature varying across culture.
    • We won’t capture all the possibilities… but that shouldn’t stop us from having some solid foundations for people to get up and running without having to build their own.
    • And we can keep adding in the future of course with community feedback!
    • Better yet, if the class is easily extendable so composers can easily build their own wild tonalities.
  • By one view, this is a perfect candidate for a Quark. On the other hand, the functionality is close enough to the heart of SC that a case can be made for it to be in the Core.
  • As an example of a class that is well underway to this end: CTK’s PitchClass https://github.com/joshpar/Ctk/blob/master/Ctk%20classes/PitchClass.sc
    • This is NOT a good example of how to (not) document a class (Josh!!! :stuck_out_tongue_winking_eye:)

Threading in sclang

  • Could there be ways to handle threading in the language more gracefully?
  • Examples discussed would, in some cases, alleviate the need to call the mysterious s.sync.
    • @jordan feel free to elaborate or post your Issue if you file one. EDIT: I see a related thread may be underway already.

Meta-resource: Development-meetings:-procedure-and-templates

3 Likes

This dovetails with some of what was discussed in the meeting just now. It’s a clear source of friction for newcomers. Specifically, I proposed in the notes above that we have a style guide for SCDocs, and a “standard way to do things” would certainly be helpful in SCDocs revisions.

wrt Patch/Def some in the meeting also expressed concerns for learners with the abstracted layers, busses in particular. So hopefully that discussion can continue here.

Curious about the Pitch class idea. Can someone explain what is intended here? A lot of what seems to be implied is already covered by the Scale and Tuning classes, but I think from the example linked what’s meant is a PitchClass class? Interesting to think about how to do that in a non-culturally specific way. Worth looking at Khyam Allami’s work perhaps, or even asking him to advise on this.

I believe the goal was to use notenames to specify pitches rather than midi numbers as most users come from a music background. One idea was to extend PitchClass, which uses lilypond names for 24edo, to use all of lilypond’s other language formats which can be switched between (perhaps with a classvar). I don’t think the goal was for this to replace Scale & Tuning, but to offer a more familiar interface with a limited number of features.

1 Like

Okay interesting! Will require some careful thinking in terms of how this might interact with Scale and Tuning (maybe need a PitchClasses class to define a naming system). Would be really great to support Tuning/cultural specific naming schemes!

1 Like

I think this was going to limited to 24EDO scales (I was there, but it isn’t my proposal).

Perhaps, before this is attempted, a standard interface could be agreed upon and actually made in supercollider (which hasn’t been the norm for some reason) something like…

AbstractNamedPitches {
   toFreq {|note| subClassResponsibility(thisMethod) }

   // moveable 'roots' (Do) can't do this
   *toFreq {|note| subClassResponsibility(thisMethod) } 

   toPseq {|repeat ...notes| subClassResponsibility(thisMethod) } 
   * toPseq {|repeat ...notes| subClassResponsibility(thisMethod) } 

}
// which might be subclassed like...
WesternNote.language = \english;

WesternNote.toPseq(inf, \a, \b, \ctqf)

// Don't know anything about Raga, just pulled a name off wikipedia so its probably wrong
~bilawalA = BilawalRagaNote(rootFreq: Notes.toFreq(\a)); // assuming 'Sa' is moveable

~bilawalA.toPseq(inf, \sa, \re, \ga)

…making it clearer how this could be implemented for (perhaps culturally) specific naming schemes/tunings such that they might be ‘hot-swapped’ at will.

But perhaps this conversation should break away from this thread.

1 Like

Great that there’s some enthusiasm for the pitch class idea.

This thread/channel is very general and with many ideas interleaved. I was going to suggest, as a matter of process, that it’s totally reasonable and probably more productive to start a new thread on any topics introduced here so they can gain some momentum.

2 Likes

Pitch Class Discussion moving over here: Note Names / Pitch Classes

I also added the tag class-lib for threads spawned from class lib dev group discussions - when we get around to the threads for refactoring and Quark system improvements lets do the same perhaps.

3 Likes

Just came from the main Dev Group Meeting where it was decided to consolidate the general and group dev meeting announcements in one thread. To avoid conflicts, there will be weekly meetings, interleaving the group focuses with more general meetings.

Meeting polls wil be in this thread: Developer meeting polls and the final meeting times announced here: Dev meetings schedule - #111 by MarcinP so do track those!

Next weekend’s meeting will focus on the Class Library - I’ll cross post the poll when it arrives. Look forward to seeing you all next week.

4 Likes

Just to be clear, maybe there was a misunderstanding. Given the fact that JITLib has become a de facto core component, I am in favour of integrating the functionality into the common library, not of moving it out.

If anyone likes to help with improving and factoring it, I am very happy to give advice.

3 Likes

Sorry if I haven’t understood correctly what has been proposed here but I want to add my +1 to NOT removing JitLib functionality from core. NodeProxys are my preferred style and I know others for which this is the case. Having to use a Quark for something like that would be really inconvenient…