Files
midi-playlist/lib/__pycache__/songkit.cpython-314.pyc
T

87 lines
11 KiB
Plaintext
Raw Normal View History

+
L¹Òjø ãóŒ€Rt^RIHtHtHtHtRtR]3Rlt]3Rlt ]3Rlt
^]3Rlt ^P]^,^3Rlt /R R0bR
R0bR R1bR R2bR
R3bRR4bRR5bRR6bRR7bRR8bRR9bRR:bRR;bRR<bRR=bRR5bt
R^^F^R^]R3Rlt^^_^R^]3Rlt^RR]^x^3R ltR>R!ltR"tR#]!^4Uu.uF#qR$,R%^ZV^,^
,,3NK% upR&.R?OR(.R@OR).RAOR*.RBOR+]!^4Uu.uF;qR',V^,'dR,M^,R%^UV^,^,,3NK= up/t^ ]R-3R.ltRCR/ltR#uupiuupi)Du˜
songkit — composition helpers built on midikit.
The patterns that make MIDI sound like a 1993 sound card rather than a
MIDI file: OPL-style 16th arpeggios, square-lead pitch-bend vibrato,
driving 8th-note bass, velocity humanising, and bar-based song structure.
All times are in bars.beats as floats: bar(t, beat=0) with 4/4 and your
file's tpq. E.g. with tpq=480, bar(2.5) == start of beat 3 of bar 3.
)ÚTrackÚGMÚDRUMSÚnoteiàçcóT€\\V^,V,V,44#)z@Absolute tick for bar t (0-based float), beat within bar (0..4).)ÚintÚround)ÚtÚbeatÚtpqs&&&Ú+/root/midi-playlist/tunes/../lib/songkit.pyÚbarrs€ä Œu�a˜!•e˜d•l cÕ)Ó*Ó +Ð+ócó€V#©N©©r s&r
Úqrs€Ø €Jrc ó<€.p^p^p^pVP4EF~pVR8Xd6WA^,8wd\RWTV^,3,4h^pV^,
pK@VPR4'dQRV^,RV^,RVRV^,RV^,/PWa^,4pW7,
pWG,
pK§VPR 4p\ V^,4p V^,p^dp
\ V4^8”dFV^,'d7R
V^,R V^,R VR
V^,RV^,/V^,,p\ V4^8”d"V^,'d\
V^,4p
VPW9Wz34W7,
pWG,
pEK� V#)uWhitespace-separated note grid -> list of (tick, pitch, dur, vel).
Grammar per token: PITCH[-dur[-vel]]
pitch: C0..C9 with #/b/suffixes (e.g. D4, A#5, Bb3)
dur: 1=whole 2=half 4=quarter (default) 8=eighth 16=sixteenth
vel: 1-127 (default 100)
rests: r4 / r8 / r2 / r16 / r1
Bars may be separated with '|'. If any '|' is present, every bar
segment must total exactly 4 quarter notes — a free bar-length
linter that has saved me from more off-by-one-eighth bugs than
I care to admit.
Example: 'D4 A4-8 D5-8 F5-8 E5-4 D5-2'
Ú|z)bar %d totals %d ticks, expected %d (4/4)ÚrÚr1Úr2Úr4Úr8Úr16Ú-Ú1Ú2Ú4Ú8Ú16)ÚsplitÚ
ValueErrorÚ
startswithÚgetÚNÚlenrÚappend) Útextr ÚoutÚtickÚ bar_ticksÚbar_noÚtokÚdurÚpartsÚpitchÚvels && r
Ú parse_scorer4sˆ€ð
€CØ €DØ€IØ
€FØ�z‰z�|ˆØ �#Œ:Ø !�GÔ#Ü Ð!LØ$*°s¸QµwÐ#?õ"@óAðAàˆIØ �a�KˆFÙ Ø �>‰>˜#× Ò Ø˜˜q� $¨¨a­°°s¸DÀ#ÈÅ(ؘ# �(ð$ß$'¡C¨°A­XÓ$6ð
à �KˆDØ Õ ˆIÙ Ø— ‘ ˜#“ˆÜ�%˜•(“ ˆØ�Q�hˆØˆÜ ˆu‹:˜Œ>˜e AŸhœhؘ˜a�  c¨A¥g¨s°C¸¸cÀQ½hؘ �ð#Ø#(¨¥8õ-ˆCä ˆu‹:˜Œ>˜e AŸhœhÜ�e˜A•h“-ˆCØ �
‰
�D Ð*Ô+Ø � ˆØÕ‹ ñ3ð4 €Jrcóz€\WR7p\W$4Fwrgr‰VPWV,WxW“4K! V#)z8Lay a parse_score() grid onto a track starting at a bar.r)rr4r)
ÚtrackÚ start_barÚscoreÚchannelr Úbaser
ÚpÚdÚvs
&&&&& r
Úmelodyr>Ks6€ä ˆyÔ "€DÜ! %Ö-‰
ˆˆaØ
�
‰
�4•8˜Q 1Ö.ñ.à €Lrcó˜€\V\V4,4p\V,Fp VPWV ,WeV4K V#)z0Play a chord: chord(t, 'D', 'm', 3) -> D3 F3 A3.)r'ÚstrÚ QUALITIESr)
r6r,Ú root_nameÚqualityÚoctaveÚvelocityÚdurationr9ÚrootÚivs
&&&&&&&& r
ÚchordrISs@€ä ˆYœ˜V›Õ
$Ó %€DÜ˜× Ð ˆØ
�
‰
�4 � H¸Ö@ñ!à €LrÚÚmajÚmÚdimÚaugÚsus2Úsus4Ú7Úmaj7Úm7Úm7b5Ú6Úm6Ú9Úadd9ÚsusÚ0121NTc
ó΀^V,p \V\4'd-\;QJd.RV4FNK 5M
!RV44p\V4EFwp wrÞ\V,Uu.uF%p\ V
\V4,4V,NK' pp\
V 4F°pVV\V4,,\V4,pVV,pV^8Xd7V
'd/V^,^ ,
^$8¼dV^,^ ,
MV^,p\W,VV, V 4pTPTTT;'g W”,WX4K² EK V#uupi)aOPL/Sound Blaster staple: 16th-note arpeggios following a chord chart.
chords: list of (root, quality) per bar, e.g. [('D','m'), ('Bb',''), ...]
pattern: indices into the chord tones (bass octave bump on index 0).
subdivision: notes per beat (4 = sixteenths).
c3ó8"€TFp\V4x€K R#5ir)r)Ú.0Úcs& r
Ú <genexpr>Úarp.<locals>.<genexpr>nsé€Ð0© 1œ˜AŸ˜«ùs‚)
Ú
isinstancer@ÚtupleÚ enumeraterAr'Úranger(rr)r6r7ÚchordsÚpatternÚ subdivisionrErDrFr9r Úraise_bass_octaveÚper_barÚirGÚqualrHÚtonesÚsÚidxr2r
s&&&&&&&&&&& r
Úarprods€ð�+�o€GÜ�'œ3×Òß”%Ñ0©Ó0—%‘%Ñ0©Ó0Ó0ˆÜ$ V×,‰ˆ‰<ˆDÜ6?À¶oÓF±o°”�4œ#˜f›+Õ%Ó&¨×+Ð+±oˆÐFÜ�w–ˆAؘ!œc '›lÕ*Õ+¬c°%«jÕ8ˆCؘ#•JˆEØ�aŒx×-Ø).¨q­°B­¸"Ô)<˜˜a� 2ž
À%ÈÅ(�Ü�I•M 1 {¥?°CÓ8ˆAØ �J‰J�q˜% ×!?Ð!?¨SÕ-?ÀÖ Sô
 ñ-ð €LùòGsÁ/+E"c
óf€^V,p \V4F˜wp
wr¼\V \V4,4p
\V 4FfpT
pV'dWé^,