This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.arwhite; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import javax.sound.sampled.AudioFormat; | |
import javax.sound.sampled.AudioSystem; | |
import javax.sound.sampled.DataLine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.arwhite.swing; | |
import java.awt.Dimension; | |
import java.awt.event.MouseAdapter; | |
import java.awt.event.MouseEvent; | |
import java.awt.event.MouseWheelEvent; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.arwhite.swing; | |
import java.awt.Dimension; | |
import java.awt.HeadlessException; | |
import java.awt.event.MouseEvent; | |
import java.awt.event.MouseWheelEvent; | |
import java.awt.event.MouseAdapter; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> Downloading https://ghcr.io/v2/homebrew/core/m4/manifests/1.4.19 | |
######################################################################## 100.0% | |
==> Downloading https://ghcr.io/v2/homebrew/core/m4/blobs/sha256:e0fec6a49fd80cc7279c71f319d70d01ed49e894b53cd91e39f170288232fa93 | |
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:e0fec6a49fd80cc7279c71f319d70d01ed49e894b53cd91e39f | |
######################################################################## 100.0% | |
==> Downloading https://ghcr.io/v2/homebrew/core/automake/manifests/1.16.5 | |
######################################################################## 100.0% | |
==> Downloading https://ghcr.io/v2/homebrew/core/automake/blobs/sha256:ae77a247a13ea860236a29b02769f5327395f712413f694d8a8d20cb6c21332d | |
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ae77a247a13ea860236a29b02769f5327395f712413f694d8a8 | |
######################################################################## 100.0% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.arwhite.music.helpers; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.stream.Collectors; | |
import xyz.arwhite.music.models.BaseNoteModel; | |
import xyz.arwhite.music.models.BeamEnum; | |
import xyz.arwhite.music.models.MeasureModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.arwhite.music.helpers; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Optional; | |
import java.util.stream.Collectors; | |
import xyz.arwhite.music.models.BaseNoteModel; | |
import xyz.arwhite.music.models.BeamEnum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.arwhite.music.helpers; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Optional; | |
import java.util.stream.Collectors; | |
import xyz.arwhite.music.models.BaseNoteModel; | |
import xyz.arwhite.music.models.BeamEnum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimeSigUtil { | |
public static boolean isCompoundTime(TimeSigModel model) { | |
if ( model.getTop() == 3 ) | |
return false; | |
if ( model.getTop() % 3 == 0 ) | |
return true; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Divisions { | |
public static int divisionsPerBeat(MusicalContext mcx) { | |
var div = mcx.getDivisions() * 4; | |
var top = mcx.getTimeSig().getTop(); | |
var bot = mcx.getTimeSig().getBottom(); | |
var bpb = TimeSigUtil.beatsPerBar(mcx.getTimeSig()); | |
return (div * top) / bot / bpb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AutoBeamSimpleTestAlgo1 { | |
// for divisions = 840 | |
private static Map<Integer, Integer> durations = Map.of( | |
BaseNoteModel.semiBreve, 3360, | |
BaseNoteModel.minim, 1680, | |
BaseNoteModel.crotchet, 840, | |
BaseNoteModel.quaver, 420, | |
BaseNoteModel.semiQuaver, 210, | |
BaseNoteModel.demiSemiQuaver, 105, |
NewerOlder