Moln

Moln

Polyphonic subtractive synthesizer

IMG_3510

Moln is a script showcasing a rudimentary polyphonic synth built using the R engine.

Requirements

Norns with R engine installed in the ~/dust/code/r folder
MIDI device
Grid (64/128/256) (optional)
Arc (optional)

Documentation

moln

  • ENC1 adjusts main output level.
  • ENC2 changes filter cutoff.
  • ENC3 changes filter resonance.
  • KEY2 momentary toggles fine parameter control.
  • KEY3 triggers a random note.
  • MIDI device plays notes.
  • GRID plays notes too.
  • ARC changes filter cutoff (ENC1) and filter resonance (ENC2).

More parameters are available. Details in README

Note: Moln is built from general purpose R modules making it a performance intensive script. Polyphony has been lowered from 4 to 3 voices for v1.1.0 due to performance issues/CPU-spikyness. Initiatives have been taken to optimize the linux kernel used for norns. I expect to be able to raise polyphony again in the future (Polyphony is easily changed by editing a constant in the script).

Download

Moln v1.1.1
Github

24 Likes

@jah i love your intense low-fi screen interfaces

7 Likes

R engine has been moved from we repo to: https://github.com/antonhornquist/r

I’ve updated the Moln script which now assumes R engine is installed in ~/dust/code/r folder

3 Likes

this is a great sounding engine!

1 Like

tried this tonight, and love it!
sounds really good, and its very playable. :slight_smile:

1 Like

Sounds awesome!
How are pitches laid out on Grid? It’s different that EarthSea and we’ll tuned to itself but I can’t figure it out.

1 Like

Thanks.

For 16 columns wide grids this is used:


(this is from an addition by @ppqq to the old hello gong script)

For 8 columns wide:

which is the same but padded 4 cols to right.

I’m mostly using an external MIDI device (the OP-1) to play this script, though.

4 Likes

I’m seeing ~ 15% CPU with a CM3+. I like the harmonics at high filter resonances.

FYI. The CPU% reported in the norns UI is an average of all cores. Scsynth runs on one core and IIRC Moln used ~40% with 3 voice polyphony. The problematic bit, though, is CPU utilization spikes that cause xruns to happen, which is why I currently keep this script at a low default polyphony. These kinds of spikes occur due to various reasons. They have have in experimental tests been mitigated by @rick_monster ie. by changing linux cpu_governor to performance and lowering the priority for USB devices. These kinds of optimizations may end up in a future norns kernel, but it was too early to include them for norns 2.0.

hey, second day norns/grid owner. tried Moln but sadly it’s quiet as a mouse. i checked and r engine seems to be installed. any pointers?

log:

engine: an Engine_R

command entry: [ 0, new, ss ]

command entry: [ 1, delete, s ]

command entry: [ 2, connect, ss ]

command entry: [ 3, disconnect, ss ]

command entry: [ 4, set, sf ]

command entry: [ 5, bulkset, s ]

command entry: [ 6, newmacro, ss ]

command entry: [ 7, deletemacro, s ]

command entry: [ 8, macroset, sf ]

command entry: [ 9, polloutput, is ]

command entry: [ 10, pollvisual, is ]

command entry: [ 11, pollclear, i ]

command entry: [ 12, readsample, ss ]

command entry: [ 13, trace, i ]

cpu_peak

cpu_avg

amp_in_l

amp_in_r

amp_out_l

amp_out_r

pitch_in_l

pitch_in_r

poll1

poll2

poll3

poll4

poll5

poll6

poll7

poll8

poll9

poll10

ERROR: module input reference "SoundOut/Left" does not conform to module input syntax ([ModuleName]*[InputName])

ERROR: module input reference "SoundOut/Right" does not conform to module input syntax ([ModuleName]*[InputName])

ERROR: module input reference "SoundOut/Left" does not conform to module input syntax ([ModuleName]*[InputName])

ERROR: module input reference "SoundOut/Right" does not conform to module input syntax ([ModuleName]*[InputName])

ERROR: module input reference "SoundOut/Left" does not conform to module input syntax ([ModuleName]*[InputName])

ERROR: module input reference "SoundOut/Right" does not conform to module input syntax ([ModuleName]*[InputName])

Maybe try updating R?

it’s up to date according to Maiden, did you see my edit with the log?

sorry, totally new to this.

I did see, but i think i misunderstood! It looks like Moln needs to be updated for new R syntax. This is likely a very easy fix, I’ll take a look at the Moln code now.

edit: @vicimity, if you look at the sc REPL in maiden, it shows that the delimiter for inputs changed from / to *. I am about to PR a fix, but if you just want to use moln now, it’s a simple change.

change the connect_modules function in moln.lua to…

local function connect_modules()
  R.engine.poly_connect("FreqGate/Frequency", "OscA*FM", POLYPHONY)
  R.engine.poly_connect("FreqGate/Frequency", "OscB*FM", POLYPHONY)
  R.engine.poly_connect("FreqGate/Gate", "Env*Gate", POLYPHONY)
  R.engine.poly_connect("LFO/Out", "OscA*PWM", POLYPHONY)
  R.engine.poly_connect("LFO/Out", "OscB*PWM", POLYPHONY)
  R.engine.poly_connect("Env/Out", "Amp*Lin", POLYPHONY)
  R.engine.poly_connect("Env/Out", "Filter*FM", POLYPHONY)
  R.engine.poly_connect("OscA/Out", "Filter*In", POLYPHONY)
  R.engine.poly_connect("OscB/Out", "Filter*In", POLYPHONY)
  R.engine.poly_connect("Filter/Out", "Amp*In", POLYPHONY)

  for voicenum=1, POLYPHONY do
    engine.connect("Amp"..voicenum.."/Out", "SoundOut*Left")
    engine.connect("Amp"..voicenum.."/Out", "SoundOut*Right")
  end
end

And restart your norns :smiley:

2 Likes

thank you. helped me out of the comfort zone and into the learning zone.

Hi, sorry late response, did this resolve your issue?

I believe I made the / -> * fix backwards compatible so / would still work.

I’ll check it out and get back to you.
(I might’ve broken something else recently)

By the way - if this doesn’t work check out the new https://github.com/antonhornquist/roar script collection where a moln version with a UI update resides.

I havent published this here on lines yet since there is a bug sometimes affecting the other scripts in the collection. but the moln version in there should work well.

2 Likes

i did the replacement in the code manually and it seems to work just fine now.

Great!

Yeah, I apparently managed to break backwards compatibility in a recent large scale refactoring. I fixed that now in a new commit.

Anyhow, you might wanna look at the new roar version of moln - it has a bit refined UI (you can reach all params in script mode by paging back and forth).

1 Like

The version of Moln availible on Maiden is giving me this error when I try to change certain parameters:

lua: 
/home/we/norns/lua/core/params/control.lua:75: attempt to perform arithmetic on a nil value (field 'quantum')
stack traceback:
	/home/we/norns/lua/core/params/control.lua:75: in function 'core/params/control.delta'
	/home/we/norns/lua/core/paramset.lua:266: in function 'core/paramset.delta'
	/home/we/norns/lua/core/menu/params.lua:291: in function 'core/menu/params.enc'
	/home/we/norns/lua/core/menu.lua:112: in function 'core/encoders.callback'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders

I then tried using the code from Roar. A-RNG a B-RNG work along with E>FIL.

Otherwise, I get the same error:

/home/we/norns/lua/core/params/control.lua:75: attempt to perform arithmetic on a nil value (field 'quantum')
stack traceback:
	/home/we/norns/lua/core/params/control.lua:75: in function 'core/params/control.delta'
	/home/we/norns/lua/core/paramset.lua:266: in function 'core/paramset.delta'
	/home/we/dust/code/roar/lib/common.lua:345: in field 'enc'
	/home/we/dust/code/roar/moln.lua:194: in function 'core/encoders.callback'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encode

I’m running norns v200712.

Edit: version.

Hmm, thanks. I will check this out when I’m back near my norns (monday…)