The document provides instructions for using the Logic Blox Music Synthesizer asset package to create virtual synthesizers in Unity. It includes descriptions of the included prefabs, scripts, audio files and how to connect the components to build a functioning synthesizer. The package contains all the necessary parts to construct synthesizers from basic tones and controls for filters, effects and modulation. Users can combine the prefabs in various ways or customize the components further.
2. Table of Contents
Introduction..........................................................................................................................................3
Music synthesizer series..................................................................................................................3
Music Synthesizer component prefabs.....................................................................................4
Logic Blox Music Synthesizer Circuit Classes:.........................................................................4
Synthesizer control model overview:.........................................................................................5
Sound source and sound controls..............................................................................................5
Basic Tones (virtual oscillators).....................................................................................................6
Music Synthesizer attached scripts.............................................................................................7
Connecting volume control to keyboard octave modules:..............................................7
Master mesh models:.......................................................................................................................8
Music synthesizer main prefabs:..................................................................................................9
Steps to build synthesizer...............................................................................................................9
Audio files...........................................................................................................................................11
Audio filters........................................................................................................................................12
Low Frequency Oscillators (LFO's)............................................................................................15
Device configuration details.......................................................................................................16
Sub Function command Reference..........................................................................................19
Inspector Settings............................................................................................................................22
UniLogicChip.cs................................................................................................................................22
UniTone.cs..........................................................................................................................................23
Switch Movement Parameters...................................................................................................23
MIDI keyboards................................................................................................................................24
LB Synth demo model switch layout.......................................................................................25
Page 2
3. Introduction
Granby Games logic prop prefabs (Logic Blox) can be used to create, debug and design
simple to complex functioning virtual electronic circuits and props. Examples include::
electrical components, control panels, game play controls, vintage computers and musical
instruments. Logic Blox props are placed in game and can be connected together in order to
run other logic props, sounds, animations and game objects. Pre-attached scripts manage
behavioral logic, audio filters, animations and connections to other props and MIDI surfaces.
Script modifications and or programming is not required to build functioning creations with
Logic Blox.
Music synthesizer series
Music Synthesizer series includes customized switches, dials and controls modeled from
1960's to early 2000 electronic synthesizers. Switches and controls are fully animated with
options for dial faces and color combinations.
Prefabricated internal functions are used to manipulate Unity's native audio source engine
and built in audio filters. Users can combine any combination of controls, filters, keyboards
and sounds to create custom virtual synthesizers which can be played from keyboard, mouse
and MIDI surface (Piano keys).
Musical tones are derived from 48khz wave file clips and include primary waves such as sine,
square, triangle, percussion and pluck. Octave notes are based on the Mean chromatographic
scale and have been pre-arranged in (5 octave x 5 sound waves) keyboard surface prefabs.
Contained in this user guide are detailed descriptions, examples and operational setting for
using Synth Logic Blox components and prebuilt synthesizer modules.. Other Logic Blox
packages including Vintage Mainframe series can be downloaded from the Unity asset store
and incorporated with LB Synth components. Note: LB Music Synthesizer asset package also
includes Logic Blox primitives series and core logic engine.
Page 3
4. Music Synthesizer component prefabs
Music synthesizer prefabs contain meshes, materials and Logic Blox Script(s) pre-setup for
each component type. Simply place props in game scene and use inspector to establish
connections to Octave props and or other Logic Blox. Clicking on buttons, click surfaces and
pins changes prop logic states which in turn drives logic flow to other connected props.
Prefabs have optional edit/runtime changeable settings for button colors, led emissions, click
sounds, animations and game object control. Note: Refer to Logic Blox Primitives User Guide
for details. (assets/LogicBlox/Prefabs/primitives/documents Documents folder).
Music synthesizer circuit components are setup with classes that represent common pin
configurations. Component connections pin outs are compatible with all Logic Blox series
props.
Logic Blox Music Synthesizer Circuit Classes:
1. Gate - One input, one output. Includes: Switches, lamps and standard gates
2. TriSwitch - Three inputs, three outputs. Includes: Piano foot pedal and 3 way switches
3. Axis - Two inputs, two outputs. Includes: Up down, slider and dial controls
4. Keyboard– 12 inputs, four outputs. Includes: Octave keyboard surface module
Page 4
5. Synthesizer control model overview:
Logic Blox synthesizer package comes with pre-assembled components designed to control
audio aspects of Unity's native sound engine. Provided demo scene includes a synthesizer
model that can be inspected, copied and or modified. In addition to live demo model.
Separate, component prefabs can be used to design custom synthesizers, rhythm generators,
games sounds or other virtual reality sound control systems. Note: Demo model is not tied to
packaged prefabs. For new designs, it is recommended use component master prefabs and
variations found in assetslogicBloxprefabssynth.
Sound source and sound controls
Keyboard scale starts at C2 (octave2) and ends at B5 (octave5). Original note WAV sound files
are stored in audio directory and are tuned to the mean chronograph scale. It is not
recommended to modify note files unless entire octave scale (49 notes per tone) is being
added or changed out.
Tones can be played by click game keyboard with mouse or pressing assigned computer
keyboard key (top two rows of keyboard) or pressing MIDI surface from connected MIDI
device or from other logic props.
Page 5
6. Basic Tones (virtual oscillators)
There are currently 5 sound types to choose from including sine, square, saw, percussion and
pluck. When a key is pressed the corresponding note for selected tone is played. Sound
types, filters, low frequency oscillators(Lfo's) and sound envelopes are controlled by dial,
switches and button props. Tone selection is made by sending value 0-9 (sendVal) to
keyboard octave object from SETOSC function switch.
Sine wave Square wave
Saw wave Pluck
Percussion
In addition to the 5 primary sound types. User sound files such as drum kit sounds, riffs and
sound FX have been added. Details for adding user custom sounds are described in later
section.
Page 6
7. Music Synthesizer attached scripts
Music Synthesizer prefab components have several scripts attached for managing logic,
effects and connections. Prefabs located in the AssetsLogic BloxPrefabsSynth folder are
open ended. This means they are operational but have no connection end points established.
The Unity inspector is used to place props in game. Inspector fields are used to define
command types and connections between controls and keyboards.
Connecting volume control to keyboard octave modules:
Page 7
8. Master mesh models:
Standardized component object models include individual meshes for key parts including
body, pins and buttons. Knob style variations are included with some models and are used to
alter button styles, button colors and size/shape.
Note: Component meshes do not require modification unless model is being redesigned.
Refer to models prefab inspector for customizable settings.
Page 8
9. Music synthesizer main prefabs:
Synthesizer control prefabs contain pre-setup scripts and are ready for in game synthesizer
building. Controls include audio filter switches, dials, selectors and sliders, sustain/decay foot
pedal, tone pitch wheel, illuminated push buttons, rocker switches and keyboard octave
surfaces.
Primary synthesizer builders prefabs
Steps to build synthesizer
1. Place Octave prefabs in scene and position into full keyboard surface.
2. Place desired filter/controls in scene. Define the control's SubFunction and set
OutPutLinkObj's to associated keyboard octave props.
Component prefabs follow a standard hierarchy and reuse materials and meshes to create
prefab variations.
Page 9
10. Example Switch prefab hierarchy:
Prefabs have been setup to account for size and orientation changes. In some cases minor
tweaking may be required. Note: Changing master prefab will change all variants. If a unique
configuration is require it its suggested to create a new master prefab to work from.
Page 10
11. Audio files
Music note audio tone files are used by keyboard prefab located in:
Assets/LogicBlox/Audio/SynthTones/KeyboardNotes
(Partial List)
Tone files are pre arranged to produce a 5 octave chronographic scale for each of the 5 tone
types. Custom user tone files can be used by replacing some or all user tone files in the user
tones folder Assets/LogicBlox/Audio/SythTones/Usr1-3. See later section for details on
setting up custom tone files
Note: Deleting a file and replacing with new file of same name will retain links to keyboard
sections.
Page 11
12. Audio filters
Each tone has attached audio sources and filters. Audio filter settings can be adjusted using
Logic Blox switches, sliders, dials and controls to alter filters for individual keys, octave
sections or entire keyboard. Changing filter values can produce interesting results and is the
key to synthesizing complex sounds derived from primitive sound files.
Filter settings increase by set interval for each SubFunction command sent from controls. For
example. Echo filter values range from 0- 5000. For this filter. control is preset to increment
25 steps for each movement step of the Echo control. Entering a value in Switch/sliders
SendVal field will overrides preset.
Page 12
14. Filter name Source Description
Audio Source Unity Audio source
- Controls volume (0-1) and pitch (0-3) for each tone
- 3D sounds turned off
SubFunction: (commands from props)
- VOL
FuncParameter:
- LEVEL
- LFOSET
-LFORATE
-LFODEPTH
- RESET
SubFunction:
- PITCH
FuncParameter:
- LEVEL
- LFOSET
- LFORATE
- LFODEPTH
- RESET
AudioChorusFilter Unity Chorus rate (0-20) and depth effect (0-1)
Value increases/decreases by set amount on each command
SendVal = predefined. Can be overridden
SubFunction: (commands from props)
-CHORUS
FuncParameter:
- RATE
- DEPTH
- SET
-RESET
AudioDistortionFilter Unity Distortion effect level (0-1)
SendVal = predefined. Can be overridden
SubFunction: (commands from props)
-DISTORT
FuncParameter:
- LEVEL
- RESET
- SET
Page 14
15. Filter name Source Description
AudioEchoFilter Unity Echo delay effect (0-5000)
SendVal = predefined. Can be overridden
SubFunction: (commands from props)
-ECHO
FuncParameter:
- DELAY
- SET
- RESET
AudioLowPassFilter Unity Clamps high frequencies(0-22,000) and resonance (0-10)
SendVal = predefined. Can be overridden
SubFunction: (commands from props)
-LOWFILTER
FuncParameter:
- CUT
- RES
- SETLFO
- LFOCUT
- LFODEPTH
- SET
-RESET
AudioHighPassFilter Unity Clamps Low frequencies(0-22,000) and resonance (0-10)
SubFunction: (commands from props)
-HIGHFILTER
SendVal = predefined. Can be overridden
FuncParameter:
- CUT
- RES
- SET
- RESET
AudioReverbFilter Unity Add reverb using one of 27 presets:
(Generic, Padded Cell, Room, Bathroom, Livingroom, Stoneroom,
Auditorium, Concerthall, Cave, Arena, Hangar, Carpeted Hallway,
Hallway, Stone Corridor, Alley, Forest, City, Mountains, Wquarry, Plain,
Parkinglot, Sewerpipe, Underwater, Drugged, Psychotic, User)
SendVal = selected preset
SubFunction: (commands from props)
- REVERB
FuncParameter:
- PRESET
- SET
- DISABLE
Page 15
16. Filter name Source Description
Decay sound Custom Decays sound after key press (.002-500)
SendVal = predefined. Can be overridden
SubFunction: (commands from props)
- DECAY
FuncParameter:
- LENGTH
- SET
Sustain sdound Custom Sustains key press sounds ( (0-12)
SendVal = predefined. Can be overridden
SubFunction: (commands from props)
- SUSTAIN
FuncParameter:
- RATE
- SET
Dampen Sound Custom End ringing sounds
SubFunction: (commands from props)
- DAMPEN
Select WAV sample Custom Select wave file(0-9)
SendVal = 0 to 9
SubFunction: (commands from props)
- SETOSC
Arpeggio Custom Repeats keyed notes at selected rate
SubFunction: (commands from props)
- ARP
FuncParameter:
- RATE
- PAUSE
- SETCORD
- SET
- RESET
Page 16
17. Filter name Source Description
Run light show Custom Control attached light show bar
SubFunction: (commands from props)
- LIGHTSHOW
FuncParameter:
- SETSCAN
- DECAY
- FADE
- AREA
- RMS
Low Frequency Oscillators (LFO's)
Low frequency oscillators are timers that can control oscillation of filter values such as Low
frequency cut offs and pitch. Effects can produce tremolo effect and can be used to achieve
natural acoustics.
Current filters include:
Filter name Source Description
Pitch Shifter Custom
Unitones.cs
Oscillates pitch between set parameters
Low Frequency Shifter Custom
Unitones.cs
Chorus rate (0-20) and depth effect (0-1)
Volume Shifter Custom
Unitones.ca
Distortion effect level (0-1)
Page 17
18. Device configuration details
Class: gate Type: switch
Pin0 – Toggle on/off
Pin1 – Switch state
But0 – Toggle on/off
Pin0 – Toggle on/off
Pin1 – Switch state
But0 – Toggle on/off
AnimType=rocker
RotType=2
SwitchSteps=10
AnimType=rocker
RotType=2
SwitchSteps=10
Class: axis Type: dial
But0 – Turn right (increase value)
But1 – Turn left (decrease value)
Pin0 – Turn right (increase value)
Pin1 – Turn left (decrease value)
Pin2 – Increase state
Pin3 – Decrease state
But0 – Turn right (increase value)
But1 – Turn left (decrease value)
Pin0 – Turn right (increase value)
Pin1 – Turn left (decrease value)
Pin2 – Increase state
Pin3 – Decrease state
sendVal=selCurPos
switchSteps=10 (default can be changed)
upperMargin= rotation stop position
sendVal=selCurPos
switchSteps=10 (default can be changed)
upperMargin= rotation stop position
animType=rotate
rotType=0
animType=rotate
rotType=0
Page 18
20. Axis (Slider) Gate (Switch) Gate (Switch)
But0 – Slide up (increase value)
But1 – Slide down (decrease value)
Pin0 – Slide Up (increase value)
Pin1 – Slide Down (decrease value)
Pin2 – Increase state
Pin3 – Decrease state
Pin0 – Toggle on/off
Pin1 – Switch state
But0 – Toggle on/off
Pin0 – Toggle on/off
Pin1 – Switch state
But0 – Toggle on/off
sendVal=selCurPos
switchSteps= calculated position
(default can be changed)
upperMargin= upper stop position
AnimType=rocker2
RotType=2
SwitchSteps=4
Supports isUnique
Each switch must have separate sendVal
and belong to same circuitGroup
Uses button label sprites
AnimType=slide
RotType=3
SwitchSteps=.1
SelMaxPos=50
SeUpperMargin=9
AnimType=push
RotType=1
SwitchSteps=calculated
Page 20
21. Class: axis, Type: dial (pitchwheel)
But0 – Pitchup (increase value)
But1 – Pitchdown (decrease value)
Pin0 – Wheel fwd (increase value)
Pin1 – Wheel back (decrease value)
Pin2 – Forward state
Pin3 – Reverse state
sendVal=selCurPos
switchSteps= calculated position (default can be
changed)
upperMargin= upper stop position
Anim Type=rotate
RotType=2
SwitchSteps=5
DefualtPos=9
SelUpperMargin=45
Switch and Panel Labels
Labels for dials, buttons and sliders include dial tick marks, button and panel labels. Label
sprites are preloaded in various prefab variants and can be selected by enabling and disabling
object from the components hierarchy. Label sprites are located in:
/Assets/LogicBlox/images/PanelLabels
Page 21
22. Sub Function command Reference
Sub commands are special commands that can be sent to keyboard octave modules in order
to manipulate settings for audio filters, key lights etc. All gameObjects with UniTone.cs script
attached will respond to the following sub function commands. Individual keys, octaves and
or multiple octaves can be selected.
Name Function TickVal Min Max
PITCH
- KEY
- RESET
Change tone pitch for of selected Octave module:
SendVal=amount to change
OutputLinkObj=octave module(s)
OutputLinkPin=0
.1 0 3
ECHO
- RATE
- DELAY (30)
- RESET
- SET
Control Echo filter for selected octaves
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
30 0 1000
DISTORT
- LEVEL
- RESET
- SET
Control Distortion filter for selected octaves
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
.03 0 1
CHORUS
- RATE
- DEPTH
- RESET
- SET
Control Chorus for selected octaves:
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
.1
.1
na 20
1
DECAY
- LENGTH
- RESET
- SET
Control decay timers for selected keys and octaves:
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
.04 .002 500
SUSTAIN
- LENGTH
- RESET
- SET
Control sustain timers for selected keys and octaves:
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
1 na 12
DAMPEN Dampen audio on selected octaves:
SendVal=na
OutputLinkObj=octave module(s)
OutputLinkPin=0
na na na
Page 22
23. Name Function TickVal Min Max
VOL
- RESET
Change volume level for selected octaves:
SendVal=amount to change
OutputLinkObj=octave module(s)
OutputLinkPin=0
.1 0 1
SETOSC Select tone type for selected octaves and keys:
SendVal=tone number {if from switch)
SelCurPos=tone number (if from dial)
OutputLinkObj=octave module(s)
OutputLinkPin=0
Tone types: sin, sq, saw, pluck, perc, kit, usr1, usr2,
usr3
na 0 9
REVERB
- PRESET
- SET
- DISABLE
Select reverb preset for selected octaves:
SendVal=reverb number from SendVal
OutputLinkObj=octave module(s)
OutputLinkPin=0
0 na 27
LOWFILTER
- CUT
- RES
- CUTKEY
- RESKEY
- RESET
- SET
- SETLFO
- LFOCUT
- LFORES
Control Low Pass filter for selected octaves and keys:
SendVal=amount to change
OutputLinkObj=octave module(s)
OutputLinkPin=0
20
.05
1001 8000
10
HIGHFILTER
- CUT
- RES
- CUTKEY
- RESKEY
- RESET
- SET
- SETLFO
- LFOCUT
- LFORES
Control High Pass filter for selected octaves and
keys:
SendVal=amount to change
OutputLinkObj=octave module(s)
OutputLinkPin=0
20
.05
100
1
3000
10
Page 23
24. Name Function TickVal Min Max
SETMIDI Enable/disable MIDI input for selected octaves:
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
na na na
SETKEYLIGHTS Enable/disable illuminated keys for selected octaves:
SendVal=n/a
OutputLinkObj=octave module(s)
OutputLinkPin=0
na na na
ARP
-SET
-RATE
-RESET
Enable/disable keyboard arpeggio.
- Stores 12 key presses per octave
- 13 key resets octaves notes and starts over
na na na
Inspector Settings
Prefabs are presetup with default settings in order to assemble functioning synthesizers. In
some cases modifications may be desired. Note: All changes are made from Unity's inspector.
Script file code changes are not required
UniLogicChip.cs
(Main logic engine attached to all Logic Blox prefabs)
Chip Parameters
SendVal – Sets value used for incremental changes sent from component. Higher number causes
quicker change. Lower number equals higher precision.
Page 24
25. DefaultState – Props default output state when scene is loaded
CircuitGroup – Used to define switch groups for global commands and option button controls.
Links
OutputLinkObj – GameObject(s) to receive commands. In lost cases this will be one or more of the
Octave keyboard modules
OutputLinkPin – GameObject(s) pin receiving command. In most cases this will be 0 which is the
default input for all Logic Blox.
Button/Led Settings
IsButtonHold – Set to true to cause switch to repeat when mouse button is held down.
SwitchSteps – Changes switch movement speed. Value is auto calculated if field is left at 0. Entering a
value will override defualt.
IsUnique – Enables option button style switch selection.(one switch at a time). CircuitGroup field must
be the same for all switches in the option group and the SendVal must be unique.
DefaultPos – Switch will move to this position when scene loads.
SelMaxPosition – Set value based on component type. Can be changed to alter maximum number of
increments.
SelUpperMargin – Set value to determine stop point if different than calculated default. Used to limit
selector switches and dials max position.
UniTone.cs
(Main synthesizer engine attached to keyboard octave modules)
Octave – Octave value from 1 to 5. Determines which octave the keyboard module is set to play.
Notes are determined by assigned note files, Just changing the octave number will not play tones from
different octave modules.
SelectedWave – Number from 0 to 9 selects predefined sound type. This value is changed from
controls with the SETOSC SubFunction.
IsMidi – Enables external MIDI keyboard. When set to false both mouse and top keyboard rows will
Page 25
26. play keys. Can be set with SETMIDI SubFunction.
Vol – Default volume. Default=.5
Switch Movement Parameters
In most cases switch controls and animations will self adjust when size or shape is altered.
Sliders may not animate correctly if place at non right angles.
If a switch overshoots its base the UniLogicChop SelUpperMargin value can be
adjusted
Enter values for DefaultPos and SelUpperMargin if it is desired for dials to start and
stop at specific potions.
Note: Settings can be changed from UniLogicChip.cs inspector
MIDI keyboards
Standard MIDI devices can be plugged into computers USB port or MIDI card and used to
control games keyboard octave modules and basic controls such as the sustain foot pedal.
MIDI driver only supports one MIDI device at a time. Details regarding MIDI driver can be
found at keijiro's MidiJack GithHub.
If multiple synth models are placed in scene the MIDI device may need resetting before it is
detected.
If MIDI switch is turned on for multiple models all keys will play when a MIDI key is pressed.
Page 26
27. LB Synth demo model switch layout
Note: Switch position details are subject to change.
Page 27