Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_tonejs_midiconvert

Plugin, ACE table, Discussion thread
Dependence: rex_tonejs_api

Introduction
Convert MIDI into Tone.js-friendly JSON, and play it.

Usage
Sample capx
Load midi
Call "Action:Load & Convert midi" to load midi from URL. "Condition:On convert completed" will be triggered when converting completed. Otherwise "Condition:On convert error" will be triggered.
Get JSON of result data from "Expression:Midi2JSON".
Play
Call "Action:Start" to play midi. These conditions will be triggered during playing
  • "Condition:On started", triggered when playing started.
  • "Condition:On event", triggered for each note.
  • "Condition:On ended", triggered when playing ended.
Parameters of trigger note
Add PolySynth and call "triggerAttackRelease" to play a note under "Condition:On event" with these expressions.
  • "Expression:Time"
  • "Expression:Note"
  • "Expression:Duration"
  • "Expression:Velocity"
User also could get track index of current note by "Expression:TrackIndex", or "Condition:Compare track index".
Pause, resume or stop
Sample capx
Call "Action:Pause", "Action:Resume", "Action:Stop" to pause, resume or stop playing.
Playback rate
Sample capx
Call "Action:Set playback rate" to change playback rate. Set playback rate to 0 will pause playing. Or set property "Timescale to playbackRate" to "Yes" to change playback rate by timescale of this plugin.

Official save-load
This plugin does NOT support official save-load.

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About