Utility Modules Project


#1

Noodl Utility Modules

Content

Download

About the project

This project is intended to explore new modules and nodes for Noodl. There are a few things in Noodl that non-javascript-developers will find difficult. These difficult things are often to do with small snippets of javascript code. These modules are intended to bridge that gap, make it easier for designers to use Noodl without needing to learn code, and in the process make Noodl easier for beginners.

Report bugs, discuss and request other modules in the Noodl forum thread.

Change notes

Version 0.1.0

First release so it is very early and only contains a few modules. The String Utilities module, the Color Utilities Module and the Number Utilites Module are all well on their way. The Number Utilities Module still have some planned nodes to implement. A couple of other modules are also in development (Audio and Animations).

  • NEW Color Utilites Module: Hex To Rgb, Rgb To Hex, Hue Rotation
  • NEW Number Utilities Module: Absolute number, Limit number, Random number, Round number
  • NEW String Utilites Module: String Capitalization, String Length, String Pad, String Range, String Reverse, String Search, String Trim

Install instructions

Modules are placed in a folder called noodl_modules inside the project folder. After modules have been added or changed refresh the Noodl project to have the changes take place/the nodes being accessible.
Correct placement of modules in project

Documentation

Color Utilites Module

A module that do common color translations and manipulations.


Hex To Rgb

Takes a hex value (#000000) and outputs the red, green and blue as separate values (0-255)

Inputs
  • HEX color: The HEX color (from a Color node or as a string) that will be converted into RGB.
Outputs
  • Red: The red color value (0-255).
  • Green: The green color value (0-255).
  • Blue: The blue color value (0-255).

Rgb To Hex

Takes three different values (red, green and blue) and outputs the HEX color.

Inputs
  • Red: The red color value (0-255).
  • Green: The green color value (0-255).
  • Blue: The blue color value (0-255).
Outputs
  • Color: The HEX color (as a string).

Hue Rotation

Takes a HEX color value, converts it into HSL (hue, saturation, light) and rotate the hue with the number of degrees specified.

Inputs
  • Color: A HEX color value (from a Color node or as a string) that will be rotated.
  • Rotation: The number of degrees that the hue should be rotated.
Outputs
  • Color: The rotated color converted back into a HEX color (as a string).

Number Utilites Module

Get access to more methods for working with numbers. Some nodes are very easy to implement in an expression node while other nodes, like the Round number and the Random number nodes, are more complex.


Absolute number

Turns a number into its absoulte variant (always positive). A -23 will get the result 23.

Math.abs(Number);
Inputs
  • Number: The number that will be turned absolute.
Outputs
  • Result: The input number as an absolute number (always positive).

Limit number

A simple node for limiting a value.

function checkLimits(){
	result = number;
	if(number > upperLimit) result = upperLimit;
	if(number < lowerLimit) result = lowerLimit;
}
Inputs
  • Number: The number that will be limited.
  • Lower limit: The minimum value that will be output.
  • Upper limit: The maximum value that will be output.
Outputs
  • Result: The resulting limited number.

Random number

Generate a random integer between the lower and upper limits (inclusively). When the project is loaded a new random number is generated. It can be regenerated by triggering the Generate signal input.

function getRandomIntInclusive(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
Inputs
  • Generate: A signal input to generate a new random number.
  • Lower limit: The minimum value that will be generated.
  • Upper limit: The maximum value that will be generated.
Outputs
  • Random number: The generated random number.

Round number

Rounds a number down to the specified Decimals. If the number of decimals is set to a negative value the node will treat it as 0. The highest decimal value is locked to 10.

function getRoundedNumber(num,places) {
  return +(Math.round(num + "e+" + places)  + "e-" + places);
}
Inputs
  • Number: The number that will be rounded.
  • Decimals: Number of decimal places that will be outputed when rounding. Lowest value is 0, highest value is 10.
Outputs
  • Result: The rounded number.

String Utilites Module

A module that complements exisitng String manipulation nodes. It is intended to cover simple use cases where currently some knowledge about Javascript is needed.


String Capitalization

This node transforms text into four types of capitalization: all letters uppercase, all letters lower case, title case (first letter of every word is uppercase, the following letters are lowercase), and first case (first letter of a sentence is uppercase, the following letters are lowercase).

Inputs
  • Text: The text that will be capitalized.
  • Capitalize: Selector for the four types of capitalization. UPPERCASE, lowercase, Title Case, First case, (and none)
Outputs
  • Result: The resulting modified text.

String Length

This node returns the number of characters and the number of words in a string.

Inputs
  • Text: The text that will be counted.
Outputs
  • Character count: The number of characters in the string, space included.
  • Word count: The number of words in the string (using space to count the words).

String Pad

Adds specified text before and after the input string.

Inputs
  • Text: The text that will be padded.
  • Before: Text that will appear before the original string. Can be empty.
  • After: Text that will appear after the original string. Can be empty.
Outputs
  • Result: The modified string (Before+Text+After).

String Range

Search a string after a keyword and returns the character index where the keyword was first found, together with the last character index of the keyword.

Inputs
  • Text: The text that will be serched.
  • Find: The keyword that will be looked for.
  • Case sensitive: If case sensitivity should be taken into account (default is off).
Outputs
  • Start position: On what index value the keyword was first found. If the keyword was not found this value will be -1.
  • End position: On what index value the keyword ended. If the keyword was not found this value will be 0.

String Reverse

Takes a text input and outputs a reversed version. Implements the Esrever project by Mathias Bynens so it should be able to handle most common unicode scenarios, including ligatures and other special characters.

Inputs
  • Text: The text that will be reversed.
Outputs
  • Result: The reversed text.

String Search

Checks if a string contains a keyword, and how many times it appears.

Inputs
  • Text: The text that will be serched.
  • Find: The keyword that will be looked for.
  • Case sensitive: If case sensitivity should be taken into account (default is off).
Outputs
  • Match found: True or false.
  • Nr of matches: A number indicating how many times the keyword was found in the text. If the keyword was not found this value will be 0.

String Trim

Removes any whitespace that appears before and after the main text.

Inputs
  • Text: The text that will be trimmed.
Outputs
  • Result: The text with whitespace removed.

Planned modules

Modules and nodes that will hopefully be implemented. Sorted by some type of ranking based on value/relevance/most use-cases. However, the items on this list should not be seen as being in development. Feel free to leave suggestions in the projects forum thread.

Number Utilites

  • Random number - add option for specifying seed
  • Truncate number
  • Power of
  • Sine Wave - Start/Stop ocillating between 0-1

Data

  • Filter collection - filters a collection and outputs a new collection: add property, sort on/include/exclude/between value

Interactions

  • Advanced taps - Long press, double tap, tripple tap, tap and hold
  • Gamepad - Implementing the basic functions from the Gamepad API

Voice

  • Speech recognition - Using Bing api?
  • Text to speech - Using Bing Api?

Communication

  • Midi Send
  • Midi Recive

Audio

  • Sound - Play a sound file. Forward, reverse, speed (can speed be animated?)

Animations

  • Sprite animation - Take an image and set up multiple sprite sheet animations.
  • Animation group - Chain multiple animation nodes together and play them in sequence/parallel forward/back/forwardBack.

Application

  • Check platform
  • Launch URL
  • File Picker

Hardware (when Noodl shell app is released)

  • Battery status - Implementing the charging and procentage
  • Hardware buttons - Events from back & volume up/down

Effects

  • Replace pixel color - set up multiple colors that will be transformed into other colors (needs shader programming?)
  • Line rectangle - turns a rectangle into a non-solid rectangle with a specified thickness for the lines (masking out the middle portion)
  • Dropshadow - adds a shadow to the element (blurred rectangle in single color beneth the target element)

Licences

Esrever

Copyright Mathias Bynens https://mathiasbynens.be/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE


Open Sound Control (OSC)?