Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Perform bitwise AND operation.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Math | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
value1 | The first number. | 5 |
value2... | The second number. | 6 |
Returns number.
Applies bitwise and for three numbers which gives 16:
MBS("Math.BitwiseAND"; 255; 48; 18)
Split MIDI Timestamp:
# last five bits are frame counter
Set Variable [$Frame; MBS("Math.BitwiseAND"; TimeStamp; 31)]
# Seconds are in 2nd byte, so take 6 bits after shifting 8 to right
Set Variable [$Second; MBS( "Math.BitwiseAND"; MBS( "Math.BitwiseShiftRight"; TimeStamp; 8 ); 63)
# Minutes are in 3rd byte, so take 6 bits after shifting 16 to right
Set Variable [$Minute; MBS( "Math.BitwiseAND"; MBS( "Math.BitwiseShiftRight"; TimeStamp; 16 ); 63)
# Hours are in 4th byte: take 5 bits after shifting 24 to right
Set Variable [$Hour; MBS( "Math.BitwiseAND"; MBS( "Math.BitwiseShiftRight"; TimeStamp; 24 ); 31)
This function is free to use.
Created 18th August 2014, last changed 20th February 2023