[plugin] rex_JSMidiParser

0 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • I must say you have a great plugin rexrainbow

    Just wondering, if I have a MIDI file with multiple tracks, is there a way to pull the note from each track and store it in a value.

    i.e. if note is on track1 >>> set sprite.track1 to value

    if note is on track2 >>> set sprite.track2 to value

    Because my current game (Link) plays all the notes as if they are on the same track not multiple, and I think if I differentiate them it will sound a whole lot better. (Best example is the X-Files song)

  • emoaeden

    "Condition:Compare current track ID" could be used to identify multiple tracks.

    Please provide a very simple test capx included midi if this condition does not work.

  • This is the CAPX that I have minimised it down to. I have tried Channel and Track with no luck.

    Hopefully you can help ^_^

  • emoaeden

    Open this page and select your x-file.mid, then the time-note will be shown, with the channel and trackID. (source capx)

    I had tested the compare channel condition and compare trackID, it seems worked fine.

  • I can see that it will output the trackID, but is there a way to have it perform certain conditions if the trackID equals a certain value (like I tried to do in the example) ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • emoaeden

    Try "Condition:Compare current track ID" of this plugin, or

    "system condition: compare two values" with "expression:trackID" of this plugin.

  • Hi, rexrainbow !

    Is it possible, with the current implementation of rex_JSMidiParser, to convert multiple MIDI files to JSON and address them individually? Something like Audio Tags in C2?

    Specifically, I'm interested in pre-converting a number of MIDI files to JSON for use at any time during the game. This will be with the eventual aim of being able to pause (thanks for the addition of the pause feature, BTW) one JSON stream, play another one, go back to the original stream... etc.

    Thanks again for your tireless plugin work!

  • johxn

    You could create rex_JSMidiParser instances for each "tag" in run-time.

  • Easy enough - Thanks rexrainbow !

    Is the MIDI playback supposed to be able to sync with audio playback?

    I've run a number of tests with synchronized audio and MIDI files (audio rendered from the same midi file), and when playing both files back simultaneously using rex_JSMidiParser and the audio plugin - rex_JSMidiParser seems to be playing back the MIDI data much faster than audio file.

    Would it be possible to get the MIDI playback to slave to Audio.CurrentTime?

  • johxn

    1. This plugin does not support "set playback time" currently. I will try to add it.

    2. To sync with audio... I can try it in the future.

  • Thanks for considering it, rexrainbow , I appreciate it!

    My goal is to have an efficient and speedy way of creating/streaming timing data that is locked to audio time. I can create all event/animation/whatever triggers via multitrack MIDI in my DAW - all sync'ed to my soundtrack.

    Cheers!

  • johxn

    sync with audio is not easy.

    Scirra had added an "action: schedule next play" before, to sync the sound effect with music.

  • Hi, rexrainbow

    Perhaps implementing something like this https://github.com/sebpiq/WAAClock in the rex_timeline plugin to manage playback of the rex_JSMidiParser data?

  • hi rexrainbow

    is there any tutorial to add more sound sampling? i need to play the bass and drum part of my midi

  • Update

    Add "Condition:For each note" to retrieve all notes in all tracks, channels.

    Get properties of each note by

    • Expression:CurTime, Expression:CurTick
    • Expression:CurPitch, Expression:CurPitchKey
    • Expression:CurVelocity
    • Expression:CurDuration, Expression:CurDurationTick

    sample capx

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)