HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. deniskorg
    3. Topics
    • Profile
    • Following 1
    • Followers 0
    • Topics 6
    • Posts 26
    • Groups 0

    Topics

    • deniskorgD

      Midi Player Clock Sync (problem)

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      4
      0 Votes
      4 Posts
      104 Views
      deniskorgD

      I finally managed to reach a solution.

      For me, at least, it works fine for now. I don’t know if there was an easier solution, but for me, being able to sync that grid when I modify the tempo (for the internal clock), this change worked. I’ll leave below the function I modified in the source code.

      MasterClock::GridInfo MasterClock::processAndCheckGrid(int numSamples, const AudioPlayHead::CurrentPositionInfo& externalInfo) { GridInfo gi; auto shouldUseExternalBpm = !linkBpmToSync || !shouldPreferInternal(); if (bpm != externalInfo.bpm && shouldUseExternalBpm) setBpm(externalInfo.bpm); if (currentSyncMode == SyncModes::Inactive) return gi; // .. ADDED .. // // Store last tempo for detection static double lastBpm = -1.0; static double bpmSmooth = bpm; // Smoothed BPM static double lastPpqPosition = 0.0; // Store last PPQ position bool tempoChanged = (bpm != lastBpm); // Detect tempo change if (tempoChanged) lastBpm = bpm; // Interpolate BPM smoothly over time double smoothingFactor = 0.1; // Lower = smoother, Higher = faster response bpmSmooth += (bpm - bpmSmooth) * smoothingFactor; // Convert BPM to quarter notes in samples (using smoothed BPM) const auto quarterInSamples = (double)TempoSyncer::getTempoInSamples(bpmSmooth, sampleRate, 1.0f); // Instead of relying on uptime, calculate PPQ dynamically (like in updateFromExternalPlayHead) double ppqTime = lastPpqPosition + ((double)numSamples / quarterInSamples); lastPpqPosition = ppqTime; // Calculate grid alignment based on PPQ (like in updateFromExternalPlayHead) double multiplier = (double)TempoSyncer::getTempoFactor(clockGrid); double nextGridPPQ = std::ceil(ppqTime / multiplier) * multiplier; double nextGridSamples = nextGridPPQ * quarterInSamples; samplesToNextGrid = nextGridSamples - (ppqTime * quarterInSamples); if (currentSyncMode == SyncModes::SyncInternal && externalInfo.isPlaying) { uptime = ppqTime * quarterInSamples; samplesToNextGrid = gridDelta - (uptime % gridDelta); } // ... added up to here if (currentState != nextState) { currentState = nextState; uptime = numSamples - nextTimestamp; currentGridIndex = 0; if (currentState != State::Idle && gridEnabled) { gi.change = true; gi.timestamp = nextTimestamp; gi.gridIndex = currentGridIndex; gi.firstGridInPlayback = true; samplesToNextGrid = gridDelta - nextTimestamp; } nextTimestamp = 0; } else { if (currentState == State::Idle) { uptime = 0; lastPpqPosition = 0.0; // Added ... to reset PpqPosition } else { jassert(nextTimestamp == 0); uptime += numSamples; samplesToNextGrid -= numSamples; if (samplesToNextGrid < 0 && gridEnabled) { currentGridIndex++; gi.change = true; gi.firstGridInPlayback = waitForFirstGrid; waitForFirstGrid = false; gi.gridIndex = currentGridIndex; gi.timestamp = numSamples + samplesToNextGrid; samplesToNextGrid += gridDelta; } } } return gi; }
    • deniskorgD

      Does HISE Support FLAC Files in SampleMaps?

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      6
      0 Votes
      6 Posts
      181 Views
      deniskorgD

      @Christoph-Hart and is hard to add this thing of Api :))? In my application, users import samples which create a temporary sample map that they can modify. After modifications, both the sample map and the WAV samples are copied to a custom folder. I need to know how to compress HLAC files in a temporary folder and then copy the ID.ch file to the custom folder

    • deniskorgD

      Question About Sample Map Preloading...

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      11
      0 Votes
      11 Posts
      273 Views
      deniskorgD

      @d-healey

      I made a screen recording that shows what this custom sample map contains. It is for different sample folders, allowing users to import samples and create a custom sample map for their samples.

    • deniskorgD

      How to ignore file.loadAsObjec(), if file is not a valid json

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      13
      0 Votes
      13 Posts
      449 Views
      deniskorgD

      @d-healey it works, thank you

    • deniskorgD

      copy a directory folder

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      2
      0 Votes
      2 Posts
      229 Views
      d.healeyD

      @deniskorg A bit late but I just added copyDirectory https://github.com/christophhart/HISE/pull/655