foxmoth: (Default)
foxmoth ([personal profile] foxmoth) wrote in [community profile] communal_creators2025-09-08 04:04 am

sampled orchestral mockups + music production: part 0: preliminaries

Howdy! I’m Yoon, an MFA student in media composition and orchestration. I am here today to talk to you about sampled orchestral mockups in composing music, which is what I will be doing for this round of Communal Creators. It’s a niche field even in (media) composition due to the cost + tech barriers to entry. I thought folks might be curious (and maybe interested in trying their hand at a lower-cost version of it).

To the extent that I have musical training (mostly Obligatory Asian-American Piano Lessons by volume), it’s classically inflected. Even folks who hate classical music :) probably know it exists. A more “traditional”/conservatory approach to writing for (symphony) orchestra might involve pen-and-paper composing to generate sheet music. This is my background and I still do a lot of sketching on staff paper.

This inherently means you’re reading (Western classical) music notation (of which more anon) and often means you’re wrassling explicitly with music theory and related topics.

However! These day, hiring a session orchestra is semi-doable by a dedicated individual if you have the money lying around. Read more... )

So most mortals who are doing orchesstral or hybrid orchestral scores for film or TV and especially non-AAA video games are using sampled orchestra mockups.

Note: unless otherwise specified, if I say “music notation” or “music theory” I’m referencing more or less common practice Western (European-derived)-style music notation simply in the interests of avoiding unwieldiness in this overview. some further observations )

Hiring a session orchestra may be surprisingly semi-doable by a normal human but most work in orchestral media composition (film, TV, video game scores) is now done in software via sampled orchestral mockup. This includes classical-ish, e.g. John Williams everything or Carlos Rafael Rivera’s score for The Queen’s Gambit, or hybrid orchestra (e.g. Two Steps from Hell) with synth or “modern” instrumentation elements.

A quick and dirty (incomplete) overview of terms you might come across in this space, with simplified explanations. There’s a LOT of jargon, some of which is obscure or confusing even to e.g. classical musicians entering this space! Read more... )

This has all been in the way of preliminaries, apologies! This is an extremely technical field so the jargon alone is A Lot.

These days, composers often write (in that workflow) using engraving software. In this context, this means “music typesetting for sheet music,” and for session work specifically there are strict formatting rules to save time (money). The other workflow for computer-based composition + production (i.e. not tracking live instruments, of which more discussion later) involves taking everything into the DAW and producing realistic-sounding mockups in software. I will (in future posts) run through DAW examples of this (hopefully with video + audio capture so you can see the workflow).

Happy to answer any questions; it’s almost impossible even to gesture at a bunch of the music or tech stuff in a small space, and I have almost certainly missed some useful jargon because it's UNENDING. :p
ysabetwordsmith: Artwork of the wordsmith typing. (typing)
ysabetwordsmith ([personal profile] ysabetwordsmith) wrote2025-09-08 12:59 am
Entry tags:

Monday Update 9-8-25

These are some posts from the later part of last week in case you missed them:
Mantra
Today's Cooking
Poem
Green Energy
Birdfeeding
Crafts
Birdfeeding
Artificial Intelligence
Philosophical Questions: Economy
Climate Change
Neighborly Request
Today's Adventures
Friday Five
Birdfeeding
Follow Friday 9-5-25: Internet
Food
Affordable Housing
Birdfeeding
Bad Advice
Hobbies: Sewing
Wildlife
Education
Hard Things

Let's Boycott Mississippi has 54 comments. Affordable Housing has 41 comments. Robotics has 68 comments. Food has 37 comments. "Philosophical Questions: Looks" has 53 comments.


[community profile] summerofthe69 has concluded. See Closing Ceremonies for a list of all works. The Amnesty post is also up.


"An Inkling of Things to Come" belongs to Polychrome: Shiv and needs $200 to be complete. Shiv attends the first session of his Worldbuilding class.


The weather is still mild to warm and quite dry. Seen at the birdfeeders this week: a mixed flock of sparrows and house finches, a gray catbird, a male rose-breasted grosbeak, and a gray squirrel. Currently blooming: dandelions, pansies, violas, marigolds, petunias, red salvia, verbena, lantana, sweet alyssum, zinnias, snapdragons, blue lobelia, perennial pinks, oxalis, moss rose, yarrow, firecracker plant, tomatoes, tomatillos, yellow squash, zucchini, morning glory, purple echinacea, chicory, Queen Anne's lace, sunflowers, cup plant, firewheel, cypress vine, sunchokes, sedum. Tomatoes, ball carrots, cucumbers, and groundcherries are ripe.

RogerBW's Blog: Latest posts ([syndicated profile] firedrake_feed) wrote2025-09-08 09:02 am

Soylent Green (1973)

1973 science fiction, dir. Richard Fleischer, Charlton Heston, Edward G. Robinson: IMDb / allmovie. A routine murder investigation will lead to a terrible secret. (Spoilers for a fifty-year-old film.)

kiya: (gaming)
kiya ([personal profile] kiya) wrote2025-09-07 07:35 pm

[ gaming ] In which the party and the plot both fall off a cliff and everyone is a deceiver

Three lunatics and a paladin!

Dramatis Personae:

Viepuck, driving this bus accidentally, who gave the twelve-year-old the wheel
Izgil, with the frustrated pedantry
Celyn, mostly just vibing (I had a few moments but I get tired and muzzyheaded easily at the moment)
Robin, who got to be dramatic at the end

When we left off we were on top of a cliff near Veltor, the capital of the barony.

So we jumped off the cliff, which was the plan. )
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
ysabetwordsmith ([personal profile] ysabetwordsmith) wrote2025-09-08 12:55 am
Entry tags:

Physics

This video demonstrates how the location of mass affects travel downhill.

If you want to build a wheel, put as much of the mass as close to the hub as possible for more efficient travel. Here is an old wagonwheel. See how the center is built up? That's not just to strengthen the area around the axle, it makes the wheel work better.
muccamukk: Darcy sitting at a table drinking coffee, flowers on her right. (Thor: Breakfast Table)
Muccamukk ([personal profile] muccamukk) wrote2025-09-07 09:36 pm

Hugo Homework (from four months ago)

I read these back in May, and my memories are not 100%. Here's my best stab at the three noms for best novel, one for novella, and one tangential to the Lodestar.

A Sorceress Comes to Call by T. Kingfisher, narrated by Eliza Foss & Jennifer Pickens Read more... )

Rainbow heart sticker The Ministry of Time by Kaliane Bradley Read more... )

Service Model by Adrian Tchaikovsky Read more... )

The Butcher of the Forest by Premee Mohamed Read more... )

Rainbow heart sticker Elatsoe by Darcie Little Badger, narrated by Kinsale Drake Read more... )
mecurtin: tabby cat pokes his cute face out of a box (purrcy)
mecurtin ([personal profile] mecurtin) wrote2025-09-08 12:16 am
Entry tags:

Two Purrcys!!

It's been a long time since I did Purrcy posts regularly, I'll try to get back into the habit, starting with #Caturday! When I got back from Worldcon + extra week in Seattle, Purrcy wasn't *terribly* demonstrative ... but he did try some new things, like just parking on the keyboard. No computer, only cat.

Purrcy the tuxedo tabby sits on a desktop computer keyboard, staring off into space. Bits of the screen (bluesky, Surprised Eel Historian) and a messy desktop can be seen around him, but the basic message of No Computer For You is easy to grasp




Love my face! said Purrcy, so I did.
There had to be so many scritches & pets & purrs & paws treading in the air before there could even be cat food or a first cup of coffee, because: priorities! And really, how could I disagree?

Purrcy the tuxedo tabby looks at the camera adoringly while receiving scritches at the side of his chin. His whiskers are spread wide. He's lying on his side on a red blanket spread on a chair, his white paws are clenched as they tread with affection
Chris's Wiki :: blog ([syndicated profile] cks_techblog_feed) wrote2025-09-08 03:25 am

Why Firefox's media autoplay settings are complicated and imperfect

Posted by cks

In theory, a website that wanted to play video or audio could throw in a '<video controls ...>' or '<audio controls ...>' element in the HTML of the page and be done with it. This would make handling playing media simple and blocking autoplay reliable; you'd ignore the autoplay element and the person using the browser would directly trigger playing media by interacting with things that the browser directly controlled and so the browser could know for sure that a person had directly clicked on them and the media should be played.

As anyone who's seen websites with audio and video on the web knows, in practice almost no one does it this way, with browser controls on the <video> or <audio> element. Instead, everyone displays controls of their own somehow (eg as HTML elements styled through CSS), attaches JavaScript actions to them, and then uses the HTMLMediaElement browser API to trigger playback and various other things. As a result of this use of JavaScript, browsers in general and Firefox in particular no longer have a clear, unambiguous view of your intentions to play media. At best, all they can know is that you interacted with the web page, this interaction triggered some JavaScript, and the JavaScript requested that media play.

(Browsers can know somewhat of how you interacted with a web page, such as whether you clicked or scrolled or typed a key.)

On good, well behaved websites, this interaction is with visually clear controls (such as a visual 'play' button) and the JavaScript that requests media playing is directly attached to those controls. And even on these websites, JavaScript may later legitimately act asynchronously to request more playing of things, or you may interact with media playback in other ways (such as spacebar to pause and then restart media playing). On not so good websites, well, any piece of JavaScript that manages to run can call HTMLMediaElement.play() to try to start playing the media. There are lots of ways to have JavaScript run automatically and so a web page can start trying to play media the moment its JavaScript starts running, and it can keep trying to trigger playback over and over again if it wants to through timers or suchlike.

Since Firefox only blocking the actual autoplay attribute and allowing JavaScript to trigger media playing any time it wants to would be a pretty obviously bad 'Block Autoplay' experience, it must try harder. Firefox's approach is to (also) block use of HTMLMediaElement.play() until you have done some 'user gesture' on the page. As far as I can tell from Firefox's description of this, the list of 'user gestures' is fairly expansive and covers much of how you interact with a page. Certainly, if a website can cause you to click on something, regardless of what it looks like, this counts as a 'user gesture' in Firefox.

(I'm sure that Firefox's selection of things that count as 'user gestures' are drawn from real people on real hardware doing things to deliberately trigger playback, including resuming playback after it's been paused by, for example, tapping spacebar.)

In Firefox, this makes it quite hard to actually stop a bad website from playing media while preserving your ability to interact with the site. Did you scroll the page with the spacebar? I think that counts as a user gesture. Did you use your mouse scroll wheel? Probably a user gesture. Did you click on anything at all, including to dismiss some banner? Definitely a user gesture. As far as I can tell, the only reliable way you can prevent a web page from starting media playback is to immediately close the page. Basically anything you do to use it is dangerous.

Firefox does have a very strict global 'no autoplay' policy that you can turn on through about:config, which they call click-to-play, where Firefox tries to limit HTMLMediaElement.play() to being called as the direct result of a JavaScript event handler. However, their wiki notes that this can break some (legitimate) websites entirely (well, for media playback), and it's a global setting that gets in the way of some things I want; you can't set it only for some sites. And even with click-to-play, if a website can get you to click on something of its choice, it's game over as far as I know; if you have to click or tap a key to dismiss an on-page popup banner, the page can trigger media playing from that event handler.

All of this is why I'd like a per-website "permanent mute" option for Firefox. As far as I know, there's literally no other way in standard Firefox to reliably prevent a potentially bad website (or advertising network that it uses) from playing media on you.

(I suspect that you can defeat a lot of such websites with click-to-play, though.)

PS: Muting a tab in Firefox is different from stopping media playback (or blocking it from starting). All it does is stop Firefox from outputting audio from that tab (to wherever you're having Firefox send audio). Any media will 'play' or continue to play, including videos displaying moving things and being distracting.

ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
ysabetwordsmith ([personal profile] ysabetwordsmith) wrote2025-09-07 11:03 pm

Mantra

We were watching Miraculous Ladybug tonight, and one of the characters said something that sounded very useful to me: "My anger is mine, but I am not my anger."  It seems like an effective way to acknowledge any overwhelming emotion without letting it run away with you.
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
ysabetwordsmith ([personal profile] ysabetwordsmith) wrote2025-09-07 10:24 pm
Entry tags:

Today's Cooking

Today I'm making Ultimate Ginger Cookies.  Currently the dough is in the refrigerator chilling.  :D

EDIT 9/7/25 -- These turned out as molasses spice gingersnaps, quite zesty.  They're tricky to bake because you have to take them out while they still seem quite raw in order to leave them chewy.  If they're starting to set up at all, they are crunchy when cold.  However, if you want to make a gingersnap crust or crumble -- or you just prefer crunchy cookies -- that's the way to go. 

The earlier "ultimate ginger cookies" recipe I had was a lot lighter than these, but I couldn't find that one.  I'll probably try again for a version of that, but these really are excellent molasses spice gingersnaps.

EDIT 9/7/25 -- Last batch is out of the oven. \o/

... I am tempted to make apple crumble with the crunchy ones.
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
ysabetwordsmith ([personal profile] ysabetwordsmith) wrote2025-09-07 08:50 pm

Poem

I finished one of my unfinished poems from a while back. \o/

"When Everyone Around You Has Theirs Bowed"
Story Date: Sunday, April 6, 2014
Summary: Therapy for men's genital injury tends to focus on loss, but Marvis Willing knows the proud history of eunuchs.
304 lines, Buy It Now = $152
muccamukk: Saira and Ayesha looking imposing, text: Knock Knock (WALP: Knock Knock)
Muccamukk ([personal profile] muccamukk) wrote2025-09-07 03:03 pm

Two Prompt Fests

[personal profile] spook_me posted: Spook Me Multi-Fandom Ficathon 2025
All fandoms are welcome. Stories can be Gen, Het, Slash or Femslash. All ratings are accepted.

We have TWO new Creatures this year: RAVEN and GRAVEYARD

I have royally failed at this the last like five years, but I do want to keep trying. It's really my favourite prompt fest.



[community profile] fandomgiftbasket posted: Spreadsheet of All Requests
Here is the spreadsheet of all requests!

Link.

There are two sheets on it. The first one is a list of all baskets sorted alphabetically by username, and this is where I'll keep track of the number of gifts. The second is every single fandom request posted individually in alphabetical order, for ease of finding. If you spot anything missing or any mistakes, let me know ASAP.

I don't have a basket this year, but hope to maybe write drabbles or something? Possibly?
Daniel Lemire's blog ([syndicated profile] lemire_feed) wrote2025-09-07 07:44 pm

Splitting a long string in lines efficiently

Posted by Daniel Lemire

Suppose that you have a long string and you want to insert line breaks every 72 characters. You might need to do this if you need to write a public cryptographic key to a text file.

A simple C function ought to suffice. I use the letter K to indicate the length of the lines. I copy from an input buffer to an output buffer.

void insert_line_feed(const char *buffer, size_t length, 
        int K, char *output) {
  if (K == 0) {
    memcpy(output, buffer, length);
    return;
  }
  size_t input_pos = 0;
  size_t next_line_feed = K;
  while (input_pos < length) {
    output[0] = buffer[input_pos];
    output++;
    input_pos++;
    next_line_feed--;
    if (next_line_feed == 0) {
      output[0] = '\n';
      output++;
      next_line_feed = K;
    }
  }
}

This character-by-character process might be inefficient. To go faster, we might call memcpy to copy blocks of data.

void insert_line_feed_memcpy(const char *buffer, size_t length, int K,
                             char *output) {
  if (K == 0) {
    memcpy(output, buffer, length);
    return;
  }
  size_t input_pos = 0;
  while (input_pos + K < length) {
    std::memcpy(output, buffer + input_pos, K);
    output += K;
    input_pos += K;
    output[0] = '\n';
    output++;
  }
  std::memcpy(output, buffer + input_pos, length - input_pos);
}

The memcpy function is likely to be turned into just a few instruction. For example, if you compile for a recent AMD processor (Zen 5), it might generate only two instructions (two vmovups) when the length of the lines (K) is 64.

Can we do better ?

In general, I expect that you cannot do much better than using the memcpy function. Compilers are simply great a optimizing it.

Yet it might be interesting to explore whether deliberate use of SIMD instructions could optimize this code. SIMD (Single Instruction, Multiple Data) instructions process multiple data elements simultaneously with a single instruction: the memcpy function automatically uses it. We can utilize SIMD instructions through intrinsic functions, which are compiler-supplied interfaces that enable direct access to processor-specific instructions, optimizing performance while preserving high-level code readability.

Let me focus on AVX2, the instruction set supported by effectively all x64 (Intel and AMD) processors. We can load 32-byte registers and write 32-byte registers. Thus we need a function that takes a 32-byte register and inserts a line-feed character at some location (N) in it. For cases where N is less than 16, the function shifts the input vector right by one byte to align the data correctly, using _mm256_alignr_epi8 and _mm256_blend_epi32, before applying the shuffle mask and inserting the newline. When N is 16 or greater, it directly uses a shuffle mask from the precomputed shuffle_masks array to reorder the input bytes and insert the newline, leveraging a comparison with `0x80` to identify the insertion point and blending the result with a vector of newline characters for efficient parallel processing.

inline __m256i insert_line_feed32(__m256i input, int N) {
  __m256i line_feed_vector = _mm256_set1_epi8('\n');
  __m128i identity =
      _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 
         9, 10, 11, 12, 13, 14, 15);
  if (K >= 16) {
    __m128i maskhi = _mm_loadu_si128(shuffle_masks[N - 16]);
    __m256i mask = _mm256_set_m128i(maskhi, identity);
    __m256i lf_pos = _mm256_cmpeq_epi8(mask, 
       _mm256_set1_epi8(0x80));
    __m256i shuffled = _mm256_shuffle_epi8(input, mask);
    __m256i result = _mm256_blendv_epi8(shuffled, 
       line_feed_vector, lf_pos);
    return result;
  }
  // Shift input right by 1 byte
  __m256i shift = _mm256_alignr_epi8(
      input, _mm256_permute2x128_si256(input, input, 0x21), 
        15);
  input = _mm256_blend_epi32(input, shift, 0xF0);
  __m128i masklo = _mm_loadu_si128(shuffle_masks[N]);
  __m256i mask = _mm256_set_m128i(identity, masklo);
  __m256i lf_pos = _mm256_cmpeq_epi8(mask, 
      _mm256_set1_epi8(0x80));
  __m256i shuffled = _mm256_shuffle_epi8(input, mask);
  __m256i result = _mm256_blendv_epi8(shuffled, 
      line_feed_vector, lf_pos);
  return result;
}

Can we go faster by using such a fancy function ? Let us test it out. I wrote a benchmark. I use a large input string on an Intel Ice Lake processor with GCC 12.

character-by-character 1.0 GB/s 8.0 ins/byte
memcpy 11 GB/s 0.46 ins/byte
AVX2 16 GB/s 0.52 ins/byte

The handcrafted AVX2 approach is faster in my tests than the memcpy approach despite using more instructions. However, the handcrafted AVX2 approach stores data to memory using fewer instructions.