OfficialIncubo / BeatDrop-Music-Visualizer

The Milkdrop2 Music Visualization Standalone, only for Windows
https://twitter.com/BeatDropVis
Other
44 stars 2 forks source link

Hardcut Modes! #13

Closed OfficialIncubo closed 1 year ago

OfficialIncubo commented 1 year ago

I tried to recreate the hardcut modes based on the beat detection, like Milkdrop 3! My implementation gone sucky and unstable.

My code is:

        case VK_F11:   //NOT FUNCTIONAL BECAUSE EXECUTED ONE TIME
        {
            HardcutMode++;
            if (HardcutMode == 1)
                {
                    m_bHardCutsDisabled = false;
                    wsprintfW(m_szSongTitle, L"Hardcut Mode: Normal"); LaunchSongTitleAnim();
                }
            if (HardcutMode == 2) //WIP: Bass Blend
            {
                m_bHardCutsDisabled = true;
                int upd = GetTime();
                if (upd % 1 == 0) timetick += 0.1;
                if ((double)mysound.imm_rel[0] > 1.8 && timetick >= 1 && !m_bPresetLockedByCode)
                {
                    if (m_nLoadingPreset == 0)
                    LoadRandomPreset(m_fBlendTimeAuto);
                    timetick = 0;
                }
                wsprintfW(m_szSongTitle, L"Hardcut Mode: Bass Blend"); LaunchSongTitleAnim();
            }

            if (HardcutMode == 3)
            {
                m_bHardCutsDisabled = true;
                wsprintfW(m_szSongTitle, L"Hardcut Mode: Bass"); LaunchSongTitleAnim();
            }
            if (HardcutMode == 3)
            {
                if ((double)mysound.imm_rel[0] > 2 && !m_bPresetLockedByCode)
                {
                    if (m_nLoadingPreset == 0)
                        LoadRandomPreset(0.0f);
                }
            }

            if (HardcutMode == 4)
            {
                HardcutMode = 0;
                m_bHardCutsDisabled = true;
                wsprintfW(m_szSongTitle, L"Hardcut Mode: OFF"); LaunchSongTitleAnim();
            }
        }   //WORK IN PROGRESS

I initialized HardcutMode, timetick as int. I need to press F11 to change hardcut modes without freezing BeatDrop! That was a very hard challenge for me to implement it. I want every hardcut mode to be worked on every frame.

Milkdrop2077 (serge000) told me on Twitter DM: image

Very hard to do :(

OfficialIncubo commented 1 year ago

Okay, I retried today to implement this feature and that worked. Now the hardcut modes feature are now ready to use!

https://github.com/OfficialIncubo/BeatDrop-Music-Visualizer/assets/74858188/89a3eebb-820b-4360-9f17-9aa1efa8c7d8

GitHub only supports 10MB video file. If you hate the video compression, please try this demo on Twitter.