KMachineV2LogoOnBlack

K Machine v2.7 - Documentation

Current Version: 2.74

A updated version of this document may be available here: http://www.kolargon.art

Last changed 10/01/2018:
- Minor error fixes
- Updated details in section 'Annex IV - AudioBus support'. New subsection 'B) AB remote support'
- Added section 'Annex VIII - Performance optimization tips'
- Added section 'Annex IX - Video capture'


Overview


The K Machine is a generative audiovisual sampler/sequencer, allowing the creation of visual audio animation based on visual shaders and audio samples, and designed for musicians, shaders enthousiasts, VJs, and animations lovers.
Each animation can be read sequentially (from start to end) or can be used in live style as an audiovisual instrument.
An animation is made of a sequence of audiovisual loops.
Each Loop has its own sequence of visual and audio events organised in tracks.
In KMachine v2, 4 tracks are available:
1 visual track
1 main audio track
3 samples tracks ( referred as sample track 0, sample track 1 and sample track 2)

Each of these tracks possesses its own list of parameter controllers.
You can modify the values of these parameters live (through the controllers), edit their temporal variation (through the sequencer), configure randomization of their values (triggered by a double tap on the loop), or associate the evolution of their values with the movements of your fingers on the screen.
Most of the controllers can be either mapped to your touch on the screen, or configured with a generative function which is triggered by double tapping on a Loop.



Table of Contents


System Requirements

K Machine works best on newer iOS devices with 450 MHz GPU.

K Machine can function on older devices with limitations:
- The size of the particles data will be automatically resized.
- On Devices not running openGL ES 3. or higher, smooth shader transition are not activated
- Sound may experience some audio glitch if too much effects/players are simultaneously activated.


Medium and High Performance Devices:

These devices utilize all the functions and animations.

iPhone 5S and later
iPad Pro
iPad Air 2 and later
iPad Mini 4 and later
iPod Touch 6 and later


Low Performance Devices:

These devices have some of the animation and sound output capabities limited due to their lack of openGL ES 3 support.
Note: check section Annex VIII - Performance optimization tips for tips on how to best optimize performance on older devices.

iPhone 5
iPhone 5c
iPad 4
iPad Air
iPad Mini 2
iPad Mini 3


Very Low Performance Devices:

The K Machine won't work for the following devices:

iPhone 4s and earlier
iPad 3 and earlier
iPad Mini
iPod Touch 5 and earlier
If your device launches in either Medium or Low Performance Mode, you will see that information on the screen when the application starts.



I) The Animation Panel


Loop selection
the Animation panel


The animation panel is the central panel and the one you see on the application startup. It allows the selection of the active loop and the edition of the loops list.

Each animation is made of basic audio-visual loops.
Number of loop is unlimited, but, as the screen space is limited, having too much Loops in a project may not be very practical.

A) Loop selection and representation


The selected loop appears on the animation panel in a different color than the other Loops.
You can configure the transparency level of the selected loop, the loops border's width and alpha values through the 'User Preferences Panel'.
There is always one and only one selected Loop at a given time.

Loops are organized in a clockwise circle, first loop always starting at 3 o'clock, as shown in the diagram below.

scene selection >> scene selection >> scene selection >> scene selection >> scene selection
1 Loop 2 Loops 3 Loops 4 Loops 5 Loops


B) Animation panel layout


Top menu bar:


1) Loop edition panel:
Scene Edition panel

Create a LoopClone the selected loop, paste it at the end of the animation and select it.
This is a usefull tool for quick progression in animation creation.
Delete LoopDelete the selected loop.
select the previous loop, or the first loop of the animation if selected loop was the first loop.
Copy LoopCopy the selected loop to clipboard
Paste copied loopInsert loop from clipboard.
The new loop is inserted after the currently selected loop, and become selected.


2) Play/Record panel:
Play record panel

Start playing/Start playing Start/Stop playing the animation sequentially (clockwise order, looped)
Not recording no record Not recording/ No record ready
Recording Currently recording
Record readyA record is ready to play
Video ready Ready for video recording
Video is recordingCurrently recording a video
Stop animation/Stop animationStart/Stop playing the animation
Mute audio/Mute audioMute/Unmute audio


3) Action mode button:
Action mode not writing

Selected 'Action mode' determines if your actions on the parameter controllers are recorded in the animation or not.
It is important to understand that, by default (state Recording change as first event), when modifying the value of a event controller (see section II - The controllers panel), a default event is automatically created as the first event of the loop. When selecting this loop, this event is automatically fired (along with all the event preceding the actual relative position on the loop).
On the other hand, when Action mode not writing is selected, your action on the controller wont be recorded.
For each controller ( Notes or Control change), you can have a clear representation of the event recorded in the animation, through the sequencer panel (see section III - The event sequencer panel ).

In summary, the two available action modes are the followings:

Action mode not writing Changes on the parameter controller aren't' recorded in the current loop.
Recording change as first eventChanges on the parameter controller are recorded as first events of the current loop (Hence, they will fired as soon as the loop is selected).


Note that in K Machine v2, no 'direct' record mode is available. Use the sequencer for more complex parameters patterns in the loop.

4) Activity monitor bar


Copy all events
The activity monitor panel


Sequencer screen


1) Note sequencer


Firgure below shows the Note sequencer opened for an audio samples track.

eventsequencer panel
the Sequencer panel for a Note Event controller


Right menu bar: Track selection


Visual Track Opens Controllers panel for the Visual track
Samples tracksOpens Controllers panel for the Audio samples tracks


Bottom right main menu:
Visual Track

The main navigation menu is located on the bottom right of the screen.
Click on the OpenMainMenu button to deploy.

Project manager
Project manager
Information manager Informations manager
Screen shot manager Screenshot manager
Preference manager Preferences manager


II) The Controllers panel

1) Overview


Each track has its own controllers panel.
It displays the list of parameters available for the considered Track.

In K Machine v2, four tracks are available: one visual track, and 3 audio tracks.

You can open the parameters panel for a track, by clicking on the corresponding track selection button

parameters controller pnelOpens Visual track controllers panel
parameters controller pnelOpens Main AUdio controllers panel
parameters controller pnelOpens Samples track 0 to 3 controllers panel


For each track the parameters panel displays the list of parameters available for this track.
These parameters can be animation parameters, or loop parameters.
Each list of controllers is specific to the type of track.
For example, the visual track possesses 10 controllers:
- the first controller controls the time sequence of visual shaders ( analog of midi Notes events)
- Second parameter is for background, and is always present.
- 8 parameters of float type which control various parameters of the visual shaders and are optional.
Depending of the glsl code used for the shader, zero up to height parameters can be exposed by the shader (see section Annex III - B) Creating advanced shader).

2) Visual Track controllers


In K Machine v2, each Visual Shader can possess up to 8 parameters in addition to the Note parameter.
The 'Visual sequencer' allows modification of note events (midi analog), that is to say, which and at what time a visual shader appears.
The other controllers allow access to the various parameters of a visual shader.

parameters controller panel main audio track

Visual shader controllers panel always shows 8 control change controllers, but not all may be used by the shader, depending on the shader code.
As shown in the figure below, when a parameter is exposed by the shader, its borders are green, whereas they are red when not used.
Changing the value of a controller which is not used won't have any effect on the shader.
Hence, the best practice when creating your own shader files, is to not declare any parameter that you do not really use in the shader code.( see section Annex III - Visual shader files format and creation for more details about shader creation).
Figure below shows the controllers panel for the visual track

parameters controller panel main audio track
the Controllers panel opened for the visual Track


3) Main audio controllers


In K Machine V2., Main audio track exposes 16 controllers:

Figure below show the controllers panel opened for the main audio track:

parameters controller panel main audio track
the Controllers panel opened for main Audio Track


4) Samples Tracks controllers



Figure below show the controllers panel opened for one of the 3 Audio Samples Tracks:

parameters controller panel audio track 2
the Controllers panel opened for Audio Trak 2


- Notes events controller
parameters controller pnel

- Other events controller
parameters controller pnel

5) Configuring touch mapping and Randomization



Configure randomization for a controller:
parameters controller pnel

Each controller with a dice button can have the randomization activated/unactivated by clicking on the dice button.

randomization activated samples track controller randomization off
randomization inactivated samples track controller randomization off

Once randomization is activated for a loop, you can trigger a randomization by double tapping on the loop in the animation panel.

When a randomization is triggered, it only applies to the selected loop.

Touch mapping and randomization are exclusive.
Activating randomization on a controller where touch mapping is configured automatically suppresses the touch mapping configuration.

In K Machine V2, randomization occurs as follow:
For 'Note parameters' (button Visual sequencer, Track0 sequencer, Track1 sequencer and Track 2 sequencer): for each event in the loop, a new player index is chosen at random between all the player used in this loop.
For 'Control change' parameters: for each event, a new value is choosen at random between all the possible values.


Configure touch Mapping for a controller:
parameters controller pnel

Each controller with a 'touch mapping' button can be configured to change according to the coordinates of your fingers on the screen (up to 3 simultaneous fingers).

To configure a touch mapping:

samples track controller randomization off

For example, in the above panel, horizontal movement of the first finger that touch the screen, will change the parameter's value.
In X (horizontal mapping), top left position on the screen corresponds to minimum value and top right to maximum value of the parameter.
In Y (vertical mapping), bottom position on the screen corresponds to minimum value and top position on the screen corresponds to maximum value.

Each mapping is specific to the loop on wich it as been configured.
The mapping is automatically activated when entering the loop.

No touch mapping configured samples track controller randomization off
Touch mapping activated samples track controller randomization off


III) The event sequencer panel

A)Overview


The sequencer panel of a parameter can be accessed by clicking on the edit parameter’s button of the corresponding parameter from the controller’s panel.
You can close the sequencer panel by clicking the top left 'Escape sequencer' button escape Sequencer

When opening the sequencer, any playback (action record playback or classic sequential playback) are automatically stopped.

B)Event Sequencer layout


1) The event sequencer toolBar


Copy all events Copy all events from the opened parameter to the clipboard
Copy all eventsPaste all events from the clipboard to the opened parameter
Event eraserEvents eraser tool
Activate split events modeEvents splitter mode
Loop selection toolLoop selection tool
Randomization toolEvent randomization tool
Select sceneSelect active Loop


Editing notes events:

eventsequencer panel



2) Control Change sequencer


Figure below shows the sequencer panel opened for a Control change event:

eventsequencer panel
the Sequencer panel for a Control Change controller

Editing Control Change events:

eventsequencer panel



3) Using the loop selection tool


The loop selection tool, allows to work on a specific region in a loop.
When the loop selection tool is activated, only the selected region of the loop is played and any edition action (copy, paste, erase, randomize) is only applied to the events inside the selected loop.

To activate/deactivate the selection tool, click on the Loop selection tool button.
Once selection is activated, use the two handles to select the region you want to loop on.

loop selection tool

IV) The Ressource Manager panel

A) Overview


The Ressource Manager allows the upload and selection of files in the K Machine.

These files can be:
- Audio samples ( 44100 hz - 16 bits recommended, 24 bits accepted -) in .aiff, .aif or .wav format.
- Visual shader files in .glsl format
- Animation projects files in the .kol format


ressourcesManagerPanel
the Ressource Manager panel


B) Managing audio files


1 From the Animation Panel,
Open one of the Audio Samples Tracks
parameters controller panel
RM opened from Audio player setting button
2 Click on the Top first button in the list of controllers buttons
for the choosen sample Track (here sample track 0)
RM opened from Audio player setting button
3 In the sequencer panel, click on the Settings
button for the player to which you want to load
an audio file.
RM opened from Audio player setting button
4 Browse through the directories, and select
the audio file you want to use for the selected player.
Click on the 'Load File' Button to load the sample
to the player.

(Note the AudioShare import button Copy all events
This option is only available when the Ressource
manager has been opened for an audio player file).

RM opened from Audio player setting button


TRICK: when importing a shader file into a player, the parameters for all the occurrences of this player are reseted to their default values. This can be a useful trick while composing.



C) Managing visual shader files


1 From the Animation Panel,
Open the Visual Track
parameters controller panel
RM opened from Audio player setting button
2 Click on the top 'Visual sequencer' button
RM opened from Audio player setting button
3 In the sequencer panel, click on the Settings
button for the visual player to which you want to
load a shader (.glsl) file.
RM opened from Audio player setting button
4 Browse through the directories, and select
the visual shader file you want to use for
the selected player.
Click on the 'Load File' Button to load the sample
to the visual player.
RM opened from Audio player setting button


D) Managing animation projects


1 From the Animation Panel,
click on the 'File Manager' button
in the main menu
RM opened from Audio player setting button
2 In the file browser, select the file you want to open
and click on the 'Import File' button

(Note the 'Create new empty file' button Copy all events.
This option is only available when the Ressource
manager has been opened from the main menu.)

RM opened from Audio player setting button




VII) User preferences

The user preferences panel is opened from the main menu (bottom right).

This parameters values are not specific to an animation file and are preserved from one sesion to another.
You can restore the original configuration by clicking the 'Factory reset' button.

UserPrefSelectedSceneAlpha Change the transparency level of the selected loop.
When set to minimum, the selected loop won't be visible.
When set to maximum, the selected loop will be totally white.
UserPrefSceneBordersAlphaSet the transparency of the loops borders in the Animation panel.
UserPrefSceneBorders.pngSet the thickness of the loops border in the Animation panel.
UserPrefShakeDeviceActivated.pngWhen activated, shaking the device will have the same effect as double tapping on a loop: trigger a randomization on the actual loop.
This can be usefull when listening to the K Machine outdoors.
UserPrefInputLevel.pngWhen the microphone input is activated, or when using the K Audiobus receiver port, this control the audio input level
UserPrefRefreshTrackActivity.pngWhen turned off the track activity wont be shown on the side of the tracks selection buttons.
Recommended only when ponctual performance gain is crucial ( video recording or live)
UserPrefRenderingQuality.pngThis change the size of the openGL viewport.
The recommended value is 1. The higher the value the finer the details, but the lower the framerate.
Recommended only when ponctual performance gain is crucial ( video recording or live)
UserPrefSoundTextureSize.pngChanges the size of the texture containing the sound frequencies datas.
The size is calculated based on the MAX_TEXTURE_SIZE openGL parameter of the device's gpu. For example, with a device with MAX_TEXTURE_SIZE value of 8192, value 1/8 will use a texture of 1024 float width. The height of the texture, which corresponds to the history of the height, has a fixed value of 256, which corresponds to 4,26 approx for a 60 fps.
the Texture can be accessed in glsl through the "sound" uniform value.
Recommended only when ponctual performance gain is crucial ( video recording or live)
UserPrefSoundBufferSize.pngChange the size of the texture containing the raw sound datas.
The size is calculated based on the MAX_TEXTURE_SIZE openGL parameter of the device's gpu. For example, with a device with MAX_TEXTURE_SIZE value of 8192, value 1/8 will use a texture of 1024 float width. The height of the sound buffer texture is 1 pixel.
the Texture can be accessed in glsl through the "soundBuffer" uniform value.
Recommended only when ponctual performance gain is crucial ( video recording or live)
UserPrefMaxVertices.pngChange the size of the Vertex Buffer Object used for vertices drawing. If no vertices number is specified in the glsl shader file through the 'KVerticesNumber' parameter (see Annex III - B - 2 ) this value is used by default and will correspond to the 'vertexCount' uniform. Otherwise, the 'KVerticesNumber' value specified in the glsl file will be used.
Recommended only when ponctual performance gain is crucial ( video recording or live)
UserPrefShowAudioLevel.png When turned of the audio level won't be shown anymore' , and you may experience a small performance gain.
Recommended only when ponctual performance gain is crucial ( video recording or live)
UserPrefLoopProgression.pngWhen turned off the loop progress won't be shown anymore, and you may experience a small performance gain.
Recommended only when ponctual performance gain is crucial ( video recording or live).
UserPrefFrameRate.pngWhen turned off, the framerate won't be shown anymore, but you may experience a small gain in performances.
Recommended only when ponctual performance gain is crucial ( video recording or live). '
Open Last saved fileWhen checked, the last saved project is automatically opened on startup
UserPrefFactoryReset.pngClick to reset all the settings of this panel to their initial state.
Ableton LinkClick to open the Ableton Link Panel.
Transition GL ModeSelect the open GL transition mode:
Each visual vertex shader can have it's own open GL rendering mode (see section Annex III - B) 2) Additional parameters ).
During transition from shader 1 to shader 2, framerate drop could occur if the drawing mode is not temporary changed. For example, transition from a vertex shader with high number of particles drawn in GL_POINTS mode, may slow down frame rate if drawn in GL_TRIANGLES ( as surface rendering takes more time than points rendering). Hence, the 'Transition GL mode' parameter allows to select the rule governing the Open GL draw mode used during transition from vertex shader 1 to vertex shader 2.

  • Simple: GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES in shader 1 will be replaced by GL_POINTS during transition if shader 2 rendering mode is GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP or GL_LINES.
    If rendering mode in shader 1 is GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP or GL_LINES, rendering mode is unchanged.
    This "Simple" transition rule was the default rule used in version prior to version 2.7.

  • Points: GL_POINTS is always used during transition.
    This is the default mode from version 2.7.


Annex I - Loading files to the K Machine

3 Types of files can be uploaded to the K Machine:

All three types of files can be upload throught ITunes File Sharing.
For Audio samples files, import through AudioShare is also possible.

Concerning audio samples, note that in K Machine v2, only .aiff (or .aif) and .wav samples 44100KHZ are supported. Note also that no error message will display in case you try to load any other format, however you may encounter unpredictable sound behaviors (glitch, silences, pitch shift etc..).



A)Import files with ITunes File sharing



To be visible from the K Machine Ressources Manager, and whatever their type, your files only have to be uploaded in a directory placed in the ITunes File Sharing folder of the K Machine.
The only difference being the prefix used for the directory name containing the files:
Depending on the prefix of the directory name, the K Machine will search for audio samples, shader files, or animation project in it.

Type of ressource:Prefix your folder name with:
Audio samples (.aiff or .wav)SAMPLES_
Visual shaders (.glsl)SHADERS_
Animations (.kol)ANIMS_

ITuneFileSharing2.png
The three type of directories seen in the ITunes File Sharing directory of the K Machine.


Follow these steps to upload files through Itunes File Sharing:
  1. Connect your device to your computer with a lightning cable
  2. Open Itunes
  3. Click on your device Icon
  4. Click on the 'Apps' option in the left panel'
  5. Browse down on the right panel until you see the file sharing windows
  6. In the File sharing, locate K Machine and click on it
  7. You should see 3 types of directories:
    Directories with names starting with A
  8. From AudioShare, click on the ‘import to K Machine’ button.
  9. Select your sample in in list and click on the ‘use ressource’ button.


ITuneFileSharing1.png

B) Import audio samples with AudioShare


AudioShare is an audio document manager with powerful import and export abilities, edited by Kymatica.
See http://kymatica.com/Software/AudioShare for more informations.
See AudioShare for download.

  1. Open the parameters controller panel for the sample track for which you want to import an audio sample
  2. Click on the 'Track sequencer' button (first button in the controller)
    The sequencer panel opens.
  3. Click on the ‘Player Settings’ factoryReset button for the desired player (0-8).
    The File Manager opens.
  4. Create a new directory, or use one of your own directories (you can't import in the root directory nor in the built-in directories).
  5. Click on the ‘import from AudioShare’ button loadFileButton
  6. From AudioShare, once your file selected, click on the ‘import to K Machine’ button.
  7. You can now select your sample in the list and click on the ‘Load File’ button loadFileButton button.
C) Import audio samples with AudioPaste and AudioStore


AudioPaste is an audio document manager tool with powerful import and export abilities, edited by Retronyms.
See http://retronyms.com/audiocopy/ for more informations.
See AudioCopy for download.

  1. Open the parameters controller panel for the sample track for which you want to import an audio sample
  2. Click on the 'Track sequencer' button (first button in the controller)
    The sequencer panel opens.
  3. Click on the ‘Player Settings’ factoryReset button for the desired player (0-8).
    The File Manager opens.
  4. Create a new directory, or use one of your own directories (you can't import in the root directory nor in the built-in directories).
  5. Click on the ‘import with AudioPaste’ button load File withAudioPaste
  6. From AudioPaste, select your file or directory, and click on the available 'Paste' button.
  7. You can now select your sample in the list and click on the ‘Load File’ button loadFileButton button.
Annex II - Display animation on second screen

You can connect the K Machine to a external screen using an Lightning to VGA or HDMI cable adapter.

When connecting or disconnecting the second screen, a popup message should appear.

Once a second screen has been connected, the user interface will stay displayed on your ios device, while the animation visual is displayed on the second screen.

secondScreenConnected


secondScreenDisconnected

Once a second screen is connected:

Note that you may need to change Rendering quality when using a second screen.
Best resolution is always "1.0" when using a second screen.
To change resolution, expand the bottom left main menu, choose user preferencesPreference manager and set the Rendering quality
UserPrefRenderingQuality.png.

Annex III - Visual shader files format and creation

K Machine v2 only accepts vertex shader files in the glsl language.
K Machine v2 does not include its own shader editor, so the process is to create your shader using an external editor, and then upload the shader file through ITunes File Sharing.

One of the best tools available online for vertex shader creation is the http://www.vertexshaderart.com website.

A) Creating simple compatible vertex shaders


Any shader running on the reference site http://www.vertexshaderart.com should be compatible with the KMachine v2, as long as the number of used vertices and the rendering modes are specified using the K Machine 'tag in comments' described in section "B) Creating advanced vertex shaders subsection".

Note that when no drawing mode is specified using the 'KDrawmode' parameter in comments described in section "B) Creating advanced vertex shaders subsection", the K Machine will automatically use the GL_POINTS as a default drawmode.

Note also that Since the website http://www.vertexshaderart.com treats the code specifying how Kmachine sets up some internal parameters as comments, the code can compile and work as expected on the website but still fail in the Kmachine app if any of the rules described in section "B) Creating advanced vertex shaders" is broken.
If no rule listed in section "B) Creating advanced vertex shaders" are broken and you still experience unexpected behaviour or crash, please contact kolargon.art@gmail.com for bug report.

Best way to create your own shader is to proceed as follow:



The following table lists the available parameters you can use in your glsl shader.

Inputs
vertexId float number of the vertex 0, 1, 2 ... N
vertexCount float total number of vertices
resolution vec2 resolution of the image.
mouse vec2 mouse position normalized (-1 to 1)
touch sampler2D touch history 32x256 (4sec @60fps)
x = x, y = y, z = pressure, w = time
column 0 is mouse or first finger.
column 1 is second finger ...
Note the the pressure parameter may not be available on all type of devices. Please refer to you device specifications for more informations.
time float time in seconds
sound sampler2D data from the music Nx256, alpha only
240 rows of history (4secs @60fps)
soundRes vec2 resolution of sound
background vec4 background color
loopProgress float From 0. to 1., indicates the progression in the currently selected loop reading.
soundBuffer sampler2D data from the sound buffer, alpha only
Datas are accumulated on 1 row texture of the size specified
in the user settings.
Outputs
gl_Position vec4 standard GLSL vertex shader output
v_color vec4 color to output from fragment shader
BLEND is enabled, function is ONE,ONE_MINUS_SRC_ALPHA
DEPTH_TEST is enabled.


B) Creating advanced vertex shaders


1) Exposing controllers parameters


'Exposing' a parameters means once your shader code is loaded to the K Machine, a controller will automatically be created for this parameter.
You will also have access to a sequencer panel for this parameter, a randomization option, and a finger mapping option.

You can expose as much as 8 parameters in your glsl code.
A special syntax allows the K Machine to interpret parameters as 'exposed'.
For a variable to be recognized as an exposed parameter, it must be declared as a #define, and the parameter name must be followed by:

["//KParameter"][" "][minimum value][">>"][maximum value]

(In green the parts you have to change for each parameter)

Note the spaces are important.

For example:

#define positionX 3.//KParameter 0.>>10.
#define positionY 1.//KParameter 0.>>1.
#define colorR 1.//KParameter 0.>>1.
#define colorG 1.//KParameter 0.>>1.
#define colorB 1.//KParameter 0.>>1.
#define rotationFactorX 1.//KParameter 0.>>1.
#define rotationFactorY 1.//KParameter 0.>>1.
#define rotationFactorZ 1.//KParameter 0.>>1.


In http://www.vertexshaderart.com shader editor should look like:
shaderParametersExposed

Make sure you follow the rules:

Strictly follow the syntax, no extra space, no missing character
#define positionX 3.// KParameter 0.>>10.
Error !! extra space after "//"
#define positionX 3.//KParameter 0.>>10.
Error !! extra space after "KParameter"
#define positionX 3. //KParameter 0.>>10.
Error !! extra space after "3."

Do not forget dot on the min and max values (and do not add extra either ;)
#define parameter0 3.// KParameter >>10.
Error !! missing min value before ">>"
#define parameter0 3.// KParameter 0.>>10.5.
Error !! extra dot on "10.5."


2) Additional parameters


You can specify an additional rendering parameter using the following syntaxes:

1. openGL ES rendering mode

["//KDrawmode="][rendering mode]

with [rendering mode] being one of the following values:

GL_POINTS
GL_LINE_STRIP
GL_LINE_LOOP
GL_LINES
GL_TRIANGLE_STRIP
GL_TRIANGLE_FAN
GL_TRIANGLES

And finally, code being for example:

//KDrawmode=GL_TRIANGLES

As shown is the http://www.vertexshaderart.com User Interface:

shaderParametersExposed

2.Number of vertices to draw

["//KVerticesNumber="][number of vertices to draw]

Example:
//KVerticesNumber=50000

3. Background color

["//KBackGroundColor="]vec3(r,g,b)

Example:
//KBackGroundColor=vec3(0.,1.,1.);

Annex IV - Audiobus support




K Machine supports Ableton Link.
To activate, open the 'User Preferences panel' (see section VII) User preferences), and click on the 'Ableton Link' button (image below).

Activate Ableton Link

IMPORTANT : The K Machine can have different tempo settled for each loop.

Hence, when entering a loop, the K Machine do normally fire a tempo event, trying to set the tempo of the newly selected loop.
When using different apps synchronized with Ableton Link, you can modulate this behavior through the 'Tempo Bypass controller' in the main audio panel.
Depending of the configuration of this controller, K Machine may lead the tempo of the whole AB Link ring, or not.

Tempo Bypass controller K Machine leads (the tempo of the connected AB Link apps).
Tempo Bypass controller Classic AB Link settings (K Machine's default behavior is bypassed, no tempo setting at the beginning of a loop).


Annex VI - Using "Open In..." feature

1)Opening resource in another App


"Open in..." feature is available for both audio and visual shader files resources.
The "Open in" feature allows importation of a ressource to an other app on your IOS device. You can for example use a text Editor to edit you shader files, or a sound editor to edit a sound file.

To open a resource in another App:

1. In the File manager, click on the open In button on the right of the resource name to open the ressource in another application.

Tempo Bypass controller

2. Click on the App in which you want to open the ressource.

Tempo Bypass controller



2)Importing resources in K Machine


To import a file in the K Machine:
Important: Zip package are automatically expanded at the right place. However, when importing a single file in the K Machine (for example .glsl or .wav) using the IOS "Open In..." feature, make sure you have the File Manager opened and have a valid path selected for this type of resource. The imported file will be automatically copied at the selected path.
You can't copied ressources in the default bundle directory.
1. Click on the file name

Tempo Bypass controller

2. Choose 'K Machine'

Tempo Bypass controller

Annex VII - Startup factory reset

In case K Machine crashes on startup, it is possible to force a reset of user's settings to default factory configuration following these steps:
  1. Quit K Machine
  2. Create a empty file, and name it "KMACHINE_HARD_RESET.txt"
  3. Drop the file in the ITunes File Sharing folder of the K Machine
  4. Launch the K Machine App
The settings will be reset to default configuration and the "KMACHINE_HARD_RESET.txt" will automatically be deleted.


Annex VIII - Performance optimization tips

To access usefull parameters for performance optimization, go to bottom right main menu >> settings.
Best is to first set following 4 parameters to their lowest values:

- Rendering quality
- 'sound' texture size
- 'soundBuffer' Texture size
- Max vertices

Then depending your use progressively increase the values for each parameters.
Following parameters will directily affect the visual rendering quality:

Rendering quality: controls the size of the final rendered image.

Max vertices: controls the number of vertices - points - used by the vertex shader.


Following parameters will impact performance without direct visual impact:

'sound' texture size: controls the size of the texture used to transfer raw sound history data to the GPU.
Reducing this size will reduce the length (in seconds) of the raw sound history texture.

'soundBuffer' Texture size: controls the size of the texture used to transfer sound frequencies data history to the GPU.
Reducing this size will reduce the length (in seconds) of the sound frequencies data history texture.


Performance optimization tips
Important parameters for performance optimization in the setting menu.

Annex IX - Video capture

Important: Since version 2.74, captured video are not automatically saved to the photoroll album.
Once you stop your video capture, from the 'video replay' screen, press the "Share" button and choose the 'Save video option'.

To capture a video follow this steps:

1) - Start capture by clicking the 'start/stop video capture' button in the top menu. Video ready

2) - Stop capture by clicking again the 'start/stop video capture' button. Video ready

3) The video replay panel automatically opens.
Click the "Share" button to display the possible action for the recorded video. Video share button

4) From the pop up window choose the action you want to perform with the file.
To save to photoroll, click the 'Save video' button:
Video share button

http://www.kolargon.art