Skip to content

Commit

Permalink
Neatening
Browse files Browse the repository at this point in the history
  • Loading branch information
judah-daniels committed Apr 21, 2024
1 parent 3fe748b commit df82cde
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 565 deletions.
11 changes: 1 addition & 10 deletions src/Algorithm/Templating.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@ genSlice slc =
-- segment
-- 2. PRIOR PROBABILITY: Choose the template with higher prior probability of occurence
-- 3. DIM7 RESOLUTION: If al top templates are fully diminished 7th chords, select the template whose roott is one
-- half-step below the root of the top scorig template in the following segment.

-- maxElems 0 mins [] = mins
-- maxElems n mins [] = mins
-- maxElems 0 (m : mins) (x : rst)
-- | fst x < fst m = maxElems 0 (ins x mins) rst
-- | otherwise = maxElems 0 (m : mins) rst
-- maxElems n mins (x : rst) = maxElems (n - 1) (ins x mins) rst
--
-- ins = L.insertBy ((flip . comparing) fst)
-- half-step below the root of the top scoring template in the following segment.

scoreTemplate
:: [InputSlice SPitch]
Expand Down
27 changes: 6 additions & 21 deletions src/Harmony.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{-# HLINT ignore "Use second" #-}
module Harmony
(

rotateVector
, pChordTones
, mostLikelyLabelFromSliceWithProb
Expand All @@ -21,39 +20,25 @@ module Harmony
, notePos
, notesVector
, noteVector
-- , ornamentLogLikelihoodDouble
-- , sliceChordLogLikelihood
-- , sliceChordWeightedLogLikelihoods
-- , sliceChordWeightedLogLikelihood
, ornamentLogLikelihood
, chordToneLogLikelihood
-- , scoreSegment
, scoreSegments
)
where

import PVGrammar
import Probability

import Harmony.Params
import Harmony.ChordLabel
import Common
import Data.Aeson
import Data.ByteString.Lazy qualified as BL
import Data.Maybe
import Data.Ord
import Debug.Trace
import GHC.Float (double2Int)
import GHC.Generics
import Internal.MultiSet qualified as MS
import Musicology.Core (AdditiveGroup)
import Musicology.Core qualified as Music
import Musicology.Pitch.Spelled
import Numeric.Log (Log (..))
import PVGrammar
import System.Random.MWC.Probability (multinomial, categorical)

import Data.Maybe
import Internal.MultiSet qualified as MS
import Data.Vector qualified as V
import Data.Bifunctor (bimap)
import Data.Tuple (swap)
import Data.List



transposeNote :: Music.Pitch SIC -> SPitch -> SIC
Expand Down
Loading

0 comments on commit df82cde

Please sign in to comment.