public IndependantGlowSeries(ImmutableList <TaggedBeat> beats, BeatPositioner beatPositioner) : this( beats : ErrorUtils.ThrowIfArgNull(beats, nameof(beats)), glowStartTime : beats.Min( b => b.Tags.OfType <Glow>().Min( g => beatPositioner.BeatToTime(b.Beat) - g.FadeInTime ) ), glowEndTime : beats.Max( b => b.Tags.OfType <Glow>().Max( g => beatPositioner.BeatToTime(b.Beat) + g.FadeOutTime ) ) ) { }
/// <summary> /// /// </summary> /// <param name="beats">Does not need to be sorted</param> /// <param name="beatPositioner"></param> /// <param name="targetSize"></param> /// <returns> /// Note: Will be sorted by <see cref="GlowStartTime"/> (and therefore /// also <see cref="GlowEndTime"/>, as they can't overlap) /// </returns> public static List <IndependantGlowSeries> Split(IEnumerable <TaggedBeat> beats, BeatPositioner beatPositioner, int targetSize) { if (beats == null) { throw new ArgumentNullException(nameof(beats)); } if (beatPositioner == null) { throw new ArgumentNullException(nameof(beatPositioner)); } if (beats == null) { throw new ArgumentNullException(nameof(beats)); } var glowSeriesList = new List <IndependantGlowSeries>(); foreach (var beat in beats) { double beatTime = beatPositioner.BeatToTime(beat.Beat); // var glowEndTime = beats[i].Tags.OfType<Glow>().Max(g => beatTime + g.FadeOutTime); var glows = beat.Tags.OfType <Glow>(); var glowStartTime = beatTime - glows.Max(g => g.FadeInTime); var glowEndTime = beatTime + glows.Max(g => g.FadeOutTime); // - Loop through all existing glow series. // - For the first one that overlaps with the current beat, // add the current beat to it (and expand the glow start/end times as appropriate) // - For each subsequent one that overlaps, add it to the first // one that overlapped (and expand the glow start/end times as appropriate) // - Then set the index the subsquent overlapping series was at to Empty (equiv. of null) // - After the looping, remove all Empty entries from the glow series list // - Finally, if the beat did not overlap with any existing glow series, // add a new glow series with just that beat. // - This design allows any IEnumerable to be used. In contrast, a design that looked ahead // through the subsequent elements to check if they overlapped would only work with an // IList (as it is not advisable to enumerate through an IEnumerable multiple times, as // it could be performing some complex query or taking data from a database for all we know) // - This should (hopefully) be less than O(n^2) when there's a decent amount of overlapping // (the null-entry-removal step might complicate it, idk) int firstOverlapIndex = -1; for (int gsIndex = 0; gsIndex < glowSeriesList.Count; gsIndex++) { bool overlaps = ( glowSeriesList[gsIndex].GlowEndTime >= glowStartTime && glowSeriesList[gsIndex].GlowStartTime <= glowEndTime ); if (overlaps) { if (firstOverlapIndex < 0) { firstOverlapIndex = gsIndex; glowSeriesList[gsIndex] = glowSeriesList[gsIndex].AddAndExpand( beats: new[] { beat }, glowStartTime: glowStartTime, glowEndTime: glowEndTime ); } else { glowSeriesList[firstOverlapIndex] = glowSeriesList[firstOverlapIndex].AddAndExpand( beats: glowSeriesList[gsIndex].Beats, glowStartTime: glowSeriesList[gsIndex].GlowStartTime, glowEndTime: glowSeriesList[gsIndex].GlowStartTime ); glowSeriesList[gsIndex] = Empty; } } } RemoveAllUnordered(glowSeriesList, x => x.IsEmpty); // ^ Do this each outer loop to avoid the list getting overly long if (firstOverlapIndex < 0) { glowSeriesList.Add( new IndependantGlowSeries( beats: ImmutableList.Create(beat), glowStartTime: glowStartTime, glowEndTime: glowEndTime ) ); } // if ( // beats // .Select((taggedBeat, index) => (taggedBeat, index)) // .Skip(beatIndex + 1) // .TryGetLast( // x => x.taggedBeat.Tags.OfType<Glow>().Any( // g => beatPositioner.BeatToTime(x.taggedBeat.Beat) - g.FadeInTime <= lastBeatGlowEndTime // ), // out var lastOverlap // ) // ) { // // } // // beatIndex++; } glowSeriesList.Sort((x, y) => x.GlowStartTime.CompareTo(y.GlowStartTime)); GroupToMeetTargetSize(glowSeriesList, targetSize); return(glowSeriesList); }
static void PrintFFmpegOverlayEffectsCommand() { const double firstBeatAudioPos = 16.483; //Different as this is using the synced & edited video const double beatInterval = 0.46875; const int barLength = 4; var beats = new BeatPositioner( firstBeat: firstBeatAudioPos, interval: beatInterval, barLength: barLength ); const string mainFolder = @"C:\Users\Alex\Pictures\Meme Templates\Meme Making\Mum Headbanging"; var GlowWhiteCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-white.png"))); var GlowLargeWhiteCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-white-2x.png"))); var GlowTransparentRedCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-red-opacity130.png"))); var GlowTransparentBlueCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-blue-opacity130.png"))); var GlowTransparentGreenCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-green-opacity130.png"))); var GlowTransparentYellowCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-yellow-opacity170.png"))); var GlowTransparentPurpleCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-purple-opacity150.png"))); var GlowTransparentOrangeCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-orange-opacity170.png"))); var GlowTransparentLightblueCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-lightblue-opacity180.png"))); var GlowTransparentDarkgreenCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-darkgreen-opacity170.png"))); var GlowRedCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-red.png"))); var GlowBlueCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-blue.png"))); var GlowGreenCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-green.png"))); var GlowYellowCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-yellow.png"))); var GlowPurpleCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-purple.png"))); var GlowOrangeCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-orange.png"))); var GlowLightblueCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-lightblue.png"))); var GlowDarkgreenCircle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-darkgreen.png"))); var GlowSemitransparentWhiteRectangle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-white-rectangle-opacity230.png"))); var GlowTransparentWhiteRectangle = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-circlular-white-rectangle-opacity200.png"))); //var GlowDiamond = new GlowType(new FileInfo(Path.Combine(mainFolder, "glow-diamond-white.png"))); // colorMixer: new FFmpegColorChannelMixer( // redPart: (1, 1, 1, 0), // greenPart: (0, 0, 0, 0), // bluePart: (0, 0, 0, 0), // alphaPart: (0, 0, 0, 0.5) // ), //Note: // 1 third of a beat = 0.15625 // To prevent a continuous overlap in the section with repeated beats 1 third of a beat apart, // set the synth beat glow durations to, at most, 0.156 seconds (in total, ie. fade in + fade out) //Note: // If a fade in or out time is zero - even just one, not both - the fade doesn't show at all. // I've modified Glow() to handle this. Glow fullBeatEven = new Glow(GlowSemitransparentWhiteRectangle, 0.001, 0.2, x: 0.5, y: 0.5); Glow fullBeatOdd = new Glow(GlowSemitransparentWhiteRectangle, 0.001, 0.2, x: 0.5, y: 0.5); Glow leftSynthBeatRed = new Glow(GlowRedCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatBlue = new Glow(GlowBlueCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatGreen = new Glow(GlowGreenCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatYellow = new Glow(GlowYellowCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatPurple = new Glow(GlowPurpleCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatOrange = new Glow(GlowOrangeCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatLightblue = new Glow(GlowLightblueCircle, 0.001, 0.15, x: 0, y: 0); Glow leftSynthBeatDarkgreen = new Glow(GlowDarkgreenCircle, 0.001, 0.15, x: 0, y: 0); Glow rightSynthBeatRed = new Glow(GlowRedCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatBlue = new Glow(GlowBlueCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatGreen = new Glow(GlowGreenCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatYellow = new Glow(GlowYellowCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatPurple = new Glow(GlowPurpleCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatOrange = new Glow(GlowOrangeCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatLightblue = new Glow(GlowLightblueCircle, 0.001, 0.15, x: 1, y: 0); Glow rightSynthBeatDarkgreen = new Glow(GlowDarkgreenCircle, 0.001, 0.15, x: 1, y: 0); var taggedBeats = new BeatTagSequence( beatPositioner: beats, firstBeatTags: ImmutableList.Create <object>(fullBeatEven, leftSynthBeatRed, rightSynthBeatRed) ) .SkipByBeats(2.5 / 3.0).TagAndAdd(leftSynthBeatBlue) .SkipByBeats(0.25 / 3.0).TagAndAdd(rightSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatGreen) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatBlue) //Prev: duhh, drrruhh du du duhh //Next: duhh, duh boof, duh boof, duh boof, duh boof .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatYellow, rightSynthBeatYellow) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatPurple) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven) .SkipByBeats(2.0 / 3.0).TagAndAdd(rightSynthBeatGreen) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven) .SkipByBeats(2.0 / 3.0).TagAndAdd(rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) //Prev: duhh, duh boof, duh boof, duh boof, duh boof //Next: duh duhh, drrruh du du duhh du du duhh .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatLightblue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, rightSynthBeatLightblue) .SkipByBeats(2.5 / 3.0).TagAndAdd(leftSynthBeatGreen) .SkipByBeats(0.25 / 3.0).TagAndAdd(rightSynthBeatGreen) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatPurple) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatPurple) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatPurple) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatPurple) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatGreen) //Prev: duh duhh, drrruh du du duhh du du duhh //Next: duhh, boof, duh duhh, duh duhh-- .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed, rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatYellow, rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatGreen, rightSynthBeatGreen) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatYellow, rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatGreen, rightSynthBeatGreen) //Prev: duhh, boof, duh duhh, duh duhh-- //Next: --duh duhh, drrruh du du duhh .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatYellow, rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatGreen, rightSynthBeatGreen) .SkipByBeats(2.5 / 3.0).TagAndAdd(leftSynthBeatRed) .SkipByBeats(0.25 / 3.0).TagAndAdd(rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed) //Prev: --duh duhh, drrruh du du duhh //Next: duhh, duh boof, duh boof, duh boof, duh boof .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatLightblue, rightSynthBeatLightblue) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatPurple) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatGreen) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) //Prev: duhh, duh boof, duh boof, duh boof, duh boof //Next: duh duhh, drrruh du du duhh du du duhh .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed, rightSynthBeatRed) .SkipByBeats(2.5 / 3.0).TagAndAdd(leftSynthBeatLightblue) .SkipByBeats(0.25 / 3.0).TagAndAdd(rightSynthBeatLightblue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatLightblue) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatPurple) //Prev: duh duhh, drrruh du du duhh du du duhh //Next: duhh, boof, duh duhh, duh duhh, duh-- (iighiahhh iighiahhh iighiahhh iighiahhh iighiahhh) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed.With(fadeOutTime: 0.6), rightSynthBeatRed.With(fadeOutTime: 0.6)) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatRed.With(fadeOutTime: 0.6), rightSynthBeatRed.With(fadeOutTime: 0.6)) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatRed) //looks better with //leave these out for extra emphasis of the other beats .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed.With(fadeOutTime: 0.6), rightSynthBeatRed.With(fadeOutTime: 0.6)) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatRed) //looks better with //leave these out for extra emphasis of the other beats .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatRed.With(fadeOutTime: 0.6), rightSynthBeatRed.With(fadeOutTime: 0.6)) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatRed) //looks better with //leave these out for extra emphasis of the other beats //Prev: duhh, boof, duh duhh, duh duhh, duh (iighiahhh iighiahhh iighiahhh iighiahhh iighiahhh) //Next: duhh du du duhh du du duhh du du duhh du du (#1) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) //Prev: duhh du du duhh du du duhh du du duhh du du (#1) //Next: duhh du du duhh du du duhh du du duhh du du (#2) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatOrange) //Prev: duhh du du duhh du du duhh du du duhh du du (#2) //Next: duhh du du duhh du du duhh du du duhh du du (#3) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatGreen) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatGreen) //Prev: duhh du du duhh du du duhh du du duhh du du (#3) //Next: duhh du du duhh du du duhh du du duhh du du (#4) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(rightSynthBeatRed) //Prev: duhh du du duhh du du duhh du du duhh du du (#4) //Next: duhh du du duhh du du duhh du du duhh du du (#5) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatLightblue, rightSynthBeatLightblue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatBlue, rightSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatBlue, rightSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatYellow, rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange, rightSynthBeatOrange) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatOrange, rightSynthBeatOrange) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatGreen, rightSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatDarkgreen, rightSynthBeatDarkgreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatDarkgreen, rightSynthBeatDarkgreen) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatRed, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatRed) //Prev: duhh du du duhh du du duhh du du duhh du du (#5) //Next: duhh du du duhh du du duhh du du duhh du du (#6) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatBlue, rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatYellow, rightSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatBlue, rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatYellow, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatYellow, rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed, rightSynthBeatPurple) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatPurple, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatPurple) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatLightblue, rightSynthBeatGreen) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatGreen, rightSynthBeatLightblue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatLightblue, rightSynthBeatGreen) //Prev: duhh du du duhh du du duhh du du duhh du du (#6) //Next: duhh du du duhh du du duhh, duhh du du duhh, duhh boof, mu fa, sa boof, duh BOOF. .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatRed, leftSynthBeatRed, rightSynthBeatPurple, rightSynthBeatPurple) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatPurple, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatPurple, rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatYellow, rightSynthBeatRed) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatYellow) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatRed, rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatYellow, rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd, leftSynthBeatBlue, rightSynthBeatPurple) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatPurple, rightSynthBeatBlue) .SkipByBeats(1.0 / 3.0).TagAndAdd(leftSynthBeatPurple, rightSynthBeatBlue) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatBlue, rightSynthBeatPurple) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatRed, leftSynthBeatRed, rightSynthBeatRed, rightSynthBeatRed) .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) .SkipByBeats(2.0 / 3.0).TagAndAdd(fullBeatEven, leftSynthBeatLightblue, rightSynthBeatGreen) //mu .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatEven, leftSynthBeatGreen, rightSynthBeatLightblue) //fa .SkipByBeats(2.0 / 3.0).TagAndAdd(fullBeatEven, leftSynthBeatLightblue, rightSynthBeatGreen) //sa .SkipToBeat(Beat.NextBeat).TagAndAdd(fullBeatOdd) .SkipByBeats(2.0 / 3.0).TagAndAdd(leftSynthBeatYellow, rightSynthBeatYellow) .SkipToBeat(Beat.NextBeat).TagAndAdd( fullBeatEven, leftSynthBeatRed.With(fadeOutTime: 0.6), rightSynthBeatRed.With(fadeOutTime: 0.6), leftSynthBeatRed.With(fadeOutTime: 0.6), rightSynthBeatRed.With(fadeOutTime: 0.6), leftSynthBeatYellow.With(fadeOutTime: 0.6), rightSynthBeatPurple.With(fadeOutTime: 0.6) ); //Prev: duhh du du duhh du du duhh, duhh du du duhh, duhh boof, mu fa, sa boof, duh BOOF. Console.WriteLine("Tagged beat timings:"); Console.WriteLine(); foreach (var b in taggedBeats.TaggedBeats) { Console.WriteLine(beats.BeatToTime(b.Beat).ToString(".0000") + " [" + string.Join(", ", b.Tags) + "]"); } Console.WriteLine(); Console.WriteLine("FFmpeg input:"); Console.WriteLine(); Console.WriteLine( // GlowOverlayCommandBuilder.BuildFFmpegCommand( // inputVideo: new FFmpegInput( // new FileInfo( // Path.Combine(mainFolder, "Meme Video 1.2.1.mp4") // ) // ), // outputFile: new FFOutput( // new FileInfo( // Path.Combine(mainFolder, "Meme Video 5.3 - " + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".mp4") // ) // ), // taggedBeats: taggedBeats.TaggedBeats, // beatPositioner: beats // ).ToString() // StaggeredGlowOverlayCommandBuilder.BuildBatchCommand( // inputVideo: new FFmpegInput( // new FileInfo( // Path.Combine(mainFolder, "Meme Video 1.2.1.mp4") // ) // ), // outputFile: new FFOutput( // new FileInfo( // Path.Combine(mainFolder, "Meme Video 5.3 - " + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".mp4") // ) // ), // taggedBeats: taggedBeats.TaggedBeats, // beatPositioner: beats, // approxGlowsPerStage: 2 // ) CuttingGlowOverlayCommandBuilder.BuildBatchCommand( inputVideo: new FFmpegInput( new FileInfo( Path.Combine(mainFolder, "Meme Video 1.2.1.mp4") ) ), outputFile: new FFmpegOutput( new FileInfo( Path.Combine(mainFolder, "Meme Video 5.3 - " + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".mp4") ) ), taggedBeats: taggedBeats.TaggedBeats, beatPositioner: beats, approxGlowsPerCut: 7, approxGlowsPerSubstage: 5 ) ); Console.ReadLine(); }