Anushri Code

Hello!

Since I don’t totally enjoy the anushri’s Bass Drum sound, I’ve decided to really read the whole “drum synthesis” code, and maybe try to make some interesting mods over there.

I’ve understood the sample part, with the raw file.

But I’m not really sure I’ve fully understood the whole waveform part of the code.
I get how the sine is done, but I don’t get the whole nodes part.

Maybe I just need few more hours reading through the code to understand, but maybe someone could help me [and others] too, here.

I really think that this part of the anushri is an invite to start modding the code, that thing I didn’t dare trying on any shruti.

My ideas are:
Using full samples for snare and BD too.
Trying weirder things for snare and BD without full samples like hh.
Trying simple synthesis instead of 8bit samples.
Trying to have a trigger mode that would trigger MD or TR drum sounds.

Another thing I’d like to try with anushri is to use it to send a clock message to a gameboy playing LSDJ.

Let me know if you have insights, ideas, or if any of my goals are impossible to reach.

You don’t have to understand the “nodes” bit to work on the drum synthesis part - this is related to the drum sequencer.

Also, there’s a good chance that what you don’t like is not the bass drum sound but its 8-bit resolution and you won’t be able to fix that.

> Using full samples for snare and BD too.

Not enough memory for that.

> Trying simple synthesis instead of 8bit samples.

That’s what the BD/SD currently are.

> Trying to have a trigger mode that would trigger MD or TR drum sounds.

Doable, see my latest answer to defenestration about the shift register port.

The code that renders the drum signals is here.

Lines 190…193 are an interpolated sine oscillator ; line 194 applies a gain to it. The frequency of this oscillator and the gain are controlled by decaying envelopes computed in UpdateModulations.

YEAH, my guess was it was about the sequencing, but since it was under “waveform” section… I was in a very deep doubt!

Yeap I had almost understood the sine part. And the enveloppes.

But my “simple synthesis” idea, was more about trying to get some “cleaner” sounds even if they don’t sound like drums at all [or maybe something really noisier…] Experiment I will!

When you say “not enough memory”, does the hh sound take the whole memory there?

Anyway I think I’ll have to understand the whole code in order to start modding it.

Thanks a lot for your answers here!

Anushri is my winter project, casing, modding, and coding.

I think you are looking at the python code, this is not what runs on the ATMega. The python code just does all the data mangling/computations at compile time.

There are about 6k of flash for the drum synth, which are taken by the HH sample. This is not enough for more samples.

Anushri’s BD is actually very clean internally - it sounds noisy/distorted because of the 8-bit resolution of the output (if a 16 bit converter was available, it would sound like TR sounds) - you won’t be able to get something cleaner than that.

I’m not sure what synthesis methods for the high hat olivier tried and discarded, and the high hat sample is quite serviceable, but I find myself wishing the Anushri hats were a simple simulation of white noise through a resonant bandpass filter with a few AD envelopes for amplitude, filter frequency, and Q, perhaps slope as well - map some of the more ‘standard’ results of the architecture to the HH tone soft knob but make sure to declare CCs for all the parameters and don’t forget to send me a copy of the firmware :wink:

even with 8bit output you can still get some lo-fi clicks, pings, sizzles, zangas, noise washes and swells, reversed noise hats, filtered airplane takeoff blooming boooom type things?

Yeap, I totally understand such resolution/memory limitations.

I was looking to python part to understand where it all came from!

Anyway, I’m not looking for turning the BD into a clean BD sound, but maybe trying to get some percussive bits that wouldn’t sound that dirty. Being used to such things with my daily gameboy lsdj synthesis, I might have an idea, but still, I need a better understanding of the whole code before further investigations!

So I won’t bother you with all this before I’m getting more familiar with the whole anushri code. I feel like going back to my engineering school! :slight_smile:

I truly think anushri is a lovely start for modding mutable code parts [shruti’s code was frightening me]. Thanks again for such support and detailled clean code.

BTW if anyone around here is familiar with the arduinoboy project, and lsdj control, feel free to contact me since I’m really looking forward to using anushri to sync my GB to my midi setup.

i think you could get something cleaner if you would replace it for a clap or a woodblock or conga or something… the noise is especialy noticale on the kick drum because of the low frequency of the sound… And on a sound like a snardrum or a clap the noise would just bleed in with the noise of the sound itself.

> I’m not sure what synthesis methods for the high hat olivier tried and discarded, and the high hat sample is quite serviceable, but I find myself wishing the Anushri hats were a simple simulation of white noise through a resonant bandpass filter with a few AD envelopes for amplitude, filter frequency, and Q, perhaps slope as well

If the HH is so limited, this is not out of laziness, but simply because there are only a dozen CPU cycles available for it. What you describes would take about a hundred CPU cycles (assuming you do the internal computations on 16-bit to keep stability).

For the HH I tried a high-pitched sine oscillator with noise FM and a high-pitched sine oscillator with noise AM. They fit the CPU cycles constraint but were not very convincing.

> And on a sound like a snardrum or a clap the noise would just bleed in with the noise of the sound itself.

Yes, that’s why the last BD “tone”, which has noisy amplitude modulation, doesn’t sound as noisy as the other ones. The noisy part comes from playing a pure tone with a low amplitude through converters with a limited resolution.

So an already dirty bass square wave blop would sound less BD but cleaner [compared to the sound expectation]?

If the sound has a low frequency, a spectrum dominated by the first harmonics, and if the amplitude decays (= increasing quantization noise), you’ll still perceive noise.

just a square would sound very clean but a long decay of of a square wav will sound noisy…

always a step behind here :wink:

Haha!

Yeap I was thinking of short/neat square blop to avoid the noise you’re talking about.
But an already noisy short bass pwet could be sweet too.
I think I’ll experiment on my gb and try to transpose in anushri code the kind of bd sounds I have in mind.
Most times I end up using only weird pitched noise as BD sounds on lsdj so…

Two simple approaches:

  • Try editing the drum sounds with CCs and see if you can get something interesting out of the engine without any modification, just different parameters. Then it’ll only be a matter of writing down the results into the “presets” morphed by the tone knob.
  • Replace the sin table by a square table.

pzshaw! I do not think you are lazy

the architecture I describe is fantasy to be sure - 16bit internal computations and stability - not exactly needed - I’d mainly look to have it make uneven dirty clicks and crunchy noise puffs and look to further exploit the 8bit output’s ability to make horrible grating sounds - don’t really need an actual hi-hat sound per se although I do have fun with the sample, it’s nice to be able to pitch it.

just re-read the Anushri dev notes to refresh my memory and I’m quite curious to hear what the high-hat synthesis approach you were trying sounded like - I don’t believe that version of the code is available on github though? any recordings available?

this Anushri is a big can of worms you’ve opened up here (meant in the best way possible)

sounds that work on a Gameboy should work for the anushri tooo … a gameboy is just 4bits sound…

> 16bit internal computations and stability – not exactly needed

Needed if you want a SVF that will not turn into a noise generator after a handful of samples :slight_smile:

I don’t understand the stability issues of using 12 or 8bit internal computations? my earlier mention of an SVF bandpass filter processing white noise was more conceptual than literal and I wouldn’t actually take that approach - in my head I’m thinking of starting from clocked binary noise thru an amplitude envelope but I should probably go to sleep now :slight_smile:

> I don’t understand the stability issues of using 12 or 8bit internal computations

Truncation / rounding / coefficient quantization issues with filters.