# Bitwise

## Bitwise

A probabilistic bitwise-logic-based sequencer for live play.

This app started as something quite different: I wanted to explore a sequencer that sequenced mutations instead of values, passing a simple single-byte bitwise sequence from one step to the next. I wound up stripping all the sequencing out and focusing on making a UI for working with bit-based sequences. I then added some simple probabilistic aspects to mitigate the repetitiveness of the 8-bit phrasing, and it started to show some nice sweet spots.

Just norns.

### Documentation

UI is split into two pages: GATES and NOTES

GATES for each step are generated by combining two bytes with the chosen bitwise operator.

NOTES for each step are calculated by constructing a 4 bit value out of the current bit for each of 4 bytes (by default one for each power of 2, configurable in params).

All controls can have randomness, set with K1+E2. By default, randomness uses the āstabilityā more - for any byte, the randomness level is the likelihood that bit will flip when it is the current one. No randomness means no change, half randomness means equal likelihood it will flip or not, full randomness actually means it will ALWAYS flip (so, not really randomā¦sorryā¦). You can also choose the legacy ātriggerā probability mode in params, in which randomness is the likelihood a ā1ā bit wonāt actually trigger when current. For the operator the probability chooses between the op and its logical inverse in both modes.

Randomness can be ālockedā (disabled) globally by rotating E1 clockwise while holding K1. Unlock by rotating counter-clockwise.

ALL PAGES

• k1: exit
• e1: select page
• [+ k1]: Lock random
• e2: select control
• [+ k1]: Set randomness

GATES PAGE controls

• OPERATOR:
• k2 [+ k1]: and [nand]
• k3 [+ k1]: or [xor]
• e3: l/r rotate both
• [+ k1]:[oposite directions]
• GATE BYTE:
• k3 [+ k1]: not [reflect TODO]
• e3: l/r rotate
• [+ k1]: l/r shift
• [+ k2]: +/- value
• [+ k1 k2]: +/- upper nibble

NOTES PAGE controls

• Each BIT SEQUENCE BYTE
• k2 [+ k1]: not [momentary]
• k3 [ + k1]: reflect [momentary]
• e3: l/r rotate
• [+ k1]: l/r shift
• [+ k2]: +/- value
• [+ k1 k2]: +/- upper nibble

from maiden type
`;install https://github.com/eethann/bitwise`

### Demos / Examples

Full demo to come, but hereās a quick video of some (recent) features:

• Confirm the note names displayed are accurate
47 Likes

First of all, happy birthday! Thank you very much for sharing this beautiful script us.

A really interesting and different approach to the idea of 8-bit music; preserving a chiptune rule but with another perspective.

Great! Canāt wait to try iit.

3 Likes

Happy Birthday! Great idea

2 Likes

Happy Birthday! Will try it later

2 Likes

Thanks for the kind birthday wishes! I just pushed an update to the script that cleans the code up a little, adds a few parameters, and changes the default way probability works. The default is now an ASR-like probability: the likelihood a given bit is to flip when itās encountered. The UI may be a little counterintuitive at first - it shows the ārandomnessā of any given byte (shown as a low alpha āwater levelā to use @SPIKEās term).

By default, randomness is 0, and you increase randomness to make it more likely that bits will flip in that byte as the clock ticks. At 50% you basically have total chance, greater than 50% bits tend toward flipping (100% they will always invert). At 0 the byte is in essence ālockedā.

Iāll update the docs and try to get to a first tutorial sometime in the near future (may be about a week or soā¦workā¦)

Ps. also added a div parameter to increase or decrease pulse divisions relative to the clock.

5 Likes

really cool concept! looking forward to play around with it.

I love the sound of this. I look forward to giving it a go. Well done

@SpectralClockworks

very cool looking script!

took me a few mins to understand the randomness control.
soā¦each row on each page can have a kinda āwater levelā of randomness by holding K1 and turning K2.
very cool!

i might have found a

under Parameters/Notes
if you change the base note it jumps to 0 and 127 unless you hold K3.
alsoā¦it just stops making noiz at that point.
andā¦i just discovered the main screen of the script just goes blank.
i was able to recover just by clearing the script so it wasnāt a hard crash.

here is what maiden displayed:

Summary

lua:

/home/we/norns/lua/core/clock.lua:65: /home/we/norns/lua/lib/musicutil.lua:565: attempt to perform arithmetic on a nil value (local ānote_numā)

stack traceback:

[C]: in function āerrorā

/home/we/norns/lua/core/clock.lua:65: in function ācore/clock.resumeā

a few requests.

• can you have the Base Note display as a MIDI Note?
(as in C1 or A#2 or the like)

• can we get MIDI Start / Stop?

• is there any plan to add MIDI out?

1 Like

Thanks for the detailed feedback, @SPIKE ! Iām actually planning to work on MIDI next, so will check out that bug asap, work on adding midi note display, and midi out right away. Start/stop might take a little longer but are definitely also on my to-do list.

Follow-up:
• the base note param now shows note name and octave BUT the octave appears off (note num `24` is shown as C0)