|
Sends the specified code expression (as a string argument) to Manhattan for immediate execution. This function supports the full functionality of the Manhattan language - changing values, controlling playback, adjusting synthesis, channel mixing, etc.
Similar to a code block in a cell, the expression can include multiple lines, separated by carriage returns or semi-colons (';') - it is not associated with a specific cell, but will default to the first cell in the pattern ([1:0]) if left unspecified.
Code("play(Melody)");
The code is executed immediately, without waiting for musical boundaries like beats or bars.
To sync game events with the music, place your code in a labelled pattern cell (e.g. "EnemyDeath") and use Set() or Code() to set a flag (i.e. variable), signalling that the code is waiting to run. Now use a macro (i.e. 0xx to 9xx) to check the flag regularly (i.e. at specific rows, every beat, etc.) and trigger the code when needed - i.e. @EnemyDeath.run().
|