id
int64 0
45.1k
| file_name
stringlengths 4
68
| file_path
stringlengths 14
193
| content
stringlengths 32
9.62M
| size
int64 32
9.62M
| language
stringclasses 1
value | extension
stringclasses 6
values | total_lines
int64 1
136k
| avg_line_length
float64 3
903k
| max_line_length
int64 3
4.51M
| alphanum_fraction
float64 0
1
| repo_name
stringclasses 779
values | repo_stars
int64 0
882
| repo_forks
int64 0
108
| repo_open_issues
int64 0
90
| repo_license
stringclasses 8
values | repo_extraction_date
stringclasses 146
values | sha
stringlengths 64
64
| __index_level_0__
int64 0
45.1k
| exdup_ids_cmlisp_stkv2
sequencelengths 1
47
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15,628 | peachs-castle-wannabe.lisp | pouar_yadfa/data/events/peachs-castle-wannabe.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-events"; coding: utf-8-unix; -*-
(in-package :yadfa-events)
(defevent got-all-shine-stars-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "You got a MacGuffin in exchange for 5 Shine Stars, yay." #\Newline #\Newline)
(push (make-instance 'yadfa-items:macguffin) (inventory-of (player-of *game*)))
(removef-if (inventory-of (player-of *game*))
(lambda (e)
(typep e 'yadfa-items:shine-star))
:count 5)))
(defevent enter-race-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Welcome to the Race Area. To get the star in this area, you're gonna have to race against the enemy and win, but since Pouar can't code AIs of racers worth a shit, the enemy you're racing against is going to be that truck from Big Rigs: Over The Road Racing. You know, the one that doesn't move. Get ready for some brake jammin', CB talkin', convoy rolling action across America. And by that, I mean moving one zone to the north." #\Newline #\Newline)))
(defevent win-race-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Congrats, you won the race, also the star is just sitting here at the end, since that Truck isn't going to bring it to you." #\Newline #\Newline)
(push (make-instance 'yadfa-items:shine-star) (inventory-of (player-of *game*)))))
(defevent enter-thwomp-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "You see the Shine Star in the zone to the north and a Thwomp in the middle of the zone" #\Newline #\Newline
"Thwomp: You will never get past me, because once you stand under me, you're a gonner." #\Newline #\Newline)))
(defevent win-thwomp-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Thwomp: HEY!!! NO FAIR!!!! YOU KNOW I CAN ONLY MOVE UP AND DOWN!!!!!!!" #\Newline #\Newline
"You collect the star" #\Newline #\Newline)
(push (make-instance 'yadfa-items:shine-star) (inventory-of (player-of *game*)))))
(defevent enter-pokemon-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "You find a Pokémon trainer" #\Newline #\Newline
"Pokémon trainer: OK, Bowser has paid me to guard this star, so I'm going to fight you with all my might, with my level 2 Magikarp" #\Newline #\Newline)
(set-new-battle '((yadfa-enemies:magikarp . (list :level 2)))
:continuable t
:enter-battle-text "Pokémon trainer wants to battle. Pokémon trainer sent out Magikarp"
:win-events '(win-pokemon-area-1))))
(defevent win-pokemon-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Pokémon trainer: What?!?! I can't believe you beat my level 2 Magikarp!!!! You must be like, Mewtwo level of strong!!!!" #\Newline #\Newline
(name-of (player-of *game*)) " got a shine star for winning" #\Newline #\Newline)
(push (make-instance 'yadfa-items:shine-star) (inventory-of (player-of *game*)))))
(defevent enter-blank-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Seems Bowser decided to leave the shine star in this area in the middle of the level with no boss like an idiot" #\Newline #\Newline
(name-of (player-of *game*)) " gets a shine star")
(push (make-instance 'yadfa-items:shine-star) (inventory-of (player-of *game*)))))
(defevent enter-eggman-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Eggman: Bowser has paid me a ton of money to protect this shine star, So I'm going to use the same robot I used in Sonic Heroes since it worked so beautifully, an Egg Pawn with an Egg Spear that simply charges at you." #\Newline #\Newline)
(set-new-battle '((yadfa-enemies:egg-pawn . (list :level 1 :wield (make-instance 'yadfa-items:egg-spear))))
:continuable t
:enter-battle-text "Eggman sends out a Egg Pawn wielding a L̶a̶n̶c̶e̶ \"Egg Spear\""
:win-events '(win-eggman-area-1))))
(defevent win-eggman-area-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "I can't believe my crappy robot got destroyed again." #\Newline #\Newline
(name-of (player-of *game*)) " gets a shine star" #\Newline #\Newline)
(push (make-instance 'yadfa-items:shine-star) (inventory-of (player-of *game*)))))
| 4,782 | Common Lisp | .lisp | 66 | 60.333333 | 475 | 0.616447 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | ae75b2ed6a0465e1dfa34b2554f22a6fa0f31da91cd71bba5f32bb450012f882 | 15,628 | [
-1
] |
15,629 | base.lisp | pouar_yadfa/data/events/base.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-events"; coding: utf-8-unix; -*-
(in-package :yadfa-events)
(defevent get-diaper-locked-1)
| 146 | Common Lisp | .lisp | 3 | 47.666667 | 87 | 0.692308 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 9964cb09d26d2fcd53cd47f657a9ae098fa592d84000c5763337cc45c081db5f | 15,629 | [
-1
] |
15,630 | silver-cape.lisp | pouar_yadfa/data/events/silver-cape.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-events"; coding: utf-8-unix; -*-
(in-package :yadfa-events)
(defevent enter-silver-cape-1
:lambda (lambda (self)
(declare (ignore self))
(setf (getf (warp-points-of (get-zone '(0 0 0 yadfa-zones:secret-underground))) 'yadfa-zones:silver-cape) '(0 5 0 silver-cape))))
(defevent obtain-pirate-ship-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "You find a note attached to the ship" #\Newline #\Newline
"\"Beyond the dock you will find the Sea Of Parenthesis. A sea so perilous that it is nearly impossible to navigate without the right ship (or at least a pain in the ass). But fear not, here you will find a world famous ship called Emacs. It is the only ship in the game that can sail these perilous waters. Enjoy\"" #\Newline #\Newline)))
(defevent get-location-to-pirate-cove-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "You see a shark interrogating one of the diapered raccoon bandits sitting in a locked pillory" #\Newline #\Newline
"Shark: Tell us where the location of Pirate Cove is!!!" #\Newline #\Newline
"Diapered Raccoon: You'll never get me to talk!!!!" #\Newline #\Newline
"Shark: We'll see about that *turns on a water faucet*" #\Newline #\Newline
"*The raccoon starts squirming in place, trying to move his arms in a desperate attempt to hold the front of his diaper but can't and has to rely purely on will to hold it in, which is fading fast.*" #\Newline #\Newline
"Diapered Raccoon: OK!!! PIRATE's COVE IS AT (0 0 0 YADFA/ZONES:PIRATES-COVE) NOW PLEASE LET ME GO!!!! I HAVE TO GO TO THE BATHROOM!!!!!!" #\Newline #\Newline
"Shark: Who said anything about letting you go?" #\Newline #\Newline
"*The shark starts tickling the raccoon's feet*" #\Newline #\Newline
"Diapered Raccoon: NUUUUU!!!!!!! *laughs and floods his diapers, which is clearly obvious since the insignia on the front doubles as a wetness indicator that turns yellow when wet.*" #\Newline #\Newline
"Shark: There, now you can sit in it while we find that cove." #\Newline #\Newline
"Diapered Raccoon: Good luck. The cove is located in the middle of a sea of parenthesis, which you can't navigate without a copy of Emacs." #\Newline #\Newline
"Shark: NOOOO!!!! MY IBM PC XT CAN ONLY RUN VI!!!!!!!" #\Newline #\Newline
"*Pirate's Cove was added to the map for your ship*" #\Newline #\Newline)
(pushnew '(0 0 0 yadfa-zones:pirates-cove) (getf (attributes-of (getf (props-of (get-zone '(0 3 1 yadfa-zones:your-ship))) :controls)) :destinations))))
| 2,847 | Common Lisp | .lisp | 28 | 88.642857 | 358 | 0.646328 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | acb0fba7589915136e1c470656c7ed68af03cd477be08ac78968c15c02fb1b8b | 15,630 | [
-1
] |
15,631 | bandits-domain.lisp | pouar_yadfa/data/events/bandits-domain.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-events"; coding: utf-8-unix; -*-
(in-package :yadfa-events)
(defevent enter-bandits-village-1
:lambda (lambda (self)
(declare (ignore self))
(set-new-battle '((yadfa-enemies:diapered-raccoon-bandit . '(:level 5)))
:continuable t
:enter-battle-text (format nil "Raccoon Bandit: This area is under control of the Raccoon Bandits. If you want in you have to get past me~%*Cue battle transition. You can't see it because this is a text based game, but trust us, it's there.*~%"))))
(defevent enter-bandits-shop-1
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "Diapered Raccoon Bandit Shop Owner: Hey, we got a customer. Stop dancing around pulling on a locked bathroom door and help him out." #\Newline #\Newline
"Rookie Diapered Raccoon Bandit Servant: But I really gotta gooooo!!!!! *hops from foot to foot holding the front of his diaper*" #\Newline #\Newline
"*The shop owner walks over to the servant and starts tickling him*" #\Newline #\Newline
"Rookie Diapered Raccoon Bandit Servant: NOOOO!!! STOP!!!! I CAN'T HOLD IT!!!!" #\Newline #\Newline
"*The rookie starts laughing and thrashing about, the insignia that doubles as a wetness indicator on the front of his diaper then turns from blue to yellow.*" #\Newline #\Newline
"Shop Owner: There, you went, now go see to the customer." #\Newline #\Newline
"*The now blushy Rookie Diapered Raccoon Bandit waddles and squishes over to the back of the counter*" #\Newline #\Newline)))
(defevent enter-bandits-shop-3
:predicate (lambda (self)
(declare (ignore self))
(= (random 5) 0))
:finished-depends (list 'enter-bandits-shop-1)
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "*The shopkeeper hops around from foot to foot fiddling with the bathroom door with one paw while clutching the front of his diaper with the other*" #\Newline #\Newline
"Shopkeeper: I can't believe I lost the stupid key!!!!!" #\Newline #\Newline
"*The shopkeeper turns to you, pressing his knees together bobbing up and down with both paws pressed firmly on the front of his diaper*" #\Newline #\Newline
"Shopkeeper: HELP ME!!!!!" #\Newline #\Newline
"*" (name-of (player-of *game*)) " shrugs and tickles the shopkeeper*" #\Newline #\Newline
"Shopkeeper: NOOOO!!!!!! NOT WHAT I MEANT!!!!!" #\Newline #\Newline
"*The shopkeeper laughs and thrashes about and floods his diapers*"
(name-of (player-of *game*)) ": You're welcome" #\Newline #\Newline
"*The shopkeeper blushes heavily and grumbles*" #\Newline #\Newline)))
(defevent enter-bandits-shop-2
:predicate (lambda (self)
(declare (ignore self))
(= (random 5) 0))
:lambda (lambda (self)
(declare (ignore self))
(f:fmt t "*A diapered Raccoon is doing a potty dance outside the store in a full diaper squishing with every step*" #\Newline #\Newline
"Raccoon: LET ME IN!!!! I CAN'T HOLD IT MUCH LONGER!!!!" #\Newline #\Newline
"Shop Owner: Sorry leaky, you're not allowed in the shop since you leave puddles everywhere" #\Newline #\Newline
"Raccoon: I'M NOT LEAKY!!!! *blushes angrily*" #\Newline #\Newline
"*The raccoon has an accident and his diaper leaks and leaves puddles everywhere*" #\Newline #\Newline
"Shop Owner: Then explain the state of your diapers" #\Newline #\Newline
"*The raccoon blushes then starts to \\sout{waddle away with his legs spread apart} \"sneak away\" hoping no one will notice what he did \\sout{even though the trail he's leaving makes it obvious}*" #\Newline #\Newline
"*" (name-of (player-of *game*)) " laughs at the leaky raccoon*" #\Newline #\Newline
"Leaky raccoon blushing angrily: What are you laughing at?" #\Newline #\Newline)
(set-new-battle '((yadfa-enemies:diapered-raccoon-bandit . (list :level (random-from-range 2 5)
:wear (list
(make-instance 'yadfa-items:bandit-uniform-tunic)
(make-instance 'yadfa-items:bandit-adjustable-diaper :sogginess 1400
:messiness 8000)))))
:enter-battle-text (format nil "The leaky raccoon waddles over to you to fight~%"))))
(defevent decend-bandits-cave-1
:repeatable t
:lambda (lambda (self)
(declare (ignorable self))
(if (< (random 15) 1)
(progn
(format t "You found a treasure chest, use “(interact :chest :take :all)” to take all the treasure from it~%")
(setf (getf (get-props-from-zone '(6 24 -2 "bandits-domain")) :chest)
(make-instance 'prop
:name "Treasure Chest"
:description "A treasure chest"
:items (cond ((= (random 10) 0)
(list (make-instance 'yadfa-items:gold-collar
:value (random-from-range 25000 50000))))
((= (random 10) 0)
(list (make-instance 'yadfa-items:gold-pacifier
:value (random-from-range 10000 20000))))
((= (random 10) 0)
(list (make-instance 'yadfa-items:gem
:value (random-from-range 25000 50000))))
((= (random 20) 0)
(list (make-instance 'yadfa-items:gold-bar
:value (random-from-range 50000 100000)))))
:bitcoins (random-from-range 12500 25000))))
(remf (get-props-from-zone '(6 24 -2 "bandits-domain")) :chest))
(cond
((< (random 12) 1)
(set-new-battle '((yadfa-enemies:diapered-raccoon-bandit . (list
:level (random-from-range 2 5)
:bladder/contents (random-from-range 450 550)))
(yadfa-enemies:diapered-raccoon-bandit . (list
:level (random-from-range 2 5)
:bladder/contents (random 400)
:bowels/contents (random 5000))))
:enter-battle-text (format nil "Random Raccoon 1: Hey, I need to take a break. I really gotta go.~%~%Random Raccoon 2: Well you're gonna have to hold it, as we seem to have an intruder.~%~%Random Raccoon 1: But.. but... ooooohhhh *clutches the front of his diaper pressing his knees together*~%~%Time for battle!!!~%~%")))
((< (random 12) 1)
(format t "*~a hears grunting and looks to find one of the raccoons squatting down and messing his pamps. After finishing, he quickly stands up blushing heavily.*~%~%"
(name-of (player-of *game*)))
(f:fmt t "Diapered Raccoon Bandit: You didn't see nothing." #\Newline #\Newline
(name-of (player-of *game*)) ": Oh really? *" (name-of (player-of *game*)) " lifts up the back of the raccoon's tunic and press hard against the back of the raccoon's diaper hard.*" #\Newline #\Newline
"*The raccoon yelps and quickly puts his paws on the back of his diaper struggling to unmush it.*" #\Newline #\Newline)
(when (> (list-length (allies-of *game*)) 0)
(if (= (list-length (allies-of *game*)) 1)
(format t "*~a ~a*~%~%"
(name-of (nth 0 (allies-of *game*)))
(if (malep (nth 0 (allies-of *game*)))
"snickers"
"giggles"))
(f:fmt t "*Diapered Raccoon Bandit's team mates laugh*" #\Newline #\Newline)))
(f:fmt t "Diapered Raccoon Bandit: You're gonna pay for that!!!!" #\Newline #\Newline)
(if (< (random 2) 1)
(progn
(f:fmt t (name-of (player-of *game*)) ": I think it's you who are going to pay, unless you want me to blab to your friends telling them what you just did." #\Newline #\Newline
"*A soft hiss can be heard as the raccoon floods his diapers in a panic*" #\Newline #\Newline
"Diapered Raccoon Bandit: No please!!! I'll give you anything you want!!!" #\Newline #\Newline
(name-of (player-of *game*)) ": All your money and all your stuff" #\Newline #\Newline
"Diapered Raccoon Bandit: But... but... *groans* alright" #\Newline #\Newline
(name-of (player-of *game*)) " gets everything the raccoon is carrying except the clothes and diapers the raccoon is wearing. The raccoon then waddles off with his legs spread apart like a 5 year old who didn't make it to the toilet in time." #\Newline #\Newline)
(incf (bitcoins-of (player-of *game*)) (random-from-range 50000 100000))
(iter (for i from 0 to (random 5))
(push (make-instance 'yadfa-items:gold-bar) (inventory-of (player-of *game*))))
(iter (for i from 0 to (random 5))
(push (make-instance 'yadfa-items:gem) (inventory-of (player-of *game*))))
(iter (for i from 0 to (random 5))
(push (make-instance 'yadfa-items:bandit-uniform-tunic) (inventory-of (player-of *game*))))
(iter (for i from 0 to (random 20))
(push (make-instance 'yadfa-items:bandit-adjustable-diaper) (inventory-of (player-of *game*))))
(push (make-instance 'yadfa-items:bandit-swimsuit/closed) (inventory-of (player-of *game*))))
(set-new-battle '((yadfa-enemies:diapered-raccoon-bandit . (list :level (random-from-range 2 5)
:bowels/contents 0
:wear (list
(make-instance 'yadfa-items:bandit-uniform-tunic)
(make-instance 'yadfa-items:bandit-adjustable-diaper
:messiness 8000))))))))
((< (random 12) 1)
(set-new-battle '((yadfa-enemies:female-diapered-raccoon-bandit . (list :level (random-from-range 2 5))))))
((< (random 12) 1)
(set-new-battle '((yadfa-enemies:rookie-diapered-raccoon-bandit . (list :level (random-from-range 2 5))))))
((< (random 12) 1)
(set-new-battle '((yadfa-enemies:diapered-raccoon-bandit . (list :level (random-from-range 2 5))))))
((< (random 12) 1)
(set-new-battle '((yadfa-enemies:giant-diapered-raccoon-bandit . (list :level (random-from-range 5)))))))))
(defevent obtain-diaper-lock-1
:finished-depends '(enter-bandits-shop-1 get-diaper-locked-1)
:predicate (lambda (self)
(declare (ignorable self))
(and (lockedp (car (last (wear-of (player-of *game*))))) (>= (bitcoins-of (player-of *game*)) 10000)
(or (> (bladder/contents-of (player-of *game*)) (* (bladder/maximum-limit-of (player-of *game*)) 5/6))
(> (bowels/contents-of (player-of *game*)) (* (bowels/maximum-limit-of (player-of *game*)) 5/6)))
(destructuring-bind (&key (sogginess 0) (sogginess-capacity 0) (messiness 0) (messiness-capacity 0))
(calculate-diaper-usage (player-of *game*))
(declare (type real sogginess sogginess-capacity messiness messiness-capacity))
(and (< sogginess (/ sogginess-capacity 4))
(< messiness (/ messiness-capacity 4))))))
:lambda (lambda (self)
(declare (ignorable self))
(pushnew '(yadfa-items:magic-diaper-key . (list :value 10000))
(yadfa-props:items-for-sale-of (getf (get-props-from-zone '(-3 22 0 yadfa-zones:bandits-domain)) :shop)))
(f:fmt t "Shop owner: Seems you're stuck in a locked diaper. I can help." #\Newline #\Newline
(name-of (player-of *game*)) ": I'm listening" #\Newline #\Newline)
(format t "I got one of those special artifacts that is used to lock and unlock these diapers. I can give it to you for 10000 bitcoins. Better pay up before you ~a yourself~%~%"
(cond ((and (> (bladder/contents-of (player-of *game*)) (* (bladder/maximum-limit-of (player-of *game*)) 5/6))
(> (bowels/contents-of (player-of *game*)) (* (bowels/maximum-limit-of (player-of *game*)) 5/6)))
"flood and mess")
((> (bladder/contents-of (player-of *game*)) (* (bladder/maximum-limit-of (player-of *game*)) 5/6))
"flood")
((> (bowels/contents-of (player-of *game*)) (* (bowels/maximum-limit-of (player-of *game*)) 5/6))
"mess")))
(f:fmt t (name-of (player-of *game*)) ": Forget it!!! I don't need your help!!!" #\Newline #\Newline)
(format t "*~a starts to waddle out the door, stops, then ~a*~%~%"
(name-of (player-of *game*))
(if (>
(bladder/contents-of (player-of *game*))
(* (bladder/maximum-limit-of (player-of *game*)) 5/6))
(format nil "crosses ~a legs and clenches the front of ~a diaper"
(if (malep (player-of *game*)) "his" "her")
(if (malep (player-of *game*)) "his" "her"))
(format nil "grabs the back of ~a diaper while clenching ~a butt cheeks"
(if (malep (player-of *game*)) "his" "her")
(if (malep (player-of *game*)) "his" "her"))))
(f:fmt t (name-of (player-of *game*)) ": On second thought, GIVE ME THAT KEY!!!!" #\Newline #\Newline
"*" (name-of (player-of *game*)) " pays up*" #\Newline #\Newline
"Shop Owner: Thank you for your business, but before I hand you the key" #\Newline #\Newline)
(let ((a (cons (when (> (bladder/contents-of (player-of *game*)) (bladder/potty-dance-limit-of (player-of *game*)))
(wet))
(when (> (bowels/contents-of (player-of *game*)) (bowels/potty-dance-limit-of (player-of *game*)))
(mess)))))
(cond ((and (car a) (cdr a))
(f:fmt t "*The raccoon puts on earplugs, then turns on the speakers in the room which starts playing the brown note, then starts tickling " (name-of (player-of *game*)) "*" #\Newline #\Newline
(name-of (player-of *game*)) ": ACK!!! NO!!! STOP!!!" #\Newline #\Newline)
(format t "*~a starts squirming and giggling then wets and messes ~a diapers*~%~%"
(name-of (player-of *game*))
(if (malep (player-of *game*)) "his" "her")))
((car a)
(f:fmt t "*The raccoon starts tickling " (name-of (player-of *game*)) "*" #\Newline #\Newline
(name-of (player-of *game*)) ": ACK!!! NO!!! STOP!!!" #\Newline #\Newline)
(format t "*~a starts squirming and giggling then wets ~a diapers*~%~%"
(name-of (player-of *game*))
(if (malep (player-of *game*)) "his" "her")))
((cdr a)
(f:fmt t "*The raccoon puts on earplugs, then turns on the speakers in the room which starts playing the brown note" #\Newline #\Newline)
(format t "*~a quickly grabs the back of ~a diapers before messing ~aself*~%~%"
(name-of (player-of *game*))
(if (malep (player-of *game*)) "his" "her")
(if (malep (player-of *game*)) "his" "her"))))
(multiple-value-bind (value key)
(pop-from-expansion (player-of *game*) a)
(when (eq key :wet/mess)
(setf a value)))
(f:fmt t "*The raccoon starts laughing*" #\Newline #\Newline
"Shop Owner: That never gets old. Here's the key as promised, enjoy " (if (car a) "sog" "mush") "butt" #\Newline #\Newline)
(when (cdr a)
(f:fmt t "*The Rookie Raccoon waddles in*" #\Newline #\Newline
"Rookie Raccoon: I wish you wouldn't play that. You made me mess my diapers again" #\Newline #\Newline
"Shop Owner: Ha, you were gonna mess yourself anyway, so it's not like it matters." #\Newline #\Newline))
(f:fmt t "*After laughing his ass off, he suddenly stops and a soft hiss can be heard, the raccoon's face turns bright red and he quickly grabs the front of his diaper. The hissing continues for 10 seconds while everyone in the room stares at him while he floods his diapers.*" #\Newline #\Newline
"*" (name-of (player-of *game*)) " lifts up the raccoon's tunic and squishes the front of his diaper*" #\Newline #\Newline
(name-of (player-of *game*)) ": Seems you've had an accident too" #\Newline #\Newline
"Shop Owner: Shut up!!! *pulls his tunic back down while blushing bright red*" #\Newline #\Newline))))
(defevent enter-bandits-kennel-1
:lambda (lambda (self)
(declare (ignorable self))
(let ((a nil)
(b nil))
(f:fmt t "*You enter the kennel and in 2 of the cages you see 2 orange foxes in heavily used diapers.*" #\Newline #\Newline
"Vixen: Hey! someone has entered the kennel for once!!!" #\Newline #\Newline
"Fox: Could you let us out? We're the town's “pets” but they seemed to have forgotten about us." #\Newline #\Newline
"Fox: and while you're at it, could you give us... umm... you know.... *blushes heavily*" #\Newline #\Newline
(name-of (player-of *game*)) ": A diaper change?" #\Newline #\Newline
"*the fox nods with a blush on his face*" #\Newline #\Newline
(name-of (player-of *game*)) ": Fine, I'll be right back, don't go anywhere." #\Newline #\Newline
"*the 2 foxes sit down and waits, or in their case, crouches down and waits*" #\Newline #\Newline
"*as sitting in diapers in that state is out of the question" #\Newline #\Newline
"*" (name-of (player-of *game*)) " enters the Bandit's shop, find a whimpering Rookie Raccoon in a toddler's dress and messy diaper being bounced on shop owner's knee*" #\Newline #\Newline
"*At least you now know why this shop carries Toddler dresses, while they're distracted*" #\Newline #\Newline
"*You grab a couple of adjustable diapers and a gold collar for the fox and a toddler's dress*" #\Newline #\Newline
"*and a few of the much thicker diapers that the female raccoons wear for the vixen, you then head back to the kennel and dress the foxes and give them a diaper change*" #\Newline #\Newline
(name-of (player-of *game*)) ": I'm back, and got you some new clothes" #\Newline #\Newline
"Fox: Cool" #\Newline #\Newline
"Vixen: Yay" #\Newline #\Newline
"*the 2 wag their tails happily*" #\Newline #\Newline
(name-of (player-of *game*)) ": Mind telling me your names?" #\Newline #\Newline)
(finish-output)
(accept-with-effective-frame (clim:accepting-values (*query-io* :resynchronize-every-pass t :exit-boxes '((:exit "Accept")))
(fresh-line *query-io*)
(setf a (make-instance 'yadfa-allies:chris
:name (clim:accept 'string
:prompt "Fox Name"
:default (second
(assoc :name (progn
(c2mop:ensure-finalized
(find-class 'yadfa-allies:chris))
(c2mop:compute-default-initargs
(find-class 'yadfa-allies:chris)))))
:view clim:+text-field-view+
:stream *query-io*)))
(fresh-line *query-io*)
(setf b (make-instance 'yadfa-allies:kristy
:name (clim:accept 'string
:prompt "Vixen Name"
:default (second
(assoc :name (progn
(c2mop:ensure-finalized
(find-class 'yadfa-allies:kristy))
(c2mop:compute-default-initargs
(find-class 'yadfa-allies:kristy)))))
:view clim:+text-field-view+
:stream *query-io*)))))
(iter (for i in (list a b))
(do-push i (team-of *game*) (allies-of *game*)))
(f:fmt t "Fox: I'm " (name-of a) #\Newline #\Newline
"Vixen: And I'm " (name-of b) #\Newline #\Newline
(name-of a) ": What's yours?" #\Newline #\Newline
(name-of (player-of *game*)) ": I'm " (name-of (player-of *game*)) ". Now lets get you dressed" #\Newline #\Newline
"*" (name-of a) " puts the new clothes and diapers on the foxes*" #\Newline #\Newline))))
(defevent get-warp-pipe-summoner-1
:finished-depends '(enter-bandits-shop-1 enter-bandits-kennel-1)
:lambda (lambda (self)
(declare (ignorable self))
(f:fmt t "*You enter the shop to find the whimpering Rookie still in a toddler's dress thrashing around and bouncing up and down in a baby bouncer*" #\Newline #\Newline
"Shop Owner: The baby decided to flood his diapers while I was giving him knee bounces, so I decided to reward him with happy bouncy fun time in the baby bouncer" #\Newline #\Newline
"Rookie: You wouldn't let me go and I couldn't hold it any longer!!!!" #\Newline #\Newline
"Shop Owner: A likely story. Anyway, before you go, I'd like to show you something. It's based on a dream the creator of this game had." #\Newline #\Newline
"*The shop owner brings out a warp device and summons a warp pipe.*" #\Newline #\Newline
"Shop Owner: This warp pipe leads to the secret underground. In there is an infinite supply of several resources, a place where ABDLs can be themselves, and more warp pipes that let you warp just about anywhere in the game, though to avoid breaking the storyline, the creator of the game limited these warp pipes to the places you've already been" #\Newline #\Newline
(name-of (player-of *game*)) ": Why are you giving me this?" #\Newline #\Newline
"Shop Owner: Easy way to get back to this shop, so you can buy more crap from us." #\Newline #\Newline
(name-of (player-of *game*)) ": Ok *grabs the device and puts it in " (if (malep (player-of *game*)) "his" "her") " inventory*" #\Newline #\Newline)
(push (make-instance 'yadfa-items:warp-device) (inventory-of (player-of *game*)))
(setf (hiddenp (get-zone '(0 31 0 yadfa-zones:bandits-domain))) nil)))
(defevent shopkeeper-floods-himself-1)
| 27,563 | Common Lisp | .lisp | 286 | 64.566434 | 386 | 0.48425 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 870ab59357c94ab081627453d9241871b34f86f59c4a8d08d9f73221595f2437 | 15,631 | [
-1
] |
15,632 | abdl.lisp | pouar_yadfa/data/status-conditions/abdl.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-status-conditions"; coding: utf-8-unix; -*-
(in-package :yadfa-status-conditions)
(defclass wetting (status-condition)
()
(:default-initargs
:name "Wetting"
:description "User is currently wetting himself/herself"
:duration 1
:blocks-turn t))
(defmethod condition-script ((user base-character) (self wetting) (battle (eql t)))
(declare (ignore self))
(format t "~a is too busy wetting ~aself to fight~%" (name-of user) (if (malep user) "his" "her"))
(setf (bladder/contents-of user) 0))
(defclass messing (status-condition)
()
(:default-initargs
:name "Messing"
:description "User is currently messing himself/herself"
:duration 1
:blocks-turn t))
(defmethod condition-script ((user base-character) (self messing) (battle (eql t)))
(declare (ignore self))
(format t "~a is too busy messing ~aself to fight~%" (name-of user) (if (malep user) "his" "her"))
(setf (bowels/contents-of user) 0))
(defclass mushed (status-condition)
()
(:default-initargs
:name "Mushed"
:description "User's messy diaper has been mushed"
:duration t
:stat-multiplier (list :speed 1/2)
:blocks-turn t))
(defmethod condition-script ((user base-character) (status-condition mushed) (battle (eql t)))
(cond ((<= (getf (calculate-diaper-usage user) :messiness) 0)
(deletef-status-conditions status-condition user))
((< (random 4) 1)
(format t "~a is too busy grabbing the back of ~a diaper trying to unmush it to fight~%" (name-of user) (if (malep user) "his" "her"))
(setf (blocks-turn-of status-condition) t))
(t (setf (blocks-turn-of status-condition) nil))))
(defclass pantsed (status-condition)
()
(:default-initargs
:name "Pantsed"
:description "The user has been pantsed revealing his padding to the world"
:curable t))
(defclass laughing (status-condition)
()
(:default-initargs
:name "Laughing"
:description "User is laughing"
:duration 1
:blocks-turn t))
(defmethod condition-script ((user base-character) (self laughing) (battle (eql t)))
(declare (ignore self))
(format t "~a is too busy laughing to fight~%" (name-of user))
(when (or (>= (bladder/contents-of user) (bladder/potty-dance-limit-of user))
(and (>= (bladder/contents-of user) (bladder/need-to-potty-limit-of user)) (= 0 (random 5))))
(format t "~a~%"
(cond ((filter-items (wear-of user) 'diaper)
(format nil "~a starts wetting ~a diapers~%" (name-of user) (if (malep user) "his" "her")))
((filter-items (wear-of user) '(and pullup ab-clothing-mixin))
(format nil "The little pictures on the front of ~a's pullups start fading~%" (name-of user)))
((filter-items (wear-of user) 'pullup)
(format nil "~a starts wetting ~a pullons~%" (name-of user) (if (malep user) "his" "her")))
(t
(format nil "~a starts wetting ~aself~%" (name-of user) (if (malep user) "him" "her")))))
(set-status-condition 'wetting user)
(wet :wetter user)))
| 3,139 | Common Lisp | .lisp | 68 | 40.617647 | 143 | 0.649951 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 84ae6a2eb570810cc0b60733cdcf4ad3575ee4a9a79d012dc29f64a14867a62d | 15,632 | [
-1
] |
15,633 | pokemon.lisp | pouar_yadfa/data/status-conditions/pokemon.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-status-conditions"; coding: utf-8-unix; -*-
(in-package :yadfa-status-conditions)
(defclass poisoned (status-condition)
()
(:default-initargs
:name "Poisoned"
:description "User is currently poisoned"
:duration t))
(defmethod condition-script ((user base-character) (condition poisoned) (battle (eql t)))
(if (= 0 (random 5))
(progn (format t "~a is hurt by the poison~%" (name-of user))
(decf (health-of user) (/ (calculate-stat user :health))))
(deletef-status-conditions condition user)))
| 587 | Common Lisp | .lisp | 13 | 41.076923 | 98 | 0.6777 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5e1f5735022bf5ddf3773c019c1976b92e45f06ab39a3ada49aa4b1e8a68134b | 15,633 | [
-1
] |
15,634 | misc.lisp | pouar_yadfa/data/status-conditions/misc.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-status-conditions"; coding: utf-8-unix; -*-
(in-package :yadfa-status-conditions)
(defclass skunked (status-condition)
()
(:default-initargs
:name "Skunked"
:description "User's defenses are reduced due to the smell"
:duration 5
:accumulative 3
:stat-delta '(:defense -5)))
| 348 | Common Lisp | .lisp | 10 | 31.9 | 98 | 0.701183 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 02c1288fc5f3b0bf29b2375128fc8299e19ef1b0295f98f46fe6a8de90d4b439 | 15,634 | [
-1
] |
15,635 | regular.lisp | pouar_yadfa/data/moves/regular.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-moves"; coding: utf-8-unix; -*-
(in-package :yadfa-moves)
(defclass mush (move debuff) ()
(:default-initargs
:name "Mush"
:description "Mush the target's diaper"
:element-types '#.(coerce-element-types 'yadfa-element-types:abdl)))
(defmethod attack ((target base-character) (user base-character) (attack mush))
(declare (ignore attack))
(if (filter-items (wear-of user) 'incontinence-product)
(progn
(format t "~a mushes the back of ~a's diaper!~%" (name-of user) (name-of target))
(if (<= (getf (calculate-diaper-usage target) :messiness) 0)
(format t "But it had no effect!~%")
(progn (format t "~a's diaper has been mushed~%" (name-of target))
(set-status-condition 'yadfa-status-conditions:mushed target))))
(f:fmt t "it has no effect on " (name-of target) #\Newline)))
(defclass pants (move debuff) ()
(:default-initargs
:name "Pants"
:description "Pants the enemy"))
(s:defmethods pants (self)
(:method attack ((target base-character) (user base-character) self)
(declare (ignore self))
(format t "~a tries to pants ~a~%" (name-of user) (name-of target))
(format t "The attack has no effect on ~a~%" (name-of target)))
(:method attack ((target pantsable-character) (user base-character) self)
(declare (ignore self))
(let* ((pants (filter-items (wear-of target) '(or pants skirt dress)))
(stat
(when pants
(iter (for i in (wear-of target))
(when (typep i '(or diaper pullup))
(let ((severity (cond ((and (> (sogginess-of i) 300) (> (messiness-of i) 4000))
'both)
((> (messiness-of i) 4000)
'messy)
((> (sogginess-of i) 300)
'soggy)))
(padding i))
(leave `(padding ,padding severity ,severity)))))))
(old-condition (find 'yadfa-status-conditions:pantsed (status-conditions target)
:test (lambda (o e)
(typep e o)))))
(if stat
(progn
(cond ((filter-items pants '(or pants skirt))
(format t "~a pantses ~a~%"
(name-of user)
(name-of target)))
((filter-items pants 'dress)
(format t "~a raises ~a's ~a~%"
(name-of user)
(name-of target)
(name-of (car (filter-items pants 'dress))))))
(unless old-condition
(set-status-condition 'yadfa-status-conditions:pantsed target))
(format t "~a gets a horrified look on ~a face as ~a ~a is exposed to the world~%"
(name-of target)
(if (malep target) "his" "her")
(if (malep target) "his" "her")
(cond ((getf stat 'both)
(format nil "soggy mushy padding"))
((getf stat 'messy)
"messy padding")
((getf stat 'soggy)
"soggy padding")
(t "padding")))
(let ((audience (iter (for i in (if (typep target 'enemy)
(enemies-of *battle*)
(team-of *game*)))
(unless (eq target i)
(collect i)))))
(when audience
(format t (if (> (list-length audience) 1)
"~a's team mates start laughing at ~a~%"
"~a's team mate starts laughing at ~a~%")
(name-of target)
(if (malep target)
"him"
"her"))
(unless old-condition
(iter (for i in audience)
(set-status-condition 'yadfa-status-conditions:laughing i))))))
(progn
(format t "~a tries to pants ~a~%" (name-of user) (name-of target))
(format t "The attack has no effect on ~a~%" (name-of target)))))))
(defclass spray (move debuff) ()
(:default-initargs
:name "Spray"
:description "Spray the target with skunk spray. Also fills your pamps with skunk spray while you're at it."
:energy-cost 5
:element-types '#.(coerce-element-types 'yadfa-element-types:poison)))
(defmethod attack ((target base-character) (user base-character) (attack spray))
(format t "~a used ~a~%" (name-of user) (name-of attack))
(let ((amount 50))
(iter (while (> amount 0))
(for i in (reverse (wear-of user)))
(when (typep i 'closed-bottoms)
(cond ((> amount (- (sogginess-capacity-of i) (sogginess-of i)))
(decf amount (- (sogginess-capacity-of i) (sogginess-of i)))
(setf (sogginess-of i) (sogginess-capacity-of i)))
((> amount 0)
(incf (sogginess-of i) amount)
(setf amount 0))))))
(let ((clothing (filter-items (wear-of user) 'closed-bottoms)))
(cond
((filter-items clothing 'incontinence-product)
(format t "~a tries to spray the enemy, but ends up spraying in ~a pamps instead~%"
(name-of user)
(if (malep user) "his" "her")))
(clothing
(format t "~a tries to spray the enemy, but ends up spraying in ~a pants instead~%"
(name-of user)
(if (malep user) "his" "her")))
(t
(format t "~a sprays the enemy~%"
(name-of user)))))
(format t "~a is grossed out by the smell~%" (name-of target))
(set-status-condition 'yadfa-status-conditions:skunked target))
(defclass boop (move debuff) ()
(:default-initargs
:name "Boop"
:description "Boops da target on da snoot"
:energy-cost 5))
(s:defmethods boop (attack)
(:method attack ((target base-character) (user base-character) attack)
(let ((user-name (name-of user))
(target-name (name-of target)))
(f:fmt t target-name " blushes as " user-name " boops " target-name " on da snoot :3" #\Newline)))
(:method attack ((target yadfa-enemies:skunk-boop-mixin) (user base-character) attack)
(let* ((user-name (name-of user))
(target-name (name-of target))
(target-male-p (malep target)))
(f:fmt t target-name " blushes as " user-name " boops " target-name " on da snoot :3" #\Newline
target-name " immediately squats down and messes " (if target-male-p "his" "her") " pamps." #\Newline
"It's like a mess button." #\Newline)
(mess :force-fill-amount (bowels/maximum-limit-of target))
(set-status-condition 'yadfa-status-conditions:messing target))))
(defclass fire-breath (damage-move) ()
(:default-initargs
:name "Fire Breath"
:energy-cost 5
:power 60
:description "Breathes fire at the enemy"
:element-types '(#.(make-instance 'yadfa-element-types:fire))))
(defclass face-sit (mess-move-mixin damage-move debuff) ()
(:default-initargs
:name "Face Sit"
:energy-cost 3
:power 40
:description "Sits on the enemy's face and messes"
:element-types '#.(coerce-element-types '(yadfa-element-types:abdl yadfa-element-types:poison))))
(defmethod attack ((target base-character) (user base-character) (self face-sit))
(let* ((m (mess :messer user))
(c (calculate-diaper-usage user)))
(if (> (getf m :mess-amount) 0)
(format t "~a sits on ~a's face and messes~%" (name-of user) (name-of target))
(format t "~a sits on ~a's face~%" (name-of user) (name-of target)))
(when (>= (getf c :messiness) 2000)
(format t "~a is grossed out by the smell~%" (name-of target))
(set-status-condition 'yadfa-status-conditions:skunked target))
(format t "~a is damaged by the impact~%" (name-of target))))
(defclass teleporting-flood (wet-move-mixin) ()
(:default-initargs
:name "Teleporting Flood"
:description "Flood your diapers, but enchants the diaper so it all teleports into someone else's diaper."
:element-types '#.(coerce-element-types 'yadfa-element-types:abdl)))
(defmethod attack ((target base-character) (user base-character) (self teleporting-flood))
(if (< (bladder/contents-of user) (bladder/need-to-potty-limit-of user))
(format t "But it failed~%")
(progn (wet :wetter user :clothes (wear-of target))
(format t "~a gets a freaked expression on ~a face as ~a floods ~a's pamps~%" (name-of target) (if (malep target) "his" "her")
(name-of user) (name-of target)))))
(defclass teleporting-mess (mess-move-mixin) ()
(:default-initargs
:name "Teleporting Mess"
:description "Mess your diapers, but enchants the diaper so it all teleports into someone else's diaper."
:element-types '#.(coerce-element-types '(yadfa-element-types:abdl yadfa-element-types:poison))))
(defmethod attack ((target base-character) (user base-character) (self teleporting-mess))
(if (< (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
(format t "But it failed~%")
(progn (mess :messer user :clothes (wear-of target))
(format t "~a gets a freaked expression on ~a face as ~a messes ~a's pamps~%" (name-of target) (if (malep target) "his" "her")
(name-of user) (name-of target)))))
(defclass fart (mess-move-mixin debuff) ()
(:default-initargs
:name "fart"
:description "Grosses out the enemies with gas. If poisoned or if desperate, you may end up messing yourself instead."
:energy-cost 10
:element-types '#.(coerce-element-types '(yadfa-element-types:abdl yadfa-element-types:poison))))
(s:defmethods fart (attack)
(:method attack ((target base-character) (user base-character) attack)
(f:fmt t "But it failed." #\Newline))
(:method attack :around ((target base-character) (user bowels-character) attack)
(let* ((padding (get-babyish-padding user))
(name (name-of user))
(malep (malep user))
(his/her (if malep "his" "her"))
(he/she (if malep "he" "she"))
(himherself (if malep "himself" "herself")))
(f:fmt t name " squats down and tries to use " (name-of attack) #\Newline)
(flet ((fail ()
(f:fmt t name " grabs the back of " (case padding
(diaper (f:fmt nil his/her " diaper"))
(pullup (f:fmt nil his/her " pullups"))
(closed-bottoms (f:fmt nil his/her " pants"))
(t (f:fmt nil himherself)))
" with a bright red blush on " (if malep "his" "her") " face when " he/she " realized " he/she " just messed " himherself #\Newline)
(iter (for i in (if (typep user 'team-member)
(enemies-of *battle*)
(team-of *game*)))
(set-status-condition 'yadfa-status-conditions:laughing i)
(f:fmt* t (name-of i) " is laughing at " name #\Newline))))
(cond
((and (>= (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
(find 'yadfa-status-conditions:poisoned (status-conditions user)
:test (lambda (o e)
(typep e o))))
(mess :messer user)
(f:fmt t "*SPLORCH*" #\Newline)
(fail))
(t (let ((result (fart user)))
(case result
(:cant-go (f:fmt t "Nothing happened" #\Newline))
(:success
(f:fmt t "FRRRT" #\Newline
(name-of user) " sighs with relief" #\Newline)
(iter (for i in (if (typep user 'team-member)
(enemies-of *battle*)
(team-of *game*)))
(set-status-condition 'yadfa-status-conditions:skunked i)
(f:fmt* t (name-of i) " is grossed out by the smell" #\Newline)))
(:fail (fail))))))))))
(defclass spank (damage-move) ()
(:default-initargs
:name "Spank"
:energy-cost 5
:power 10
:description "Spanks the enemy"))
(defmethod attack :around ((target base-character) (user base-character) (self spank))
(let ((a (calculate-damage target user self))
(times (random 10)))
(f:fmt t
(name-of user) " bends " (name-of target) " over " (if (malep user) "his" "her") " knee and gives " (name-of target) " a spanking" #\Newline
(:times "whap " times) #\Newline
"Hit " times " times" #\Newline)
(decf (health-of target) (* a times))
a))
| 13,168 | Common Lisp | .lisp | 249 | 40.124498 | 154 | 0.54981 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 71c35355b18e87536c52a4149555d4153787b4c809d9dd418fec1fd06e2138f0 | 15,635 | [
-1
] |
15,636 | haunted.lisp | pouar_yadfa/data/moves/haunted.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-moves"; coding: utf-8-unix; -*-
(in-package :yadfa-moves)
(defclass ghost-tickle (tickle) ()
(:default-initargs
:name "Ghost Tickle"))
(defmethod attack ((target base-character) (user base-character) (attack ghost-tickle))
(if (getf (attributes-of target) :not-ticklish)
(write-line "It has no effect")
(progn (f:fmt t "A bunch of ghost hands come out and start tickling " (name-of target) #\Newline)
(set-status-condition 'yadfa-status-conditions:laughing target))))
(defclass ghost-squish (move debuff) ()
(:default-initargs
:name "Ghost Tickle"
:description "Tickle the enemy"))
(defmethod attack ((target base-character) (user base-character) (attack ghost-squish))
(if (filter-items (wear-of user) 'incontinence-product)
(progn
(format t "a ghost hand comes out and squishes ~a's diaper!~%" (name-of target))
(if (<= (getf (calculate-diaper-usage target) :sogginess) 0)
(format t "But it had no effect!~%")))
(f:fmt t "it has no effect on " (name-of target) #\Newline)))
(defclass ghost-mush (mush) ()
(:default-initargs
:name "Ghost Mush"))
(defmethod attack ((target base-character) (user base-character) (attack ghost-mush))
(declare (ignore attack))
(if (filter-items (wear-of user) 'incontinence-product)
(progn
(format t "a ghost hand comes out and mushes the back of ~a's diaper!~%" (name-of target))
(if (<= (getf (calculate-diaper-usage target) :messiness) 0)
(format t "But it had no effect!~%")
(progn (format t "~a's diaper has been mushed~%" (name-of target))
(set-status-condition 'yadfa-status-conditions:mushed target))))
(f:fmt t "it has no effect on " (name-of target) #\Newline)))
| 1,822 | Common Lisp | .lisp | 34 | 47.823529 | 103 | 0.659396 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 0d3f59a47cc4705709d6f3074a1650da93ff2a11048d5717172e549cc65cad24 | 15,636 | [
-1
] |
15,637 | pokemon.lisp | pouar_yadfa/data/moves/pokemon.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-moves"; coding: utf-8-unix; -*-
(in-package :yadfa-moves)
(defclass superglitch (damage-move) ()
(:default-initargs
:name "Superglitch"
:description "Classic glitch move from the Pokémon games, but without the undefined behavior and unwanted side effects."))
(defmethod attack :around ((target base-character) (user base-character) (attack superglitch)
&aux (name (name-of user)))
(declare (ignore attack))
(format t
"TMTRAINER ~a is frozen solid~%TMTRAINER ~a is hurt by the burn~%"
name
name)
(setf (health-of target) 0))
(defclass watersport (wet-move-mixin) ()
(:default-initargs
:name "Watersport"
:description "Soak your diapers"
:element-types '#.(coerce-element-types 'yadfa-element-types:abdl)))
(defmethod attack ((target base-character) (user base-character) (attack watersport)
&aux (name (name-of user)))
(declare (ignore target))
(if (< (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
(format t "But it failed~%")
(progn (wet :wetter user)
(format t "~a wet ~a~%" name (if (malep user) "himself" "herself")))))
(defclass mudsport (mess-move-mixin) ()
(:default-initargs
:name "Mudsport"
:description "mess your diapers"
:element-types '#.(coerce-element-types 'yadfa-element-types:abdl)))
(defmethod attack ((target base-character) (user base-character) (attack mudsport)
&aux (name (name-of user)))
(declare (ignore target))
(if (< (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
(format t "But it failed~%")
(progn (mess :messer user)
(format t "~a messed ~a~%"
name
(if (malep user) "himself" "herself")))))
(defclass mudbomb (mess-move-mixin debuff) ()
(:default-initargs
:name "Mud Bomb"
:description "massively mess your diapers, never fails"
:energy-cost 5
:element-types '#.(coerce-element-types '(yadfa-element-types:abdl yadfa-element-types:poison))))
(s:defmethods mudbomb (attack)
(:method attack ((target base-character) (user base-character) attack)
(write-line "But it failed."))
(:method attack ((target base-character) (user bowels-character) attack
&aux (bowels/fill-rate (* 30 24 (bowels/fill-rate-of user))) (bowels/maximum-limit (bowels/maximum-limit-of user))
(name (name-of user)))
(mess :force-fill-amount (if (< bowels/fill-rate bowels/maximum-limit) bowels/maximum-limit bowels/fill-rate) :messer user)
(format t "~a messed ~a massively~%"
name
(if (malep user) "himself" "herself"))
(iter (for i in (if (typep user 'team-member)
(enemies-of *battle*)
(team-of *game*)))
(set-status-condition 'yadfa-status-conditions:skunked i)
(format t "~a is grossed out by the smell~%" (name-of i)))))
(defclass tickle (move debuff) ()
(:default-initargs
:name "Tickle"
:description "Tickle the enemy"))
(defmethod attack ((target base-character) (user base-character) (attack tickle))
(if (getf (attributes-of target) :not-ticklish)
(write-line "It has no effect")
(progn (format t "~a starts laughing helplessly~%" (name-of target))
(set-status-condition 'yadfa-status-conditions:laughing target))))
(defclass tackle (damage-move) ()
(:default-initargs
:name "Tackle"
:description "Tackles the enemy"
:element-types '#.(coerce-element-types 'yadfa-element-types:normal)))
(defclass roar (move debuff) ()
(:default-initargs
:name "Roar"
:energy-cost 2
:description "Scares enemies into flooding themselves"))
(defmethod attack ((target base-character) (user base-character) (attack roar))
(declare (ignore target))
(unless (iter (for i in (if (typep user 'team-member)
(enemies-of *battle*)
(team-of *game*)))
(with j = nil)
(when (>= (bladder/contents-of i) (bladder/need-to-potty-limit-of i))
(format t "~a jumps and wets ~aself~%" (name-of i) (if (malep i) "him" "her"))
(wet :wetter i)
(set-status-condition 'yadfa-status-conditions:wetting i)
(setf j t))
(finally (return j)))
(write-line "it had no effect")))
(defclass bite (damage-move) ()
(:default-initargs
:name "Bite"
:description "Bites the enemy"
:power 80
:element-types '#.(coerce-element-types 'yadfa-element-types:dark)))
(defclass scratch (damage-move) ()
(:default-initargs
:name "Scratch"
:description "Scratches the enemy"
:power 40))
| 4,758 | Common Lisp | .lisp | 104 | 38.653846 | 133 | 0.636872 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | cd239ccf397ad8b2532e121c7c8ad875ea904aedf088b6943663e1c430927ae9 | 15,637 | [
-1
] |
15,638 | dbz.lisp | pouar_yadfa/data/moves/dbz.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-moves"; coding: utf-8-unix; -*-
(in-package :yadfa-moves)
(defclass kamehameha (damage-move) ()
(:default-initargs
:name "Kamehameha Wave"
:description "Say “Kamehameha!!!” and fire a huge burst of energy"
:energy-cost 12
:power 200))
(defmethod attack ((target base-character) (user base-character) (attack kamehameha))
(format t "KAM-E-HAM-E-HA!!! *loud energy blast noise*~%OK, not as dramatic in a text based game~%"))
| 498 | Common Lisp | .lisp | 10 | 46.8 | 103 | 0.698347 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 7a1d5227f9765fe2f9c7162ac5690d2b9f90ed2afbb1544319c8e9b3a6d0f745 | 15,638 | [
-1
] |
15,639 | base.lisp | pouar_yadfa/data/props/base.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-props"; coding: utf-8-unix; -*-
(in-package :yadfa-props)
(defun change-the-baby (user &rest new-diaper)
(let ((b (apply #'make-instance new-diaper)))
(iter (for clothes on (wear-of user))
(when (typep (car clothes) 'bottoms)
(handler-case (toggle-onesie (car clothes) clothes user)
(onesie-locked (c)
(setf (lockedp (car (clothes-of c))) nil)
(toggle-onesie (car (clothes-of c)) (clothes-of c) (user-of c))))))
(setf (inventory-of (player-of *game*)) (append (inventory-of (player-of *game*)) (filter-items (wear-of user) 'closed-bottoms))
(wear-of user) (remove-if (lambda (a)
(typep a 'closed-bottoms))
(wear-of user)))
(if (wear-of user)
(push b (cdr (last (wear-of user))))
(push b (wear-of user)))
(iter (for clothes on (wear-of user))
(let ((nth (car clothes))
(nthcdr (cdr clothes)))
(when (or (and (typep nth 'bottoms) (thickness-capacity-of nth) nthcdr
(> (total-thickness nthcdr) (thickness-capacity-of nth)))
(and (typep nth 'closed-bottoms)
(or (>= (sogginess-of nth) (/ (sogginess-capacity-of nth) 4))
(>= (messiness-of nth) (/ (messiness-capacity-of nth) 4)))))
(push nth (inventory-of (player-of *game*)))
(setf (wear-of user) (s:delq nth (wear-of user))))))))
(defclass toilet (prop) ()
(:default-initargs
:name "Toilet"
:description "A toilet"
:actions (list :use (make-action
:documentation "Use the toilet. if WET or MESS is T, the player will empty his bladder/bowels completely. If a real is given, the player will empty his bladder by that amount, however the player will mess completely no matter what number you give it if you provide a number. If ALLY number is specified, that ALLY uses the toilet, otherwise it's the player"
:lambda '(lambda (prop &rest keys &key wet mess pull-pants-down ally &allow-other-keys)
(declare #+sbcl (type prop prop)
#+sbcl (type boolean pull-pants-down)
#+sbcl (type (or integer null) ally)
#+sbcl (type (or boolean real) wet mess)
(ignore keys))
#-sbcl (check-type prop prop)
#-sbcl (check-type pull-pants-down boolean)
#-sbcl (check-type ally (or integer null))
#-sbcl (check-type wet (or boolean real))
#-sbcl (check-type mess (or boolean real))
(block nil
(when (and ally (>= ally (list-length (allies-of *game*))))
(format t "That ally doesn't exist~%")
(return))
(yadfa::potty-on-toilet prop
:wet wet
:mess mess
:pants-down pull-pants-down
:user (if ally
(nth ally (allies-of *game*))
(player-of *game*))))))))
(:documentation "Class for toilets. I'm pretty sure I don't need to tell you what these are for."))
(defclass placable-toilet (placable-prop toilet) ())
(defmethod cant-use-p ((item placable-toilet) (user base-character) (target base-character) action &key &allow-other-keys)
(values t (if *battle*
'(:format-control "That can't be used in a battle")
'(:format-control #.(f:fmt nil "YOU CAN'T USE DA POTTY HERE!!! THERE ARE LIKE, PEOPLE HERE!!!!!~%"
"You're just going to have to hold it until you find an appropriate place to put it~%"
"or you can just wet and/or mess your pamps like the bab you are.~%")))))
(defclass washer (prop) ()
(:default-initargs
:name "Washer"
:description "A place to clean your reusable diapers and all the clothes you've ruined"
:actions (list :use (make-action
:documentation "Wash your clothes in this"
:lambda '(lambda
(prop &rest keys &key &allow-other-keys)
(declare #+sbcl (type prop prop) (ignore keys))
#-sbcl (check-type prop prop)
(yadfa-world:wash-all-in prop)))))
(:documentation "Class for washers, you can wash your diapers and all the clothes you've ruined in these."))
(defclass placable-washer (placable-prop washer)
())
(defclass automatic-changing-table (prop) ()
(:default-initargs
:name "Automatic Changing Table"
:description "A changing table that automatically changes you"
:actions (list :use (make-action
:documentation "Turn it on"
:lambda '(lambda (prop &rest keys &key &allow-other-keys)
(declare #+sbcl (type prop prop)
(ignore keys))
#-sbcl (check-type prop prop)
(iter (for j in (append (list (player-of *game*)) (allies-of *game*)))
(let ((a (calculate-diaper-usage j)))
(when (and
(or
(>=
(getf a :sogginess)
(/ (getf a :sogginess-capacity) 4))
(>=
(getf a :messiness)
(/ (getf a :messiness-capacity) 4)))
(filter-items (wear-of j) 'closed-bottoms))
(format t "Mechanical arms come out of the changing table and strap ~a down on the table to prevent ~a from escaping and proceeds to change ~a~%~%"
(name-of j)
(if (malep j) "him" "her")
(if (malep j) "him" "her"))
(if (filter-items (wear-of j) 'padding)
(progn
(format t "~a: Hey!!! Don't change me here!!! People can see me!!! Stop!!!~%~%"
(name-of j)))
(progn
(format t "~a: Hey!!! I don't need diapers!!! Stop!!!~%~%"
(name-of j))))
(change-the-baby j 'yadfa-items:kurikia-thick-diaper :locked t)
(format t "*The machine removes ~a's soggy clothing (and any clothing that doesn't fit over the new diaper) and puts a thick diaper on ~a, then locks it to prevent the baby from removing it.*~%~%"
(name-of j)
(if (malep j) "him" "her"))
(format t "*The machine unstraps ~a from the table and lets ~a go. The diaper is so thick ~a's legs are spread apart forcing ~a to waddle*~%~%"
(name-of j)
(if (malep j) "him" "her")
(name-of j)
(if (malep j) "him" "her"))
(when (trigger-event 'yadfa-events:get-diaper-locked-1)
(format t "*~a tugs at the tabs trying to remove them, but they won't budge. Better find a solution before its too late*~%~%" (name-of j))))))))))
(:documentation "Class for washers, you can wash your diapers and all the clothes you've ruined in these."))
(defclass checkpoint (prop) ()
(:default-initargs
:name "Checkpoint"
:description "You can use this to set this zone as a checkpoint so when you lose a battle, you'll warp to here rather than at the beginning of the game"
:actions (list :set-checkpoint (make-action :documentation "Set checkpoint"
:lambda '(lambda (prop &rest keys &key &allow-other-keys)
(declare
#+sbcl (type prop prop)
(ignore keys prop))
#-sbcl (check-type prop prop)
(setf (warp-on-death-point-of (player-of *game*)) (position-of (player-of *game*)))
(format t "You will now teleport here when you black out")))))
(:documentation "Class for washers, you can wash your diapers and all the clothes you've ruined in these."))
(defclass shop (prop)
((items-for-sale%
:initarg items-for-sale
:initform ()
:accessor items-for-sale-of
:type list
:documentation "Quoted list of class names for sale"))
(:default-initargs
:name "Shop"
:description "A place to buy crap with your bitcoins")
(:documentation "Class for shops, you can buy stuff from these."))
(defmethod initialize-instance :after
((c shop) &key &allow-other-keys)
(setf (getf (actions-of c) :list-items-for-sale)
(make-action :documentation "List items for sale"
:lambda '(lambda (prop &rest keys &key &allow-other-keys)
(declare #+sbcl (type prop prop)
(ignore keys))
#-sbcl (check-type prop prop)
(shopfun (items-for-sale-of prop) :format-items t)))
(getf (actions-of c) :buy-items)
(make-action :documentation "Buy items. ITEMS is a list of conses where each cons is in the form of (INDEX-OF-ITEM-TO-BUY . QUANTITY-OF-ITEMS-TO-BUY). If ITEMS is not specified, you will be prompted for what items to buy"
:lambda '(lambda (prop &rest keys &key items &allow-other-keys)
(declare #+sbcl (type prop prop) #+sbcl (type list items) (ignore keys))
#-sbcl (check-type prop prop)
#-sbcl (check-type items list)
(shopfun (items-for-sale-of prop)
:items-to-buy (or items t)
:user (player-of *game*))))
(getf (actions-of c) :sell-items)
(make-action :documentation "Sell items. ITEMS is a list of indexes where each index corresponds to an item in your inventory. If ITEMS is not specified, you will be prompted for what items to sell"
:lambda '(lambda (prop &rest keys &key items &allow-other-keys)
(declare #+sbcl (type prop prop) #+sbcl (type list items) (ignore keys))
#-sbcl (check-type prop prop)
#-sbcl (check-type items list)
(shopfun (items-for-sale-of prop)
:items-to-sell (or items t)
:user (player-of *game*))))))
(defclass vending-machine (prop)
((items-for-sale%
:initarg items-for-sale
:initform ()
:accessor items-for-sale-of
:type list
:documentation "Quoted list of class names for sale"))
(:default-initargs
:name "Vending Machine"
:description "An automated machine where you can buy items from")
(:documentation "Class for vending machines, Functions like a shop, but only lets you buy items instead of selling them"))
(defmethod initialize-instance :after
((c vending-machine) &key &allow-other-keys)
(setf (getf (actions-of c) :list-items-for-sale)
(make-action :documentation "List items for sale"
:lambda '(lambda (prop &rest keys &key &allow-other-keys)
(declare #+sbcl (type prop prop)
(ignore keys))
#-sbcl (check-type prop prop)
(shopfun (items-for-sale-of prop) :format-items t)))
(getf (actions-of c) :buy-items)
(make-action :documentation "Buy items. ITEMS is a list of conses where each cons is in the form of (INDEX-OF-ITEM-TO-BUY . QUANTITY-OF-ITEMS-TO-BUY)"
:lambda '(lambda (prop &rest keys &key items &allow-other-keys)
(declare #+sbcl (type prop prop)
#+sbcl (type list items)
(ignore keys))
#-sbcl (check-type prop prop)
#-sbcl (check-type items list)
(shopfun (items-for-sale-of prop)
:items-to-buy items
:user (player-of *game*))))))
(defclass debug-shop (prop) ()
(:default-initargs
:name "Shop"
:description "A place to buy crap with your bitcoins")
(:documentation "Class for shops, you can buy stuff from these."))
(defmethod initialize-instance :after
((c debug-shop) &key &allow-other-keys)
(setf (getf (actions-of c) :list-items-for-sale)
(make-action :documentation "List items for sale"
:lambda '(lambda (prop &rest keys &key &allow-other-keys)
(declare #+sbcl (type prop prop)
(ignore keys)
(ignorable prop))
#-sbcl (check-type prop prop)
(shopfun (let ((a ()))
(iter (for i in (list-all-packages))
(unless (equal i (find-package :yadfa))
(do-external-symbols (s i)
(when (and
(find-class s nil)
(c2mop:subclassp
(find-class s)
(find-class 'item))
(tossablep (make-instance s)))
(push (cons s nil) a)))))
a)
:format-items t)))
(getf (actions-of c) :buy-items)
(make-action :documentation "Buy items. ITEMS is a list of conses where each cons is in the form of (INDEX-OF-ITEM-TO-BUY . QUANTITY-OF-ITEMS-TO-BUY)"
:lambda '(lambda (prop &rest keys &key items &allow-other-keys)
(declare #+sbcl (type prop prop)
#+sbcl (type list items)
(ignore keys)
(ignorable prop))
#-sbcl (check-type prop prop)
#-sbcl (check-type items list)
(shopfun
(let ((a ()))
(iter (for i in (list-all-packages))
(unless
(equal i (find-package :yadfa))
(do-external-symbols (s i)
(when (and
(find-class s nil)
(c2mop:subclassp
(find-class s)
(find-class 'item))
(tossablep (make-instance s)))
(push (cons s nil) a)))))
a)
:items-to-buy items
:user (player-of *game*))))
(getf (actions-of c) :sell-items)
(make-action :documentation "Sell items. ITEMS is a list of indexes where each index corresponds to an item in your inventory"
:lambda '(lambda (prop &rest keys &key items &allow-other-keys)
(declare #+sbcl (type prop prop)
#+sbcl (type list items)
(ignore keys)
(ignorable prop))
#-sbcl (check-type prop prop)
#-sbcl (check-type items list)
(shopfun
(let ((a ()))
(iter
(for i in (list-all-packages))
(unless (equal i (find-package :yadfa))
(do-external-symbols (s i)
(when (and
(find-class s nil)
(c2mop:subclassp
(find-class s)
(find-class 'item))
(tossablep (make-instance s)))
(push (cons s nil) a)))))
a)
:items-to-sell items
:user (player-of *game*))))))
(defclass bed (prop) ()
(:default-initargs
:name "Bed"
:description "A place to sleep and recover. Be sure to go potty so you don't wet it."
:actions (list :sleep (make-action :documentation "Sleep in this bed and recover your health and energy. Be sure to go potty before you go to bed so you don't wet it"
:lambda '(lambda (prop &rest keys &key &allow-other-keys)
(declare #+sbcl (type prop prop)
(ignore keys)
(ignorable prop))
#-sbcl (check-type prop prop)
(go-to-sleep)))))
(:documentation "Class for beds, you can sleep in these."))
(defclass placable-bed (placable-prop bed) ())
| 19,688 | Common Lisp | .lisp | 293 | 40.010239 | 381 | 0.438103 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 21d2d58acd505ba5dbb1e153e0ff56d6222ba61eedcbf41098e320f3b0067a43 | 15,639 | [
-1
] |
15,640 | washers.lisp | pouar_yadfa/data/props/props/washers.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-props"; coding: utf-8-unix; -*-
(in-package :yadfa-props)
| 113 | Common Lisp | .lisp | 2 | 55.5 | 86 | 0.657658 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 89e718ba96082f32fe2d0365935b10ca6f21d950810c2ccfae894b5b8a906657 | 15,640 | [
-1
] |
15,641 | beds.lisp | pouar_yadfa/data/props/props/beds.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-props"; coding: utf-8-unix; -*-
(in-package :yadfa-props)
(defclass pet-bed (placable-bed) ()
(:default-initargs :name "Pet Bed"
:description "A portable pet bed big enough for you to sleep in"))
(defmethod use-script ((item pet-bed) (user base-character) (target team-member))
(go-to-sleep))
(defmethod cant-use-p ((item pet-bed) (user base-character) (target base-character) action &key &allow-other-keys)
(when *battle*
(values t '(:format-control "that item can't be used in battle"))))
(defclass crib (placable-bed) ()
(:default-initargs :name "Crib"
:description "A crib big enough for you to sleep in"))
| 720 | Common Lisp | .lisp | 13 | 50.230769 | 114 | 0.666195 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 50b875dd52a7ccb3d91f69eb6e949c4fd2ae3d3f05dffb4c5fdb6bde2de6c3e0 | 15,641 | [
-1
] |
15,642 | toilets.lisp | pouar_yadfa/data/props/props/toilets.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-props"; coding: utf-8-unix; -*-
(in-package :yadfa-props)
(defclass training-potty (placable-toilet) ()
(:default-initargs :name "Training Potty"
:description "A training potty"))
| 258 | Common Lisp | .lisp | 5 | 46 | 86 | 0.652174 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 112ecd42b7106286d952a47be7534ef7ae110222ccdff22a6ab666b594e8bfa2 | 15,642 | [
-1
] |
15,643 | allies.lisp | pouar_yadfa/data/team-members/allies.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-allies"; coding: utf-8-unix; -*-
(in-package :yadfa-allies)
(defclass slynk (playable-ally ally-last-minute-potty-training pantsable-character) ()
(:default-initargs
:name "Slynk"
:male t
:wear (let ((diaper (progn (c2mop:ensure-finalized (find-class 'yadfa-items:bandit-adjustable-diaper))
(c2mop:compute-default-initargs (find-class 'yadfa-items:bandit-adjustable-diaper)))))
(list (make-instance 'yadfa-items:bandit-uniform-tunic)
(make-instance 'yadfa-items:thick-rubber-diaper)
(make-instance 'yadfa-items:bandit-adjustable-diaper
:sogginess (second (assoc :sogginess-capacity diaper))
:messiness (second (assoc :messiness-capacity diaper)))))
:moves (loop for i in '(yadfa-moves:watersport yadfa-moves:mudsport yadfa-moves:tickle yadfa-moves:mush yadfa-moves:fart)
collect (make-instance i))
:species "Raccoon"
:tail '(:medium :fur)
:skin '(:fur)
:description "Used to be one of the Diapered Raccoon Bandits. Was kicked out after he was forced to give the location of Pirate's Cove to the Navy. He was humiliated constantly by the Diapered Pirates until you rescued him. Is too embarrassed to admit when he as to go unless he's desperate"
:level 5))
(s:defmethods slynk (user)
(:method fart-result-text (user (result (eql :failure)) mess &key (stream *standard-output*))
(if (and (getf mess :leak-amount) (> (getf mess :leak-amount) 0))
(f:fmt stream (name-of user) " gets a look of horror on " (if (malep user) "his" "her") " face as "
(if (malep user) "he" "she") " ends up messing " (if (malep user) "himself" "herself")
" and has a blowout" #\Newline)
(f:fmt stream (name-of user) " tries to fart to relieve the pressure but ends up messing " (if (malep user) "his" "her")
" pamps, doesn't seem to realize it wasn't a fart and just continues on in a messy diaper" #\Newline)))
(:method initialize-instance :after
(user &key (bladder/contents nil bladderp) (bowels/contents nil bowelsp) &allow-other-keys)
(declare (ignore bladder/contents bowels/contents))
(unless bladderp
(setf (bladder/contents-of user)
(random (coerce (+ (bladder/potty-desperate-limit-of user)
(/ (- (bladder/potty-desperate-limit-of user) (bladder/potty-dance-limit-of user))))
'long-float))))
(unless bowelsp
(setf (bowels/contents-of user)
(random (coerce (+ (bowels/potty-desperate-limit-of user)
(/ (- (bowels/potty-desperate-limit-of user) (bowels/potty-dance-limit-of user))))
'long-float))))))
(defclass chris (playable-ally ally-rebel-potty-training) ()
(:default-initargs
:name "Chris"
:male t
:species "Fox"
:tail '(:medium :fur)
:skin '(:fur)
:description "An orange fox. has gotten accustomed to being treated like a pet and will typically wear nothing but a collar, refuses to be housebroken like a good fox so he must be diapered at all times."
:wear (loop for i in '(yadfa-items:gold-collar yadfa-items:bandit-diaper)
collect (make-instance i))))
(defclass kristy (playable-ally ally-no-potty-training pantsable-character) ()
(:default-initargs
:name "Kristy"
:male nil
:species "Fox"
:tail '(:medium :fur)
:skin '(:fur)
:description "A beautiful orange vixen who has a personality that is more like a child than an adult. Loves wearing thick diapers, can't stand pants. Has gone without diapers for so long that she has become dependent on them."
:wear (loop for i in '(yadfa-items:toddler-dress yadfa-items:bandit-female-diaper)
collect (make-instance i))))
(defclass furry (playable-ally ally-silent-potty-training pantsable-character) ()
(:default-initargs
:name "Furry"
:male t
:species "Fox"
:tail '(:medium :fur)
:skin '(:fur)
:description "A fox that likes to wear a fursuit. Doesn't talk much. The team got him as a pet, and as a plushie."
:wear (loop for i in '(yadfa-items:watertight-fursuit yadfa-items:kurikia-thick-cloth-diaper)
collect (make-instance i))))
| 4,364 | Common Lisp | .lisp | 71 | 52.873239 | 294 | 0.658048 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | d29eb93ba4d75ec04686ade571c33cf4e5b02442de39ba920398e37ab199b038 | 15,643 | [
-1
] |
15,644 | catchables.lisp | pouar_yadfa/data/team-members/catchables.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-allies"; coding: utf-8-unix; -*-
(in-package :yadfa-allies)
(defclass raptor (adopted-enemy ally-feral) ()
(:default-initargs
:name "Raptor"
:malep (a:random-elt '(t nil))
:description "Biologically inaccurate velociraptor. The kind you see in Jurassic Park that looks more like a lizard than a prehistoric bird."
:moves (list (make-instance 'yadfa-moves:roar)
(make-instance 'yadfa-moves:bite)
(make-instance 'yadfa-moves:watersport)
(make-instance 'yadfa-moves:mudsport))
:wear (list (make-instance 'yadfa-items:diaper))))
(defclass diapered-kobold (adopted-enemy ally-silent-potty-training pantsable-character) ()
(:default-initargs
:name "Diapered Kobold"
:description "They're apparently from a tribe of kobolds in the area. Their outfits are similar to the ancient Egyptians."
:species "Kobold"
:male (a:random-elt '(t nil))
:bladder/contents (random 500)
:bowels/contents (random 700)
:inventory (iter (for i from 0 to (random 10))
(collect (make-instance 'yadfa-items:cloth-diaper)))
:moves (list (make-instance 'yadfa-moves:watersport)
(make-instance 'yadfa-moves:mudsport))))
(defmethod initialize-instance :after
((c diapered-kobold) &key (wear nil wearp) &allow-other-keys)
(declare (ignore wear))
(unless wearp
(push (let ((a (make-instance 'yadfa-items:thick-cloth-diaper)))
(setf (sogginess-of a) (random (sogginess-capacity-of a)))
(setf (messiness-of a) (random (messiness-capacity-of a)))
a)
(wear-of c))
(push (make-instance (if (malep c) 'yadfa-items:shendyt 'yadfa-items:kalasiris)) (wear-of c))))
(defclass diapered-raccoon-bandit (adopted-enemy ally-last-minute-potty-training pantsable-character) ()
(:default-initargs
:name "Diapered Raccoon Bandit"
:malep t
:bladder/contents (random 500)
:bowels/contents (random 700)
:description "The Diapered Raccoon Bandits are a local AB/DL gang here in this world. Apparently wearing (and using) diapers is extremely embarrassing for them, so they wear tunics to hide them."
:moves (list (make-instance 'yadfa-moves:mush)
(make-instance 'yadfa-moves:pants)
(make-instance 'yadfa-moves:tickle)
(make-instance 'yadfa-moves:watersport)
(make-instance 'yadfa-moves:mudsport))
:wear (list (make-instance 'yadfa-items:bandit-uniform-tunic)
(make-instance 'yadfa-items:bandit-adjustable-diaper))))
(defclass found-raccoon-bandit (diapered-raccoon-bandit) ()
(:default-initargs
:name "Diapered Raccoon Bandit"
:description "You found this Raccoon at that haunted house. Be sure to return him to the Raccoon Bandits when you're done having fun with him."
:bladder/contents (random 500)
:bowels/contents (random 700)
:wear (list (make-instance 'yadfa-items:bandit-diaper))))
| 2,994 | Common Lisp | .lisp | 55 | 47.836364 | 198 | 0.691732 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | f3182e8f5f7a0898644b4bf2210b29b7b38d68b67d20fb62516c9b7313fe079f | 15,644 | [
-1
] |
15,645 | package.lisp | pouar_yadfa/t/package.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "common-lisp-user"; coding: utf-8-unix; -*-
(uiop:define-package #:yadfa-tests
(:use #:cl #:fiveam #:iterate)
(:export #:all-tests
#:initialization-tests
#:initialize-items
#:initialize-enemies
#:initialize-moves
#:initialize-props
#:initialize-status-conditions
#:initialize-allies))
| 414 | Common Lisp | .lisp | 11 | 29.272727 | 91 | 0.595533 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 992e58ebdb577453497a943b76f5c77a4d01512497883448bf8648e27d0560b3 | 15,645 | [
-1
] |
15,646 | main.lisp | pouar_yadfa/t/main.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-tests"; coding: utf-8-unix; -*-
(in-package :yadfa-tests)
(def-suite all-tests)
(def-suite initialization-tests :in all-tests)
(in-suite initialization-tests)
(defmacro test-initialize-package (package)
`(iter (for class in-package ,package external-only t)
(when (find-class class nil)
(let ((result (handler-case (class-of (make-instance class))
(error (c) c))))
(is (eq result (find-class class nil))
"Class ~s failed to initialize:~%~8t~a" class result)))))
(test initialize-items
(test-initialize-package :yadfa-items))
(test initialize-enemies
(test-initialize-package :yadfa-enemies))
(test initialize-moves
(test-initialize-package :yadfa-moves))
(test initialize-props
(test-initialize-package :yadfa-props))
(test initialize-status-conditions
(test-initialize-package :yadfa-status-conditions))
(test initialize-allies
(test-initialize-package :yadfa-allies))
| 1,040 | Common Lisp | .lisp | 24 | 37.541667 | 86 | 0.683071 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 3ec3d331ed8abc1df9210cc1ceb65e8bdb196eb68ec73798fbf05996756e80c5 | 15,646 | [
-1
] |
15,647 | net.pouar.yadfa.appdata.xml.lisp | pouar_yadfa/flatpak/net.pouar.yadfa.appdata.xml.lisp | (:!root
((:!header :version "1.0" :encoding "UTF-8"))
(:!comment "Copyright 2018 Pouar Dragon")
(application
((id :type "desktop") "net.pouar.yadfa.desktop")
(name "Yadfa")
(summary "Yet Another Diaperfur Adventure")
(metadata_license "CC0-1.0")
(update_contact "[email protected]")
(categories
(category "Game")
(category "AdventureGame")
(category "RolePlaying"))
(releases
((release :version "0.9" :type "development" :date "2018-10-02")))
((content_rating :type "oars-1.1")
((content_attribute :id "violence-cartoon") "moderate")
((content_attribute :id "language-profanity") "intense")
((content_attribute :id "language-humor") "moderate")
((content_attribute :id "money-gambling") "moderate"))
(screenshots
((screenshot :type "default")
((image :type "source") "https://www.pouar.net/downloads/yadfa-screenshot-1.png")))
(project_license "GPL-3.0+")
(developer_name "Pouar")
(requires
(memory 1024))
((launchable :type "desktop-id") "net.pouar.yadfa.desktop")
(description "An experimental text based adventure you play by typing in Lisp code in a REPL")
((url :type "homepage") "https://cgit.pouar.net/yadfa.git/about")))
| 1,261 | Common Lisp | .lisp | 30 | 36.566667 | 98 | 0.651503 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | d928586d6220cdb98a28a445ddabdfc4d9c33f8f489c1288c91dd96ac80cb8d4 | 15,647 | [
-1
] |
15,648 | create-appstream-metadata.lisp | pouar_yadfa/flatpak/create-appstream-metadata.lisp | #-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(ql:quickload :plump-sexp)
(with-open-file (r (uiop:merge-pathnames*
(make-pathname :directory '(:relative "flatpak") :name "net.pouar.yadfa.appdata.xml" :type "lisp")
(asdf:component-pathname (asdf:find-system "yadfa")))
:direction :input)
(with-open-file (s (uiop:merge-pathnames*
(make-pathname :directory '(:relative "flatpak") :name "net.pouar.yadfa.appdata" :type "xml")
(asdf:component-pathname (asdf:find-system "yadfa")))
:direction :output
:if-exists :supersede)
(plump:serialize (plump-sexp:parse (read r)) s)))
| 878 | Common Lisp | .lisp | 16 | 41.625 | 118 | 0.578886 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | a19dd356e6ae4c6d50b2bbf61f205474f76d696cde55bd23d850be6a1fc37848 | 15,648 | [
-1
] |
15,649 | ccl-init.lisp | pouar_yadfa/ci/ccl-init.lisp | (in-package :ccl)
(handler-bind ((error #'(lambda (c)
(let ((r (find-restart 'continue c)))
(when r (invoke-restart r))))))
(defun fd-input-available-p (fd &optional milliseconds)
"Returns true or false depending on whether input is available.
In some cases on windows, it may return a count of the number of unread bytes.
This behavior should not be depended upon."
#+windows-target
(case (%unix-fd-kind fd)
(:socket
(rlet ((infds #>fd_set)
(tv :timeval :tv_sec 0 :tv_usec 0))
(fd-zero infds)
(fd-set fd infds)
(when (and milliseconds (>= milliseconds 0))
(multiple-value-bind (seconds millis)
(floor milliseconds 1000)
(setf (pref tv :timeval.tv_sec) seconds
(pref tv :timeval.tv_usec) (* 1000 millis))))
(let* ((result (#_select 1 infds (%null-ptr) (%null-ptr) (if (and milliseconds (>= milliseconds 0)) tv (%null-ptr)))))
(cond ((> result 0) (values t 0))
((= result 0) (values nil 0))
(t (values nil (- (#_GetLastError))))))))
(:pipe (if (data-available-on-pipe-p fd)
(values t 0)
(if (and milliseconds (> milliseconds 0))
(values (process-wait-with-timeout "input-wait" milliseconds #'data-available-on-pipe-p fd) 0)
(values nil 0))))
(:file (let* ((curpos (fd-tell fd))
(eofpos (%stack-block ((peofpos 8))
(#_GetFileSizeEx (%int-to-ptr fd) peofpos)
(%%get-unsigned-longlong peofpos 0))))
(values (< curpos eofpos) 0)))
;;(:character-special (windows-tty-input-available-p fd milliseconds))
(t (values nil 0)))
#-windows-target
(rlet ((pollfds (:array (:struct :pollfd) 1)))
(setf (pref (paref pollfds (:* (:struct :pollfd)) 0) :pollfd.fd) fd
(pref (paref pollfds (:* (:struct :pollfd)) 0) :pollfd.events) #$POLLIN)
(let* ((res (int-errno-call (#_poll pollfds 1 (or milliseconds -1)))))
(declare (fixnum res))
(values (> res 0) res)))))
(in-package :cl-user)
;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
| 2,557 | Common Lisp | .lisp | 49 | 39.367347 | 131 | 0.539106 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | c361ba86d10964f0301402246be784ff1bef3d332cd9b895b6f2299b22cd5dab | 15,649 | [
-1
] |
15,650 | util.lisp | pouar_yadfa/core/util.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-util"; coding: utf-8-unix; -*-
(in-package :yadfa-util)
(defun shl (x width bits)
"Compute bitwise left shift of @var{X} by @var{BITS} bits, represented on @var{WIDTH} bits"
(logand (ash x bits)
(1- (ash 1 width))))
(defun shr (x width bits)
"Compute bitwise right shift of @var{X} by @var{BITS} bits, represented on @var{WIDTH} bits"
(logand (ash x (- bits))
(1- (ash 1 width))))
(defmethod lambda-list ((lambda-exp list))
(cadr lambda-exp))
(defmacro print-unreadable-object-with-prefix ((object stream &key (type nil type-supplied-p) (identity nil identity-supplied-p))
&body body)
;; apparently the ansi standard says that all keywords are printed with the package prefix
;; and so making the current package the keyword package has the effect of causing the printer
;; to print all symbols with the package prefix
`(let ((*package* (find-package :keyword)))
(print-unreadable-object (,object ,stream ,@(when type-supplied-p `(:type ,type)) ,@(when identity-supplied-p `(:identity ,identity)))
,@body)))
(defmethod lambda-list ((lambda-exp function))
(swank-backend:arglist lambda-exp))
(defmacro do-push (item &rest places)
(a:once-only (item)
`(progn ,@(loop for place in places collect `(push ,item ,place)))))
(declaim (ftype (function (unsigned-byte sequence) sequence) remove-nth))
(defun remove-nth (n sequence)
(remove-if (constantly t) sequence :start n :count 1))
(declaim (ftype (function (list t unsigned-byte) list)))
(defun insert (list value n)
(if (= n 0)
(push value list)
(push value (cdr (nthcdr (1- n) list))))
list)
(define-modify-macro insertf (value n) insert)
(declaim (inline substitute/swapped-arguments remove-if/swapped-arguments))
(defun substitute/swapped-arguments (sequence new old &rest keyword-arguments)
(apply #'substitute new old sequence keyword-arguments))
(define-modify-macro substitutef (new old &rest keyword-arguments)
substitute/swapped-arguments
"Modify-macro for @code{SUBSTITUTE}. Sets place designated by the first argument to
the result of calling @code{SUSTITUTE} with @var{OLD}, @var{NEW}, place, and the @var{KEYWORD-ARGUMENTS}.")
(defun remove-if/swapped-arguments (sequence test &rest keyword-arguments)
(apply #'remove-if test sequence keyword-arguments))
(define-modify-macro removef-if (test &rest keyword-arguments)
remove-if/swapped-arguments
"Modify-macro for @code{REMOVE-IF}. Sets place designated by the first argument to
the result of calling @code{REMOVE-IF} with @var{TEST}, place, and the @var{KEYWORD-ARGUMENTS}.")
(defun delete-if/swapped-arguments (sequence test &rest keyword-arguments)
(apply #'delete-if test sequence keyword-arguments))
(define-modify-macro deletef-if (test &rest keyword-arguments)
delete-if/swapped-arguments
"Modify-macro for @code{DELETE-IF}. Sets place designated by the first argument to
the result of calling @code{DELETE-IF} with @var{TEST}, place, and the @var{KEYWORD-ARGUMENTS}.")
(defun type-specifier-p (type-specifier)
"Returns true if @var{TYPE-SPECIFIER} is a valid type specifier."
#+sbcl (sb-ext:valid-type-specifier-p type-specifier)
#+openmcl (ccl:type-specifier-p type-specifier)
#+ecl (c::valid-type-specifier type-specifier)
#+clisp (null
(nth-value 1 (ignore-errors
(ext:type-expand type-specifier))))
;; If you're wondering why we're parsing it multiple times, it's because CMUCL does this too.
;; If CMUCL doesn't trust KERNEL:SPECIFIER-TYPE to get it right the first time, then why should we?
#+cmucl (not (and (let ((type (kernel:specifier-type type-specifier)))
(typep type 'kernel:unknown-type)
(typep (kernel:specifier-type (kernel:unknown-type-specifier type)) 'kernel:unknown-type))))
;; Managed to get this out of the free version before it crashed trying to startup. Never could get it to work.
#+lispworks (type:valid-type-specifier-p type-specifier)
;; type specifiers are too complicated for me to figure out whether it's valid or not, but this is good enough for this game.
#-(or sbcl openmcl ecl clisp cmucl lispworks) (or (typep type-specifier
'(or
null
(and symbol (not keyword))
class))
(and (listp type-specifier)
(typep (car type-specifier) '(and symbol (not keyword))))))
(declaim (ftype (function (t) (or null function)) coerced-function-p))
(defun coerced-function-p (form)
"checks whether the type is a lambda expression or function"
(handler-case (coerce form 'function)
(type-error () nil)))
(deftype type-specifier ()
'(satisfies
type-specifier-p))
(deftype coerced-function ()
'(satisfies coerced-function-p))
(defmacro append* (&rest args)
"Variant of @code{APPEND} that also makes a copy of its last argument"
`(append ,@args nil))
(defmacro lappendf (list &rest args)
"Modify macro that appends @var{ARGS} at the beginning of @var{LIST} instead of the end. Might be faster."
(a:once-only (list)
`(setf ,list (append ,@args ,list))))
(define-modify-macro appendf* (&rest lists) append*
"Modify-macro for APPEND*. Appends LISTS to the place designated by the first
argument.")
(declaim (inline list-length-< list-length-<=))
(s:eval-always
(defun list-length-<= (length list)
(declare (type list list)
(type integer length))
(let ((n (1- length)))
(or (minusp n) (nthcdr n list))))
(defun list-length-< (length list)
(declare (type list list)
(type integer length))
(list-length-<= (1+ length) list)))
(defmacro defunassert (name args asserts &body body)
"Wrapper macro that brings the behavior of SBCL's type declaration to other implementations, @var{NAME-ARGS-DECLARES} is the function name, lambda list, and optionally the docstring and declarations (omitting the type declarations) @var{ASSERTS} is the type specifiers for the lambda list as a plist, @var{BODY} is the body of the function"
(declare (inline list-length-<))
(let* ((docstring (and (stringp (car body))
(cdr body)
(car body)))
(declare (let ((declare (if docstring
(cadr body)
(car body))))
(and (listp declare) (eq (car declare) 'declare) declare)))
(types (multiple-value-bind (req op rest key allow aux keyp)
(a:parse-ordinary-lambda-list args)
(declare (ignore rest allow aux keyp))
(iter (for i in (append req (mapcar 'car op) (mapcar 'cadar key)))
(when (member i (s:plist-keys asserts))
(collect `(type ,(getf asserts i) ,i)))))))
`(defun
,name ,args ,@(when docstring `(,docstring))
,@`(,(append (or declare '(declare))
types)
#-(or sbcl ccl) ,@(multiple-value-bind (req op rest key allow aux keyp)
(parse-ordinary-lambda-list args)
(declare (ignore rest allow aux keyp))
(iter (for i in (append req (mapcar 'car op) (mapcar 'cadar key)))
(when (member i (plist-keys asserts))
(collect `(check-type ,i ,(if (member i (plist-keys asserts))
(getf asserts i)
t))))))
,@(cond ((and docstring declare)
(cddr body))
((or docstring declare)
(cdr body))
(t body))))))
(declaim (ftype (function (t t) (values real &optional)) random-from-range))
(defun random-from-range (from to)
(s:random-in-range from (1+ to)))
(define-compiler-macro random-from-range (from to)
`(s:random-in-range ,from ,(if (constantp to)
(eval `(1+ ,to))
`(1+ ,to))))
| 8,500 | Common Lisp | .lisp | 148 | 46.405405 | 342 | 0.613865 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 62496929a006b012446e9c1575d752cb18b9d174c1ae58391ce4db9027daf242 | 15,650 | [
-1
] |
15,651 | patches.lisp | pouar_yadfa/core/patches.lisp | ;;;; -*- mode: Common-Lisp; coding: utf-8-unix; -*-
(in-package :serialization-format)
(defun array-values (expr)
(elt expr 6))
(defun array-fill-pointer (expr)
(elt expr 4))
(defun array-adjustable (expr)
(elt expr 5))
(in-package :climi)
;;; I think it's supposed to use maybe-funcall instead of funcall
(defmethod stream-input-wait ((stream input-stream-kernel) &key timeout input-wait-test)
(loop
with wait-fun = (and input-wait-test (curry input-wait-test stream))
with timeout-time = (and timeout (+ timeout (now)))
when (stream-gesture-available-p stream)
do (return-from stream-input-wait t)
do (multiple-value-bind (available reason)
(event-listen-or-wait stream :timeout timeout
:wait-function wait-fun)
(when (and (null available) (eq reason :timeout))
(return-from stream-input-wait (values nil :timeout)))
(when-let ((event (event-read-no-hang stream)))
(handle-event (event-sheet event) event))
(when timeout
(setf timeout (compute-decay timeout-time nil)))
(when (maybe-funcall input-wait-test stream)
(return-from stream-input-wait
(values nil :input-wait-test))))))
;;; the patch I added that makes the FreeType renderer pick the right defaults seems to make it a lot slower
;;; especially now that McCLIM is no longer caching all the fonts because that doesn't work when *default-text-style*
;;; changes. Cache all the fonts again for the FreeType renderer until this gets much faster upstream
#+mcclim-ffi-freetype
(defmethod text-style-mapping :around ((port clim-freetype::clx-freetype-port)
(text-style text-style)
&optional character-set)
(declare (ignore character-set))
(ensure-gethash text-style (port-text-style-mappings port) (call-next-method)))
;;; McCLIM is missing the accept-values application class which display-exit-boxes expects as an argument if you want to change what the function displays via :exit-boxes
;;; https://github.com/McCLIM/McCLIM/issues/582
(define-application-frame accept-values ()
((stream :initform *query-io* :initarg :stream)
(body :initform nil :initarg :body)
(exit-boxes :initform '((:exit "OK") (:abort "Cancel")) :initarg :exit-boxes)
(select-first-query :initform nil :initarg :selected-first-query)
(modify-initial-query :initform nil :initarg :modify-initial-query)
(resize-frame :initform nil :initarg :resize-frame)
(align-prompts :initform nil :initarg :align-prompts)
(label :initform nil :initarg :label)
(scroll-bars :initform nil :initarg :scroll-bars)
(x-position :initform nil :initarg :x-position)
(y-position :initform nil :initarg :y-position)
(foreground :initform nil :initarg :foreground)
(background :initform nil :initarg :background)
(text-style :initform nil :initarg :text-style)
(width :initform nil :initarg :width)
(height :initform nil :initarg :height)
(initially-select-p
:initform nil :initarg :initially-select-p)
(initially-select-query-identifier
:initform nil :initarg :initially-select-query-identifier)
(resynchronize-every-pass :initform nil :initarg :resynchronize-every-pass)
(own-window :initform nil :initarg :own-window)
(view :initarg :view))
(:menu-bar nil)
(:panes (abstract (clim:make-pane 'clim:basic-pane)))
(:layouts (default abstract))
(:command-definer t))
(defmethod run-frame-top-level :around ((frame accept-values) &key)
(letf (((frame-process frame) (current-process)))
(funcall (frame-top-level-lambda frame) frame)))
(defmethod display-exit-boxes ((frame accept-values) stream (view textual-dialog-view))
(declare (ignorable frame))
(updating-output (stream :unique-id 'buttons :cache-value t)
(fresh-line stream)
(formatting-table (stream)
(formatting-row (stream)
(dolist (i (slot-value frame 'exit-boxes))
(formatting-cell (stream)
(with-output-as-presentation (stream nil (cond ((eql (car i) :exit)
'exit-button)
((eql (car i) :abort)
'abort-button)))
(surrounding-output-with-border
(stream :shape :rounded :radius 6
:background +gray80+ :highlight-background +gray90+)
(format stream (cadr i))))))))
(terpri stream)))
(defmethod default-frame-top-level
((frame accept-values)
&key command-parser
command-unparser
partial-command-parser
prompt)
(declare (ignore command-parser command-unparser partial-command-parser prompt))
;; Give each pane a fresh start first time through.
(let* ((stream (slot-value frame 'stream))
(command-table (frame-command-table frame))
(align-prompts (slot-value frame 'align-prompts))
(body (slot-value frame 'body))
(label (slot-value frame 'label))
(initially-select-query-identifier (slot-value frame 'initially-select-query-identifier))
(initially-select-p (slot-value frame 'initially-select-p))
(resynchronize-every-pass (slot-value frame 'resynchronize-every-pass))
(select-first-query (slot-value frame 'select-first-query))
(own-window (slot-value frame 'own-window))
(exit-boxes (slot-value frame 'exit-boxes))
(modify-initial-query (slot-value frame 'modify-initial-query))
(resize-frame (slot-value frame 'resize-frame))
(scroll-bars (slot-value frame 'scroll-bars))
(x-position (slot-value frame 'x-position))
(y-position (slot-value frame 'y-position))
(width (slot-value frame 'width))
(height (slot-value frame 'height)))
(declare (ignore own-window exit-boxes modify-initial-query
resize-frame scroll-bars x-position y-position width height))
(when (and align-prompts ;; t means the same as :right
(not (eq align-prompts :left)))
(setf align-prompts :right))
(multiple-value-bind (cx cy) (stream-cursor-position stream)
(let* ((return-values nil)
(*accepting-values-stream*
(make-instance 'accepting-values-stream
:stream stream
:align-prompts align-prompts))
(arecord (updating-output (stream :record-type 'accepting-values-record)
(when label
(format stream label)
(terpri stream))
(if align-prompts
(formatting-table (stream)
#1=(setf return-values
(multiple-value-list
(funcall body *accepting-values-stream*))))
#1#)
(unless (queries *accepting-values-stream*)
(cerror "Exit returning body values."
"~s must contain at least one call to ~s."
'accepting-values 'accept)
(return-from default-frame-top-level return-values))
(display-exit-boxes frame
stream
(stream-default-view
*accepting-values-stream*))))
(first-time t)
(current-command (if initially-select-p
`(com-select-query
,initially-select-query-identifier)
`(com-select-query
,(query-identifier
(first
(queries *accepting-values-stream*))))))
(*accelerator-gestures* (compute-inherited-keystrokes command-table)))
(letf (((frame-command-table *application-frame*)
(find-command-table command-table)))
(unwind-protect
(handler-case
(loop
(if first-time
(setq first-time nil)
(when resynchronize-every-pass
(redisplay arecord stream)))
(with-input-context
('(command :command-table accept-values))
(object)
(progn
(when (and select-first-query
(not initially-select-p))
(setf current-command
`(com-select-query
,(query-identifier
(first
(queries *accepting-values-stream*))))
select-first-query nil))
(handler-case
(progn
(apply (command-name current-command)
(command-arguments current-command))
;; If current command returns without throwing a
;; command, go back to the default command
(setq current-command *default-command*))
(accelerator-gesture (c)
(let ((command (lookup-keystroke-command-item
(accelerator-gesture-event c) command-table)))
(if (listp command)
(setq current-command
(if (clim:partial-command-p command)
(funcall clim:*partial-command-parser*
command-table stream command
(position clim:*unsupplied-argument-marker* command))
command))
;; may be it is a gesture of the frame's command-table
(signal c))))))
(t (setq current-command object)))
(redisplay arecord stream))
(av-exit ()
(finalize-query-records *accepting-values-stream*)
(setf (last-pass *accepting-values-stream*) t)
(redisplay arecord stream)))
(dolist (query (queries *accepting-values-stream*))
(finalize (editing-stream (record query)) nil))
(erase-output-record arecord stream)
(setf (stream-cursor-position stream)
(values cx cy))))
(apply 'values return-values)))))
(defun invoke-accepting-values
(stream body
&rest args
&key own-window exit-boxes
(initially-select-query-identifier nil initially-select-p)
select-first-query
modify-initial-query resynchronize-every-pass resize-frame
align-prompts label scroll-bars
x-position y-position width height
(command-table 'accept-values)
(frame-class 'accept-values))
(declare (ignore own-window exit-boxes modify-initial-query
resize-frame scroll-bars x-position y-position width height
initially-select-query-identifier
select-first-query resynchronize-every-pass align-prompts
label command-table))
(run-frame-top-level (apply #'make-application-frame frame-class
:calling-frame *application-frame*
:stream stream
:body body
:initially-select-p initially-select-p
args)))
#+mcclim-ffi-freetype
(in-package :clim-freetype)
#+mcclim-ffi-freetype
(defun find-best-match (family face)
(let ((result (mcclim-fontconfig:match-font (append *main-filter*
(make-family-pattern family)
(make-face-pattern face))
'(:family :style :file :charset))))
(list (cdr (assoc :family result))
(cdr (assoc :style result))
(cdr (assoc :file result))
(cdr (assoc :charset result)))))
#+mcclim-ffi-freetype
(defun make-family-pattern (family)
(list (cond
((typep family 'freetype-font-family) `(:family . ,(clim-extensions:font-family-name family)))
((stringp family) `(:family . ,family))
((eq family :fix) '(:family . "monospace"))
((eq family :sans-serif) '(:family . "sans-serif"))
((eq family :serif) '(:family . "serif"))
(t '(:family . "sans-serif")))))
#+mcclim-ffi-freetype
(defun make-face-pattern (face)
(loop
for f in (if (listp face) face (list face))
append (cond
((typep f 'freetype-font-face) `(("style" . ,(clim-extensions:font-face-name face))))
((stringp face) `((:style . ,face)))
((eq f :roman) '((:style . "Regular")))
((eq f :bold) '((:style . "Bold")))
((eq f :italic) '((:style . "Italic")))
(t nil))))
(in-package :yadfa)
(define-condition uwu (simple-error) ()
(:report (lambda (condition stream)
(declare (ignore condition))
(write-line "OOPSIE WOOPSIE!! Uwu We made a fucky wucky!! A wittle fucko boingo!" stream)
(write-line "The code monkeys at our headquarters are working VEWY HAWD to fix this!" stream))))
| 15,155 | Common Lisp | .lisp | 264 | 37.234848 | 170 | 0.507389 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 9e61fa1863b14fea583c79d270d434694c52e0c3e78e5b7aa4f128b17092e227 | 15,651 | [
-1
] |
15,652 | declt-patches.lisp | pouar_yadfa/core/declt-patches.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "net.didierverna.declt"; coding: utf-8-unix; -*-
(in-package :net.didierverna.declt)
(defun render-docstring (item)
"Render ITEM's documentation string.
Rendering is done on *standard-output*."
(when-let ((docstring (docstring item)))
(write-string docstring *standard-output*)))
(defun render-header (library-name tagline version contact-names contact-emails
copyright-years license
texi-name info-name declt-notice
current-time-string)
"Render the header of the Texinfo file."
(format t "\\input texinfo~2%@c ~A.texi --- Reference manual~2%" texi-name)
(when copyright-years
(mapc (lambda (name)
(format t "@c Copyright (C) ~A ~A~%" copyright-years name))
;; #### NOTE: we already removed the duplicates in the original contact
;; list, but there may still be duplicates in the names, for instance if
;; somebody used his name several times, with a different email
;; address.
(remove-duplicates (remove-if #'null contact-names)
:from-end t :test #'string=))
(terpri))
(format t "@c This file is part of ~A.~2%" library-name)
(when license
(with-input-from-string (str (caddr license))
(loop :for line := (read-line str nil str)
:until (eq line str)
:do (format t "@c ~A~%" line))))
(terpri)
(terpri)
(format t "@c Commentary:~2%~
@c Generated automatically by Declt version ~A~%~
@c on ~A.~3%"
(version :long) current-time-string)
(format t "~
@c ====================================================================
@c Header
@c ====================================================================
@c %**start of header
@setfilename ~A.info
@settitle The ~A Reference Manual
@afourpaper
@documentencoding UTF-8
@c %**end of header~4%"
(escape info-name) (escape library-name))
(format t "~
@c ====================================================================
@c Format Specific Tweaks
@c ====================================================================
@tex
%% Declt uses several Unicode characters to \"reveal\" blanks. This
%% works fine in HTML or Info output, but TeX will have problems with
%% these. The code below translates those characters to something that
%% TeX can handle.
%% U+23B5 (Bottom Square Bracket), used to reveal white spaces, is
%% translated to its Computer Modern teletype version.
\\DeclareUnicodeCharacter{23B5}{{\\tt\\char'040}}
%% U+21B5 (Downwards Arrow With Corner Leftwards), used to reveal
%% carriage returns, is translated to \\hookleftarrow in math mode.
\\DeclareUnicodeCharacter{21B5}{\\ensuremath\\hookleftarrow}
%% U+21E5 (Rightwards Arrow To Bar), used to reveal tabs, is
%% translated to something that looks similar, based on a rightarrow
%% and a vertical bar from the math extension font.
\\DeclareUnicodeCharacter{21E5}{%
\\ensuremath{\\rightarrow\\kern-.5em\\mathchar\\\"130C}}
%% Declt uses several Unicode characters to replace \"fragile\" ones in
%% anchor names and references. These characters are chosen to resemble
%% the original ones, without interfering with Info syntax. In TeX
%% however, we can switch them back to the original versions, because
%% cross-references are done differently. In theory, I think we could do
%% something similar for HTML output (again, only the Info syntax poses
%% problems), but I don't know how to do something similar to what's
%% below.
%% U+2024 (One Dot Leader) replaces periods.
\\DeclareUnicodeCharacter{2024}{.}
%% U+2236 (Ratio) replaces colons.
\\DeclareUnicodeCharacter{2236}{:}
%% U+2768 (Medium Left Parenthesis Ornament) replaces left parenthesis.
\\DeclareUnicodeCharacter{2768}{(}
%% U+2769 (Medium Right Parenthesis Ornament) replaces right parenthesis.
\\DeclareUnicodeCharacter{2769}{)}
%% U+214B (Turned Ampersand) replaces ampersands.
\\DeclareUnicodeCharacter{214B}{&}
%% U+2216 (Set Minus) replaces backslashes.
\\DeclareUnicodeCharacter{2216}{\\char\"5C}
%% The following ones are already defined in texinfo.tex so we have nothing
%% more to do:
%% U+201A (Single Low-9 Quotation Mark) replaces commas.
%% U+2205 (Empty Set) replaces empty symbol names.
@end tex~4%")
(format t "~
@c ====================================================================
@c Settings
@c ====================================================================
@setchapternewpage odd
@documentdescription
The ~A Reference Manual~@[, version ~A~].
@end documentdescription~4%"
(escape library-name) (escape version))
(format t "~
@c ====================================================================
@c New Commands
@c ====================================================================
@c ---------------
@c Indexing macros
@c ---------------
@c Packages
@macro packageindex{name}
@tpindex \\name\\
@tpindex @r{Package, }\\name\\
@end macro
@c Systems
@macro systemindex{name}
@tpindex \\name\\
@tpindex @r{System, }\\name\\
@end macro
@c Modules
@macro moduleindex{name}
@cindex @t{\\name\\}
@cindex Module, @t{\\name\\}
@end macro
@c Other files
@macro otherfileindex{name}
@cindex @t{\\name\\}
@cindex Other File, @t{\\name\\}
@cindex File, other, @t{\\name\\}
@end macro
@c Lisp files
@macro lispfileindex{name}
@cindex @t{\\name\\}
@cindex Lisp File, @t{\\name\\}
@cindex File, Lisp, @t{\\name\\}
@end macro
@c C files
@macro cfileindex{name}
@cindex @t{\\name\\}
@cindex C File, @t{\\name\\}
@cindex File, C, @t{\\name\\}
@end macro
@c Java files
@macro javafileindex{name}
@cindex @t{\\name\\}
@cindex Java File, @t{\\name\\}
@cindex File, Java, @t{\\name\\}
@end macro
@c Static files
@macro staticfileindex{name}
@cindex @t{\\name\\}
@cindex Static File, @t{\\name\\}
@cindex File, static, @t{\\name\\}
@end macro
@c Doc files
@macro docfileindex{name}
@cindex @t{\\name\\}
@cindex Doc File, @t{\\name\\}
@cindex File, doc, @t{\\name\\}
@end macro
@c HTML files
@macro htmlfileindex{name}
@cindex @t{\\name\\}
@cindex HTML File, @t{\\name\\}
@cindex File, html, @t{\\name\\}
@end macro
@c The following macros are meant to be used within @defxxx environments.
@c Texinfo performs half the indexing job and we do the other half.
@c Constants
@macro constantsubindex{name}
@vindex @r{Constant, }\\name\\
@end macro
@c Special variables
@macro specialsubindex{name}
@vindex @r{Special Variable, }\\name\\
@end macro
@c Symbol macros
@macro symbolmacrosubindex{name}
@vindex @r{Symbol Macro, }\\name\\
@end macro
@c Slots
@macro slotsubindex{name}
@vindex @r{Slot, }\\name\\
@end macro
@c Macros
@macro macrosubindex{name}
@findex @r{Macro, }\\name\\
@end macro
@c Compiler Macros
@macro compilermacrosubindex{name}
@findex @r{Compiler Macro, }\\name\\
@end macro
@c Functions
@macro functionsubindex{name}
@findex @r{Function, }\\name\\
@end macro
@c Methods
@macro methodsubindex{name}
@findex @r{Method, }\\name\\
@end macro
@c Generic Functions
@macro genericsubindex{name}
@findex @r{Generic Function, }\\name\\
@end macro
@c Setf Expanders
@macro setfexpandersubindex{name}
@findex @r{Setf Expander, }\\name\\
@end macro
@c Method Combinations
@macro shortcombinationsubindex{name}
@tpindex @r{Short Method Combination, }\\name\\
@tpindex @r{Method Combination, Short, }\\name\\
@end macro
@macro longcombinationsubindex{name}
@tpindex @r{Long Method Combination, }\\name\\
@tpindex @r{Method Combination, Long, }\\name\\
@end macro
@c Conditions
@macro conditionsubindex{name}
@tpindex @r{Condition, }\\name\\
@end macro
@c Structures
@macro structuresubindex{name}
@tpindex @r{Structure, }\\name\\
@end macro
@c Types
@macro typesubindex{name}
@tpindex @r{Type, }\\name\\
@end macro
@c Classes
@macro classsubindex{name}
@tpindex @r{Class, }\\name\\
@end macro
@c Pouar's Custom Stuff
@html
<script defer>
MathJax = {
tex: {inlineMath: [['$', '$'], ['\\\\(', '\\\\)']],
macros: {
RR: \"{\\\\bf R}\",
bold: [\"{\\\\bf #1}\", 1]
}}
};
MathJax.Hub.Config({ TeX: { extensions: [] }});
</script>
<!-- Source is apparently here https://github.com/mathjax/MathJax-src -->
<script id=\"MathJax-script\" defer src=\"https://cdn.jsdelivr.net/npm/mathjax@@3/es5/tex-chtml-full.js\"></script>
@end html
@macro mathjax{math}
@tex
$$\\math\\$$
@end tex
@html
$$\\math\\$$
@end html
@ifnothtml
@ifnottex
@center @backslashchar{}[@math{\\math\\}@backslashchar{}]
@end ifnottex
@end ifnothtml
@end macro
@macro imathjax{math}
@inlineraw{html,$\\math\\$}
@inlineraw{tex,$\\math\\$}
@inlinefmtifelse{tex,,@inlinefmtifelse{html,,@backslashchar{}(@math{\\math\\}@backslashchar{})}}
@end macro~4%")
(format t "~
@c ====================================================================
@c Info Category and Directory
@c ====================================================================
@dircategory Common Lisp
@direntry
* ~A Reference: (~A). The ~A Reference Manual.
@end direntry~4%"
(escape library-name) (escape info-name) (escape library-name))
(when license
(format t "~
@c ====================================================================
@c Copying
@c ====================================================================
@copying
@quotation~%")
(when copyright-years
(mapc (lambda (name)
(format t "Copyright @copyright{} ~A ~A~%"
(escape copyright-years) (escape name)))
;; #### NOTE: we already removed the duplicates in the original
;; contact list, but there may still be duplicates in the names, for
;; instance if somebody used his name several times, with a different
;; email address.
(remove-duplicates (remove-if #'null contact-names)
:from-end t :test #'string=))
(terpri))
(format t "~
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries a copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled ``Copying'' is included exactly as in the original.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be translated as well.
@end quotation
@end copying~4%"))
(format t "~
@c ====================================================================
@c Title Page
@c ====================================================================
@titlepage
@title The ~A Reference Manual
~A~%"
(escape library-name)
(if (or tagline version)
(format nil "@subtitle ~@[~A~]~:[~;, ~]~@[version ~A~]~%"
(escape tagline) (and tagline version) (escape version))
""))
(mapc (lambda (name email)
(format t "@author ~@[~A~]~:[~; ~]~@[<@email{~A}>~]~%"
(escape name) email (escape email)))
contact-names contact-emails)
(terpri)
(when (or declt-notice license)
(format t "@page~%"))
(when declt-notice
(format t "~
@quotation
This manual was generated automatically by Declt ~A~@[ on ~A~].
@end quotation~%"
(escape (version declt-notice))
(when (eq declt-notice :long) (escape current-time-string))))
(when license
(format t "@vskip 0pt plus 1filll~%@insertcopying~%"))
(format t "@end titlepage~4%")
(format t "~
@c ====================================================================
@c Table of Contents
@c ====================================================================
@contents~%"))
| 12,075 | Common Lisp | .lisp | 343 | 32.137026 | 115 | 0.628331 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | a3706a641f9b379520784251d73b86841c936e643b2d035887d0d882d396ed83 | 15,652 | [
-1
] |
15,653 | bin.lisp | pouar_yadfa/core/bin/bin.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defunassert yadfa-bin:get-inventory-of-type (type)
(type type-specifier)
(get-positions-of-type type (inventory-of (player-of *game*))))
(defun yadfa-bin:reload-files (&rest keys &key compiler-verbose &allow-other-keys)
"Intended for developers. Use this to recompile the game without having to close it. Accepts the same keyword arguments as @code{ASDF:LOAD-SYSTEM} and @code{ASDF:OPERATE}. Set @var{COMPILER-VERBOSE} to @code{T} to print the compiling messages. setting @var{LOAD-SOURCE} to @code{T} will avoid creating fasls"
(let ((*compile-verbose* compiler-verbose) (*compile-print* compiler-verbose))
(apply #'asdf:load-system :yadfa :allow-other-keys t keys)
(apply #'load-mods :allow-other-keys t keys))
(switch-user-packages))
(defun yadfa-bin:enable-mods (systems)
#.(format nil "Enable a mod, the modding system is mostly just asdf, @var{SYSTEM} is a keyword which is the name of the system you want to enable
~a."
(xref yadfa-bin:disable-mods :function))
(let ((systems (iter (for i in (a:ensure-list systems))
(collect (asdf:coerce-name i)))))
(dolist (system (remove-duplicates systems :test #'string=))
(asdf:find-system system))
(dolist (system systems)
(pushnew system *mods* :test #'string=)
(asdf:load-system system))
(a:with-output-to-file (stream #P"yadfa:config;mods.conf"
:if-exists :supersede
:external-format :utf-8)
(write *mods* :stream stream)))
systems)
(defun yadfa-bin:disable-mods (systems)
#.(format nil "Disable a mod, the modding system is mostly just asdf, @var{SYSTEM} is a keyword which is the name of the system you want to enable
~a."
(xref yadfa-bin:enable-mods :function))
(let ((systems (delete-duplicates (iter (for i in (a:ensure-list systems))
(collect (asdf:coerce-name i)))
:test #'string=)))
(a:deletef *mods* systems :test (lambda (o e)
(member e o :test #'string=)))
(a:with-output-to-file (stream #P"yadfa:config;mods.conf"
:if-exists :supersede
:external-format :utf-8)
(write *mods* :stream stream)))
systems)
(defunassert yadfa-bin:toggle-onesie (&key wear user)
(wear (or type-specifier unsigned-byte null) user (or type-specifier unsigned-byte null))
"Open or closes your onesie. @var{WEAR} is the index of a onesie. Leave @code{NIL} for the outermost onesie. @var{USER} is the index of an ally. Leave @code{NIL} to refer to yourself"
(handle-query ((allies-length (list-length (allies-of *game*)))
(inventory-length (list-length (wear-of (player-of *game*))))
(selected-user (if user (if (numberp user)
(nth user (allies-of *game*))
(find user (allies-of *game*) :test (lambda (o e)
(typep e o))))
(player-of *game*)))
(selected-wear (when wear (if (numberp wear)
(nthcdr wear (wear-of (player-of *game*)))
(member wear (wear-of (player-of *game*)) :test (lambda (o e)
(typep e o)))))))
(*query-io* ((and user (numberp user) (>= user allies-length))
(user)
:prompt-text "Enter a different ally"
:error-text (format nil "You only have ~d allies" allies-length))
((and user (typep user 'type-specifier) (not selected-user))
(user)
:prompt-text "Enter a different ally"
:error-text (format nil "Ally ~s doesn't exist" user))
((and wear (numberp wear) (>= wear inventory-length))
(wear)
:prompt-text "Select a different clothing"
:error-text (format nil "You're only wearing ~a items" inventory-length))
((and wear (typep wear 'type-specifier) (not selected-wear))
(wear)
:prompt-text "Select a different clothing"
:error-text (format nil "You're not wearing that item"))
((let ((selected-wear (if wear
selected-wear
(iter (for item on (wear-of selected-user))
(when (typep (car item) 'onesie)
(leave item))
(finally (format t "~a isn't wearing a onesie"
(name-of selected-user)))))))
(handler-case (progn (toggle-onesie (car selected-wear) selected-wear selected-user)
(let* ((male (malep selected-user))
(hisher (if male "his" "her"))
(onesie (car selected-wear)))
(if (typep (car selected-wear) 'onesie/closed)
(format t "~a snaps ~a ~a~%~%"
(name-of selected-user)
hisher
(name-of onesie))
(format t "~a unsnaps ~a ~a~%~%"
(name-of selected-user)
hisher
(name-of onesie)))))
(onesie-too-thick (c)
(let* ((user (user-of c))
(clothes (clothes-of c))
(male (malep user))
(hisher (if male "his" "her")))
(format t "~a struggles to snap the bottom of ~a ~a like a toddler who can't dress ~aself but ~a ~a is too thick~%~%"
(name-of user)
hisher
(name-of (car clothes))
(if male "him" "her")
hisher
(name-of (thickest (cdr clothes))))))
(onesie-locked (c)
(let ((user (user-of c)))
(format t "~a can't unsnap ~a ~a as it's locked~%~%"
(name-of user)
(if (malep user) "his" "her")
(name-of (car (clothes-of c)))))))
nil)
(wear)
:prompt-text "Select a different clothing"))))
(defunassert yadfa-bin:lst (&key inventory inventory-group props wear user directions moves position map descriptions describe-zone)
(user (or unsigned-byte boolean)
map (or boolean integer)
inventory type-specifier)
"used to list various objects and properties, @var{INVENTORY} takes a type specifier for the items you want to list in your inventory. setting @var{INVENTORY} to @code{T} will list all the items. @var{INVENTORY-GROUP} is similar to @var{INVENTORY}, but will group the items by class name. @var{WEAR} is similar to @var{INVENTORY} but lists clothes you're wearing instead. setting @var{DIRECTIONS} to non-NIL will list the directions you can walk.setting @var{MOVES} to non-NIL will list the moves you know. setting @var{USER} to @code{T} will cause @var{MOVES} and @var{WEAR} to apply to the player, setting it to an integer will cause it to apply it to an ally. Leaving it at @code{NIL} will cause it to apply to everyone. setting @var{POSITION} to true will print your current position. Setting @var{MAP} to a number will print the map with the floor number set to @var{MAP}, setting @var{MAP} to @code{T} will print the map of the current floor you're on. When printing the map in McCLIM, red means there's a warp point, dark green is the zone with the player, blue means there are stairs. These 3 colors will blend with each other to make the final color"
(let ((allies-length (list-length (allies-of *game*))))
(labels ((format-table (header &rest body)
(c:formatting-table (t :x-spacing 20)
(c:with-text-style (*query-io* (c:make-text-style nil :bold nil))
(c:formatting-row ()
(iter (for cell in header)
(c:formatting-cell ()
(typecase cell
(string (write-string cell))
(t (write cell)))))))
(iter (for row in body)
(c:formatting-row ()
(iter (for cell in row)
(c:formatting-cell ()
(typecase cell
(string (write-string cell))
(t (write cell)))))))))
(format-items (list item &optional user)
(format t "Number of items listed: ~a~%~%" (iter (with j = 0)
(for i in list)
(when (typep i item)
(incf j))
(finally (return j))))
(when user
(format t "~a:~%~%" (name-of user)))
(apply #'format-table '("Index" "Name" "Class" "Wet" "Wetcap" "Mess" "Messcap")
(let ((j 0)) (iter (for i in list)
(when (typep i item)
(collect (list j
(name-of i)
(type-of i)
(if (typep i 'closed-bottoms) (coerce (sogginess-of i) 'long-float) nil)
(if (typep i 'closed-bottoms) (coerce (sogginess-capacity-of i) 'long-float) nil)
(if (typep i 'closed-bottoms) (coerce (messiness-of i) 'long-float) nil)
(if (typep i 'closed-bottoms) (coerce (messiness-capacity-of i) 'long-float) nil))))
(incf j)))))
(format-moves (user)
(format t "~a:~%~%" (name-of user))
(apply #'format-table '("Symbol" "Name" "Description")
(iter (for i in (moves-of user))
(when i (collect (list (s:class-name-of i) (name-of i) (description-of i)))))))
(format-user (user)
(format t "Name: ~a~%Species: ~a~%Description: ~a~%~%"
(name-of user)
(species-of user)
(description-of user)))
(check-allies ()
(when (and (typep user 'unsigned-byte) (< allies-length user))
(format t "You only have ~d allies~%" allies-length)
(return-from yadfa-bin:lst))))
(check-allies)
(when inventory
(with-effective-frame
(format-items (inventory-of (player-of *game*)) inventory)))
(when describe-zone
(format t "~a~%" (get-zone-text (description-of (typecase describe-zone
(zone describe-zone)
(list (get-zone describe-zone))
(t (get-zone (position-of (player-of *game*)))))))))
(when inventory-group
(with-effective-frame
(let ((a ()))
(iter (for i in (inventory-of (player-of *game*)))
(when (typep i inventory-group)
(if (getf a (s:class-name-of i))
(incf (second (getf a (s:class-name-of i))))
(setf (getf a (s:class-name-of i)) (list (name-of (make-instance (s:class-name-of i))) 1)))))
(apply #'format-table '("Class Name" "Name" "Quantity")
(iter (for (key value) on a by #'cddr)
(collect (apply 'list key value)))))))
(when wear
(with-effective-frame
(cond ((not user)
(format-items (wear-of (player-of *game*)) wear (player-of *game*))
(iter (for k in (allies-of *game*))
(format-items (wear-of k) wear k)))
((typep user 'integer)
(let ((selected-ally (nth user (allies-of *game*))))
(check-allies)
(format-items (wear-of selected-ally) wear selected-ally)))
(t
(format-items (wear-of (player-of *game*)) wear (player-of *game*))))))
(when moves
(with-effective-frame
(cond ((typep user 'real)
(let ((selected-ally (nth user (allies-of *game*))))
(format-moves selected-ally)))
((not user)
(format-moves (player-of *game*))
(iter (for k in (allies-of *game*))
(format-moves k)))
(t (format-moves (player-of *game*))))))
(when props
(with-effective-frame
(apply #'format-table '("Keyword" "Object")
(iter (for (a b) on (get-props-from-zone (position-of (player-of *game*))) by #'cddr)
(when b
(collect (list a (name-of b))))))))
(let ((player-position (position-of (player-of *game*))))
(declare (type list player-position))
(destructuring-bind (x y z map) player-position
(declare (type integer x y z)
(type symbol map))
(let ((x-y-z (list x y z)))
(declare (type list x-y-z))
(flet ((z (delta direction x-y-z player-position map)
(declare (type keyword direction)
(type list delta x-y-z player-position)
(type symbol map))
(let ((position `(,@(mapcar #'+ x-y-z delta) ,map)))
(declare (type list position))
(when (and (get-zone position)
(get-zone player-position)
(not (getf-direction player-position direction :hidden))
(not (hiddenp (get-zone position)))
(or (and (s:memq direction '(:up :down)) (s:memq direction (stairs-of (get-zone player-position))))
(not (s:memq direction '(:up :down)))))
(format t "~s ~a~%"
direction
(name-of (get-zone position)))))))
(when directions
(z '(1 0 0) :east x-y-z player-position map)
(z '(-1 0 0) :west x-y-z player-position map)
(z '(0 -1 0) :north x-y-z player-position map)
(z '(0 1 0) :south x-y-z player-position map)
(z '(0 0 1) :up x-y-z player-position map)
(z '(0 0 -1) :down x-y-z player-position map)
(when (warp-points-of (get-zone (position-of (player-of *game*))))
(iter (for (a b) on (warp-points-of (get-zone (position-of (player-of *game*)))) by #'cddr)
(when (and (get-zone b) (not (hiddenp (get-zone b))))
(format t "~s ~a~%" a (name-of (get-zone b)))))))))))
(when position
(format t "Your current position is ~s~%" (position-of (player-of *game*))))
(when map
(cond ((eq map t)
(print-map t))
(t (print-map
(destructuring-bind (x y z m) (position-of (player-of *game*))
(declare (type integer x y z)
(type symbol m)
(ignore z))
(list x y map m))))))
(when descriptions
(cond ((eq user t)
(format-user (player-of *game*)))
((typep user 'unsigned-byte)
(format-user (nth user (allies-of *game*))))
(t
(format-user (player-of *game*))
(iter (for i in (allies-of *game*))
(format t "Name: ~a~%Species: ~a~%Description: ~a~%~%" (name-of i) (species-of i) (description-of i)))))))))
(defunassert yadfa-bin:get-stats (&key inventory wear prop item attack ally wield enemy)
(ally (or null unsigned-byte type-specifier)
wear (or null unsigned-byte type-specifier)
inventory (or null unsigned-byte type-specifier)
enemy (or null unsigned-byte type-specifier))
"lists stats about various items in various places. @var{INVENTORY} is the index of an item in your inventory. @var{WEAR} is the index of what you or your ally is wearing. @var{PROP} is a keyword that refers to the prop you're selecting. @var{ITEM} is the index of an item that a prop has and is used to print information about that prop. @var{ATTACK} is a keyword referring to the move you or your ally has when showing that move. @var{ALLY} is the index of an ally on your team when selecting @var{INVENTORY} or @var{MOVE}, don't set @var{ALLY} if you want to select yourself."
(when (and ally (list-length-> ally (allies-of *game*)))
(write-line "That ally doesn't exist")
(return-from yadfa-bin:get-stats))
(let* ((selected-user (cond (ally (if (typep ally 'type-specifier)
(find ally (allies-of *game*)
:test (lambda (o e)
(typep e o)))
(nth ally (allies-of *game*))))
((and enemy *battle*)
(if (typep enemy 'type-specifier)
(find enemy (enemies-of *battle*)
:test (lambda (o e)
(typep e o)))
(nth enemy (enemies-of *battle*))))
(t (player-of *game*))))
(wear (typecase wear
(type-specifier (find wear (wear-of selected-user)
:test (lambda (o e)
(typep e o))))
(unsigned-byte (nth wear (wear-of selected-user)))))
(inventory (typecase inventory
(type-specifier
(find inventory (inventory-of (player-of *game*))
:test (lambda (o e)
(typep e o))))
(unsigned-byte
(nth inventory (inventory-of (player-of *game*)))))))
(when wield
(describe-item (wield-of selected-user)))
(when inventory
(describe-item inventory))
(when wear
(describe-item (find wear (wear-of selected-user)) t))
(when attack
(format t "Name:~a~%Description~a~%Energy Cost: ~f~%~%"
(name-of (get-move attack selected-user))
(description-of (get-move attack selected-user))
(energy-cost-of (get-move attack selected-user))))
(when prop
(handle-query ()
(*query-io* ((or (check-type prop (and (not null) symbol)) (null (getf (get-props-from-zone (position-of (player-of *game*))) prop)))
(prop)
:prompt-text "Enter a different prop, or exit and use (lst :props t) to get the list of props and try again"
:error-text "That prop doesn't exist")
((null (nth item (items-of (getf (get-props-from-zone (position-of (player-of *game*)))
(the (and (not null) symbol) prop)))))
(item)
:prompt-text "Enter a different item"
:error-text "That item doesn't exist"))
(describe-item (nth (the unsigned-byte item)
(items-of (getf (get-props-from-zone (position-of (player-of *game*)))
(the (and (not null) symbol) prop)))))))))
(defunassert yadfa-bin:wear (&key (inventory 0) (wear 0) user)
(user (or null unsigned-byte)
wear unsigned-byte
inventory (or type-specifier unsigned-byte))
#.(format nil "Wear an item in your inventory. @var{WEAR} is the index you want to place this item. Smaller index refers to outer clothing. @var{INVENTORY} is an index in your inventory of the item you want to wear. You can also give it a type specifier which will pick the first item in your inventory of that type. @var{USER} is an index of an ally. Leave this at @code{NIL} to refer to yourself.
~a, ~a, and ~a."
(xref yadfa-bin:unwear :function) (xref yadfa-bin:change :function) (xref yadfa-bin:lst :function))
(handle-query ((selected-user (if user
(nth user (allies-of *game*))
(player-of *game*)))
(item (typecase inventory
(unsigned-byte
(nth inventory (inventory-of (player-of *game*))))
(type-specifier
(find inventory (inventory-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier))))))
i a
(wear-length (list-length (wear-of selected-user))))
(*query-io* ((when (list-length-> 1 (inventory-of (player-of *game*)))
(format t "~a doesn't have any clothes to put on~%" (name-of selected-user))
(return-from yadfa-bin:wear))
())
((not item)
(inventory)
:prompt-text "Enter a different item"
:error-text "INVENTORY isn't a valid item")
((not (typep item 'clothing))
(inventory)
:prompt-text "Enter a different item"
:error-text (format nil "That ~a isn't something you can wear~%" (name-of item)))
((< wear-length wear)
(wear)
:prompt-text "Enter a different index"
:error-text (format nil "“:WEAR ~d” doesn't refer to a valid position as it can't go past the items you're current wearing which is currently ~d"
wear
wear-length)))
(cond ((let ((not-wear (typecase (must-not-wear*-of (get-zone (position-of (player-of *game*))))
(cons (must-not-wear*-of (get-zone (position-of (player-of *game*)))))
(symbol (gethash (must-not-wear*-of *game*) (must-not-wear*-of (get-zone (position-of (player-of *game*)))))))))
(and (typep item (car not-wear)) (not (funcall (coerce (cdr not-wear) 'function) selected-user))))
(return-from yadfa-bin:wear))
((and (> wear 0) (iter (for i in (butlast (wear-of selected-user) (- wear-length wear)))
(when (and (typep i 'closed-bottoms) (lockedp i))
(format t "~a can't remove ~a ~a to put on ~a ~a as it's locked~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of i)
(if (malep selected-user) "his" "her")
(name-of item))
(leave t))))
(return-from yadfa-bin:wear)))
(setf a (insert (wear-of selected-user) item wear)
i (iter (for outer in (reverse (subseq a 0 (1+ wear))))
(with b = (reverse a))
(when (and (typep outer 'bottoms) (thickness-capacity-of outer) (> (fast-thickness b outer) (thickness-capacity-of outer)))
(leave (thickest (cdr (s:memq outer a)))))))
(if i
(format t "~a struggles to fit ~a ~a over ~a ~a in a hilarious fashion but fail to do so.~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of item)
(if (malep selected-user) "his" "her")
(name-of i))
(progn (when *battle*
(format t "The ~a you're battling stops and waits for you to put on your ~a because Pouar never prevented this function from being called in battle~%"
(if (list-length-< 1 (enemies-of *battle*)) "enemies" "enemy")
(name-of item)))
(format t "~a puts on ~a ~a~%" (name-of selected-user) (if (malep selected-user) "his" "her") (name-of item))
(a:deletef (inventory-of (player-of *game*)) item :count 1)
(setf (wear-of selected-user) a)))))
(defunassert yadfa-bin:unwear (&key (inventory 0) (wear 0) user)
(user (or unsigned-byte null)
inventory unsigned-byte
wear (or type-specifier unsigned-byte))
#.(format nil "Unwear an item you're wearing. @var{INVENTORY} is the index you want to place this item. @var{WEAR} is the index of the item you're wearing that you want to remove. You can also set @var{WEAR} to a type specifier for the outer most clothing of that type. @var{USER} is a integer referring to the index of an ally. Leave at @code{NIL} to refer to yourself
~a, ~a, and ~a."
(xref yadfa-bin:wear :function) (xref yadfa-bin:change :function) (xref yadfa-bin:lst :function))
(handle-query ((selected-user (if user
(nth user (allies-of *game*))
(player-of *game*)))
(item (typecase wear
(unsigned-byte
(nth wear (wear-of (player-of *game*))))
(type-specifier
(find wear (wear-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier))))))
(inventory-length (list-length (inventory-of (player-of *game*)))))
(*query-io* ((when (list-length-> 1 (wear-of selected-user))
(format t "~a isn't wearing any clothes to remove~%" (name-of selected-user))
(return-from yadfa-bin:unwear))
())
((not item)
(wear)
:prompt-text "Enter a different item"
:error-text "WEAR isn't a valid item")
((< inventory-length inventory)
(inventory)
:prompt-text "Enter a different index"
:error-text (format nil "“:INVENTORY ~d” doesn't refer to a valid position as it can't go past the items you currently have in your inventory which is currently ~d~%"
inventory inventory-length)))
(cond ((and
(not (eq (player-of *game*) selected-user))
(typep item 'diaper)
(typep user '(not potty-trained-team-member))
(list-length-> 2 (filter-items (wear-of selected-user) 'diaper)))
(format t "Letting ~a go without padding is a really bad idea. Don't do it.~%"
(name-of selected-user))
(return-from yadfa-bin:unwear))
((let ((wear (typecase (must-wear*-of (get-zone (position-of (player-of *game*))))
(cons (must-wear*-of (get-zone (position-of (player-of *game*)))))
(symbol (gethash (must-wear*-of *game*)
(must-wear*-of (get-zone (position-of (player-of *game*)))))))))
(and (typep item (car wear))
(list-length->= 1 (filter-items (wear-of selected-user) (car wear)))
(not (funcall (coerce (cdr wear) 'function) selected-user))))
(return-from yadfa-bin:unwear))
((iter (for i in (butlast (wear-of selected-user) (- (list-length (wear-of selected-user)) (position item (wear-of selected-user)) 1)))
(when (and (typep i 'closed-bottoms) (lockedp i))
(format t "~a can't remove ~a ~a to take off ~a ~a as it's locked~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of i)
(if (malep selected-user) "his" "her")
(name-of item))
(leave t)))
(return-from yadfa-bin:unwear)))
(when *battle*
(format t "The ~a you're battling stops and waits for you to take off your ~a because Pouar never prevented this function from being called in battle~%"
(if (list-length-< 1 (enemies-of *battle*))
"enemies"
"enemy")
(name-of item)))
(format t "~a takes off ~a ~a~%" (name-of selected-user) (if (malep selected-user) "his" "her") (name-of item))
(a:deletef (wear-of (player-of *game*)) item :count 1)
(insertf (inventory-of (player-of *game*)) item inventory)))
(defunassert yadfa-bin:change (&key (inventory 0) (wear 0) user)
(user (or null unsigned-byte)
inventory (or type-specifier unsigned-byte)
wear (or type-specifier unsigned-byte))
#.(format nil "Change one of the clothes you're wearing with one in your inventory. @var{WEAR} is the index of the clothing you want to replace. Smaller index refers to outer clothing. @var{INVENTORY} is an index in your inventory of the item you want to replace it with. You can also give @var{INVENTORY} and @var{WEAR} a quoted symbol which can act as a type specifier which will pick the first item in your inventory of that type. @var{USER} is an index of an ally. Leave this at @code{NIL} to refer to yourself.
~a, ~a, and ~a."
(xref yadfa-bin:unwear :function) (xref yadfa-bin:wear :function) (xref yadfa-bin:lst :function))
(handle-query ((selected-user (if user
(nth user (allies-of *game*))
(player-of *game*)))
(inventory (typecase inventory
(unsigned-byte
(nth inventory (inventory-of (player-of *game*))))
(type-specifier
(find inventory (inventory-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier))))))
(wear (typecase wear
(unsigned-byte
(nth wear (wear-of (player-of *game*))))
(type-specifier
(find wear (wear-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier))))))
i a)
(*query-io* ((when (list-length-> 1 (wear-of selected-user))
(format t "~a isn't wearing any clothes to change~%" (name-of selected-user))
(return-from yadfa-bin:change))
())
((not inventory)
(inventory)
:prompt-text "Enter a different item"
:error-text "INVENTORY isn't valid")
((not wear)
(inventory)
:prompt-text "Enter a different item"
:error-text "WEAR isn't valid")
((not (typep inventory 'clothing))
(inventory)
:prompt-text "Enter a different item"
:error-text (format nil "That ~a isn't something you can wear" (name-of inventory))))
(cond ((and
(typep selected-user '(not potty-trained-team-member))
(typep inventory 'pullup)
(typep wear 'diaper)
(list-length-> 2 (filter-items (wear-of selected-user) 'diaper)))
(format t "Does ~a look ready for pullups to you?~%" (name-of selected-user))
(return-from yadfa-bin:change))
((and
(typep selected-user '(not potty-trained-team-member))
(not (typep inventory 'diaper))
(typep wear 'diaper)
(list-length-> 2 (filter-items (wear-of selected-user) 'diaper)))
(format t "letting ~a go without padding is a really bad idea. Don't do it.~%" (name-of selected-user))
(return-from yadfa-bin:change))
((let ((wear (typecase (must-wear*-of (get-zone (position-of (player-of *game*))))
(cons (must-wear*-of (get-zone (position-of (player-of *game*)))))
(symbol (gethash (must-wear*-of *game*) (must-wear*-of (get-zone (position-of (player-of *game*))))))))
(not-wear (typecase (must-not-wear*-of (get-zone (position-of (player-of *game*))))
(cons (must-not-wear*-of (get-zone (position-of (player-of *game*)))))
(symbol (gethash (must-not-wear*-of *game*) (must-not-wear*-of (get-zone (position-of (player-of *game*)))))))))
(or (and (not (typep inventory (car wear)))
(typep wear (car wear))
(list-length->= 1 (filter-items (wear-of selected-user) (car wear)))
(not (funcall (coerce (cdr not-wear) 'function) selected-user)))
(and (typep inventory (car not-wear)) (not (funcall (coerce (cdr not-wear) 'function) selected-user)))))
(return-from yadfa-bin:change))
((and
(iter (for i in (butlast (wear-of selected-user) (- (list-length (wear-of selected-user)) (position wear (wear-of selected-user)) 1)))
(when (and (typep i 'closed-bottoms) (lockedp i))
(format t "~a can't remove ~a ~a to put on ~a ~a as it's locked~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of i)
(if (malep selected-user) "his" "her")
(name-of inventory))
(leave t))))
(return-from yadfa-bin:change)))
(setf a (substitute inventory wear (wear-of selected-user) :count 1)
i (iter (for outer in (reverse (subseq a 0 (1+ (position inventory a)))))
(with b = (reverse a))
(when (and (typep outer 'bottoms) (thickness-capacity-of outer) (> (fast-thickness b outer) (thickness-capacity-of outer)))
(leave outer))))
(if i
(format t
"~a struggles to fit ~a ~a over ~a ~a in a hilarious fashion but fail to do so.~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of i)
(if (malep selected-user) "his" "her")
(name-of inventory))
(progn (when *battle*
(format t "The ~a you're battling stops and waits for you to put on your ~a because Pouar never prevented this function from being called in battle~%"
(if (list-length-< 1 (enemies-of *battle*)) "enemies" "enemy")
(name-of inventory)))
(format t "~a changes out of ~a ~a and into ~a ~a~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of wear)
(if (malep selected-user) "his" "her")
(name-of inventory))
(substitutef (inventory-of selected-user) wear inventory :count 1)
(setf (wear-of selected-user) a)))))
(defunassert yadfa-bin:toss (&rest items)
(items list)
"Throw an item in your inventory away. @var{ITEM} is the index of the item in your inventory"
(let ((value (iter (for i in items)
(unless (typep i 'unsigned-byte)
(leave i)))))
(when value
(error 'type-error :datum value :expected-type 'unsigned-byte)))
(let ((items (sort (remove-duplicates items) #'<)))
(setf items (iter (generate i in items)
(for j in (inventory-of (player-of *game*)))
(for (the fixnum k) upfrom 0)
(when (first-iteration-p)
(next i))
(when (= k i)
(collect j)
(next i))))
(unless items
(format t "Those items aren't valid")
(return-from yadfa-bin:toss))
(iter (for i in items)
(unless (tossablep i)
(format t "To avoid breaking the game, you can't toss your ~a." (name-of i))
(return-from yadfa-bin:toss)))
(iter (for i in items)
(format t "You send ~a straight to /dev/null~%" (name-of i)))
(a:deletef (inventory-of (player-of *game*)) items
:test (lambda (o e)
(s:memq e o)))))
(defunassert yadfa-bin:wield (&key user inventory)
(user (or unsigned-byte null)
inventory (or unsigned-byte type-specifier))
"Wield an item. Set @var{INVENTORY} to the index or a type specifier of an item in your inventory to wield that item. Set @var{USER} to the index of an ally to have them to equip it or leave it @code{NIL} for the player."
(let* ((selected-user (if user
(nth user (allies-of *game*))
(player-of *game*)))
(item (typecase inventory
(unsigned-byte
(nth inventory (inventory-of (player-of *game*))))
((or list (and symbol (not keyword)))
(find inventory (inventory-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier)))))))
(cond ((not item)
(format t "INVENTORY isn't valid~%")
(return-from yadfa-bin:wield)))
(when *battle*
(format t "The ~a you're battling stops and waits for you to equip your ~a because Pouar never prevented this function from being called in battle~%"
(if (list-length-< 1 (enemies-of *battle*)) "enemies" "enemy")
(name-of item)))
(format t "~a equips his ~a ~a~%"
(name-of selected-user)
(if (malep selected-user) "his" "her")
(name-of item))
(a:deletef (inventory-of (player-of *game*)) item :count 1)
(when (wield-of selected-user)
(push (wield-of selected-user) (inventory-of (player-of *game*))))
(setf (wield-of selected-user) item)))
(defunassert yadfa-bin:unwield (&key user)
(user (or integer null))
"Unwield an item. Set @var{USER} to the index of an ally to have them to unequip it or leave it @code{NIL} for the player."
(let ((selected-user
(if user
(nth user (allies-of *game*))
(player-of *game*))))
(if (wield-of selected-user)
(progn (push (wield-of selected-user)
(inventory-of (player-of *game*)))
(setf (wield-of selected-user) nil))
(format t "~a hasn't equiped a weapon~%" (name-of selected-user)))))
(defunassert yadfa-bin:pokedex (&optional enemy)
(enemy symbol)
"Browse enemies in your pokedex, @var{ENEMY} is a quoted symbol that is the same as the class name of the enemy you want to view. Leave it to @code{NIL} to list available entries"
(if enemy
(let ((a (if (s:memq enemy (seen-enemies-of *game*))
(make-instance enemy)
(progn (write-line "That enemy isn't in your pokedex")
(return-from yadfa-bin:pokedex)))))
(format t "Name: ~a~%Species: ~a~%Description: ~a~%" (name-of a) (species-of a) (description-of a)))
(progn (format t "~30a~30a~%" "ID" "Name")
(iter (for i in (seen-enemies-of *game*))
(let ((a (make-instance i)))
(format t "~30a~30a~%" i (name-of a)))))))
(defunassert yadfa-bin:toggle-lock (wear key &optional user)
(wear unsigned-byte
key unsigned-byte
user (or unsigned-byte null))
"Toggle the lock on one of the clothes a user is wearing. @var{WEAR} is the index of an item a user is wearing, @var{KEY} is the index of a key in your inventory, @var{USER} is a number that is the index of an ally, leave this to @code{NIL} to select the player."
(let* ((selected-user (if user (nth user (allies-of *game*)) (player-of *game*)))
(wear-length (list-length (wear-of selected-user)))
(inventory-length (list-length (inventory-of (player-of *game*))))
(selected-key (nth key (inventory-of (player-of *game*))))
(selected-wear (nth wear (wear-of selected-user))))
(cond ((not selected-user)
(format t "You only have ~d allies~%" (list-length (allies-of *game*))))
((not (>= wear-length wear))
(format t "~a is only wearing ~d items~%" (name-of selected-user) wear-length))
((not (>= inventory-length key))
(format t "You only have ~d items in your inventory~%" inventory-length))
((not (typep selected-key (key-of selected-wear)))
(write-line "That doesn't go with that"))
((lockedp selected-wear)
(format t "~a's ~a is now unlocked~%" (name-of selected-user) (name-of selected-wear))
(setf (lockedp selected-wear) nil))
((typep selected-wear 'closed-bottoms)
(write-line "That can't be locked"))
(t
(format t "~a's ~a is now locked~%" (name-of selected-user) (name-of selected-wear))
(setf (lockedp selected-wear) t)))))
| 43,226 | Common Lisp | .lisp | 675 | 44.654815 | 1,161 | 0.504184 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 9ee1693afcbeba2190b8a8d2d1af979e2c4d312e0c90cbe91e7afed69890145b | 15,653 | [
-1
] |
15,654 | world.lisp | pouar_yadfa/core/bin/world.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defunassert yadfa-world:save-game (path)
(path (or simple-string pathname))
#.(format nil "This function saves current game to @var{PATH}
~a."
(xref yadfa-world:load-game :function))
(ensure-directories-exist (make-pathname :host (pathname-host path) :device (pathname-device path) :directory (pathname-directory path)))
(a:with-output-to-file (s path :if-exists :supersede :external-format :utf-8)
(write-string (write-to-string (ms:marshal *game*)) s))
(typecase path
(logical-pathname (translate-logical-pathname path))
(pathname path)
(simple-string (handler-case (translate-logical-pathname path)
(type-error () (parse-namestring path))
(file-error () nil)))))
(defunassert yadfa-world:load-game (path)
(path (or simple-string pathname))
#.(format nil "This function loads a saved game from @var{PATH}
~a."
(xref yadfa-world:save-game :function))
(a:with-input-from-file (stream path)
(setf *game* (ms:unmarshal (read stream))))
(typecase path
(logical-pathname (translate-logical-pathname path))
(pathname path)
(simple-string (handler-case (translate-logical-pathname path)
(type-error () (parse-namestring path))
(file-error () nil)))))
(defunassert yadfa-world:move (&rest directions)
(directions list)
#.(format nil "type in the direction as a keyword to move in that direction, valid directions can be found with @code{(lst :directions t)}.
You can also specify multiple directions, for example @code{(move :south :south)} will move 2 zones south. @code{(move :south :west :south)} will move south, then west, then south.
~a."
(xref yadfa-bin:lst :function))
(iter (for direction in directions)
(multiple-value-bind (new-position error) (get-path-end (get-destination direction (position-of (player-of *game*))) (position-of (player-of *game*)) direction)
(let* ((old-position (position-of (player-of *game*))))
(unless new-position
(format t "~a" error)
(return-from yadfa-world:move))
(move-to-zone new-position :direction direction :old-position old-position)))))
(defunassert yadfa-world:place-prop (prop indicator)
(prop (or unsigned-byte type-specifier) indicator symbol)
(let ((position (position-of (player-of *game*))))
(handle-query ((selected-prop (s:dispatch-case ((prop (or unsigned-byte type-specifier)))
((unsigned-byte) (nth prop (inventory-of (player-of *game*))))
((type-specifier) (find prop (inventory-of (player-of *game*)) :test (lambda (o e)
(typep e o)))))))
(*query-io* ((typep selected-prop '(not placable-prop))
(prop)
:prompt-text "Enter a different prop, either as a type specifier or an index of your inventory"
:error-text "Either that prop doesn't exist or it isn't placable")
((or (not (eq (symbol-package indicator) (find-package :yadfa-user))) (getf (props-of (get-zone position)) indicator))
(indicator)
:prompt-text "Enter the property indicator for the prop you want to place"
:error-text "Either there's already a prop there or you picked a symbol that's not in the YADFA-USER package as the property indicator"))
(a:deletef (inventory-of (player-of *game*)) selected-prop :count 1 :test 'eq)
(setf (getf (props-of (get-zone position)) indicator) selected-prop)
selected-prop)))
(defunassert yadfa-world:take-prop (indicator)
(indicator symbol)
(let ((position (position-of (player-of *game*))))
(handle-query ((selected-prop (getf (props-of (get-zone position)) indicator)))
(*query-io* ((and #-sbcl (symbolp indicator) (typep selected-prop '(not placable-prop)))
(indicator)
:prompt-text "Enter the property indicator for the prop you want to take"
:error-text "Either there's already a prop there, the prop you picked isn't a YADFA:PLACABLE-PROP or the property indicator you picked is not a symbol"))
(remf (props-of (get-zone position)) indicator)
(push selected-prop (inventory-of (player-of *game*)))
selected-prop)))
(defunassert yadfa-world:interact (prop &rest keys &key list take action describe-action describe &allow-other-keys)
(action (or keyword null)
describe-action (or keyword null)
prop symbol
describe boolean
take (or null keyword list))
#.(format nil "interacts with @var{PROP}. @var{PROP} is a keyword, you can get these with @code{LST} with the @var{PROPS} parameter. setting @var{LIST} to non-NIL will list all the items and actions in the prop. you can take the items with the @var{TAKE} parameter. Setting this to an integer will take the item at that index, while setting it to @code{:ALL} will take all the items, setting it to @code{:BITCOINS} will take just the bitcoins. You can get this index with the @var{LIST} parameter. @var{ACTION} is a keyword referring to an action to perform, can also be found with the @var{LIST} parameter. You can also specify other keys when using @var{ACTION} and this function will pass those keys to that function. set @var{DESCRIBE-ACTION} to the keyword of the action to find out how to use it. Set @var{DESCRIBE} to @code{T} to print the prop's description.
~a."
(xref yadfa-bin:lst :function))
(when (typep take 'list) (loop for i in take do (check-type i unsigned-byte)))
(flet ((format-table (header &rest body)
(c:formatting-table (t :x-spacing 20)
(c:with-text-style (*query-io* (c:make-text-style nil :bold nil))
(c:formatting-row ()
(iter (for cell in header)
(c:formatting-cell ()
(typecase cell
(string (write-string cell))
(t (write cell)))))))
(iter (for row in body)
(c:formatting-row ()
(iter (for cell in row)
(c:formatting-cell ()
(typecase cell
(string (write-string cell))
(t (write cell))))))))))
(when list
(with-effective-frame
(format t "Bitcoins: ~a~%~%" (get-bitcoins-from-prop prop (position-of (player-of *game*))))
(apply #'format-table '("Index" "Name" "Class")
(iter (for i in (get-items-from-prop prop (position-of (player-of *game*))))
(for (the fixnum j) upfrom 0)
(collect (list j (name-of i) (type-of i)))))
(format t "~%~%Actions: ")
(iter (for (key value) on (actions-of (getf (get-props-from-zone (position-of (player-of *game*))) prop)) by #'cddr)
(when value
(format t "~s " key)
(finally (write-char #\Newline))))))
(when take
(cond ((eq take :all)
(setf (inventory-of (player-of *game*)) (append* (get-items-from-prop prop (position-of (player-of *game*))) (inventory-of (player-of *game*))))
(setf (get-items-from-prop prop (position-of (player-of *game*))) '())
(incf (bitcoins-of (player-of *game*)) (get-bitcoins-from-prop prop (position-of (player-of *game*))))
(setf (get-bitcoins-from-prop prop (position-of (player-of *game*))) 0))
((eq take :bitcoins)
(incf (bitcoins-of (player-of *game*)) (get-bitcoins-from-prop prop (position-of (player-of *game*))))
(setf (get-bitcoins-from-prop prop (position-of (player-of *game*))) 0))
(t
(iter (for i in take)
(push (nth i (get-items-from-prop prop (position-of (player-of *game*)))) (inventory-of (player-of *game*))))
(iter (for i in (sort (copy-tree take) #'>))
(setf (get-items-from-prop prop (position-of (player-of *game*))) (remove-nth i (get-items-from-prop prop (position-of (player-of *game*)))))))))
(when action
(apply (coerce (action-lambda (getf-action-from-prop (position-of (player-of *game*)) prop action))
'function)
(getf (get-props-from-zone (position-of (player-of *game*))) prop)
:allow-other-keys t keys))
(when describe-action
(format t "Keyword: ~a~%~%Other Parameters: ~w~%~%Documentation: ~a~%~%Describe: ~a~%~%"
describe-action
(rest (lambda-list (action-lambda (getf-action-from-prop (position-of (player-of *game*)) prop describe-action))))
(documentation (getf (actions-of (getf (get-props-from-zone (position-of (player-of *game*))) prop)) describe-action) t)
(with-output-to-string (s)
(let ((*standard-output* s))
(describe (action-lambda (getf-action-from-prop (position-of (player-of *game*)) prop describe-action)))))))
(when describe
(format t "~a~%" (description-of (getf (get-props-from-zone (position-of (player-of *game*))) prop))))))
(defunassert yadfa-world:stats (&optional user)
(user (or unsigned-byte boolean))
"Prints the current stats, essentially this game's equivalent of a health and energy bar in battle. Set @var{USER} to the index of an ally to show that ally's stats or set it to @code{T} to show your stats, leave it at @code{NIL} to show everyone's stats"
(cond ((eq user t)
(present-stats (player-of *game*)))
(user
(present-stats (nth user (allies-of *game*))))
(t
(iter (for i in (cons (player-of *game*) (allies-of *game*)))
(present-stats i)))))
(defunassert yadfa-world:go-potty (&key prop wet mess pull-pants-down user)
(user (or null real)
prop (or null keyword)
wet (or boolean real)
mess (or boolean real))
"Go potty. @var{PROP} is a keyword identifying the prop you want to use. If it's a toilet, use the toilet like a big boy. if it's not. Go potty on it like an animal. If you want to wet yourself, leave @var{PROP} as @code{NIL}. @var{WET} is the amount you want to pee in ml. @var{MESS} is the amount in cg, set @var{WET} and/or @var{MESS} to @code{T} to empty yourself completely. set @var{PULL-PANTS-DOWN} to non-NIL to pull your pants down first. @var{USER} is the index value of an ALLY you have. Set this to @code{NIL} if you're referring to yourself"
(let ((this-prop (getf (get-props-from-zone (position-of (player-of *game*))) prop))
(selected-user (if user
(nth user (allies-of *game*))
(player-of *game*))))
(when (and prop (not this-prop))
(format t "that PROP doesn't exist in this zone~%")
(return-from yadfa-world:go-potty))
(typecase this-prop
(yadfa-props:toilet
(potty-on-toilet this-prop
:wet (if user t wet)
:mess (if user t mess)
:pants-down pull-pants-down
:user selected-user))
(t
(potty-on-self-or-prop this-prop
:wet (if user t wet)
:mess (if user t mess)
:pants-down pull-pants-down
:user selected-user)))))
(defunassert yadfa-world:tickle (ally)
(ally unsigned-byte)
"Tickle an ally. @var{ALLY} is an integer that is the index of you allies"
(when (list-length-> ally (allies-of *game*))
(write-line "That ally doesn't exist")
(return-from yadfa-world:tickle))
(let ((selected-ally (nth ally (allies-of *game*))))
(cond ((getf (attributes-of selected-ally) :not-ticklish)
(format t "~a isn't ticklish"
(name-of selected-ally)))
((>= (bladder/contents-of selected-ally) (bladder/potty-dance-limit-of selected-ally))
(format t "~a: Gah! No! Stop! *falls over and laughs while thrashing about then uncontrollably floods ~aself like an infant*~%~%*~a stops tickling*~%~%~a: Looks like the baby wet ~aself~%~%*~a slowly stands up while still wetting ~aself and grumbles*~%~%"
(name-of selected-ally)
(if (malep selected-ally) "him" "her")
(name-of (player-of *game*))
(name-of (player-of *game*))
(if (malep selected-ally) "him" "her")
(name-of selected-ally)
(if (malep selected-ally) "him" "her"))
(wet :wetter selected-ally))
((and (>= (bladder/contents-of selected-ally) (bladder/need-to-potty-limit-of selected-ally)) (= (random 5) 0))
(format t "~a: Gah! No! Stop! *falls over and laughs while thrashing about for about 30 seconds then uncontrollably floods ~aself like an infant*~%~%*~a stops tickling*~%~%~a: Looks like the baby wet ~aself~%~%*~a slowly stands up while still wetting ~aself and grumbles*~%~%"
(name-of selected-ally)
(if (malep selected-ally) "him" "her")
(name-of (player-of *game*))
(name-of (player-of *game*))
(if (malep selected-ally) "him" "her")
(name-of selected-ally)
(if (malep selected-ally) "him" "her"))
(wet :wetter selected-ally))
(t
(format t "~a: Gah! No! Stop! *falls over and laughs while thrashing about for a few minutes until you get bored and stop*~%~%*~a slowly stands up exhausted from the tickling and grumbles*~%~%"
(name-of selected-ally)
(name-of selected-ally))))))
(defunassert yadfa-world:wash-all-in (&optional prop)
(prop (or keyword null))
"washes your dirty diapers and all the clothes you've ruined. @var{PROP} is a keyword identifying the washer you want to put it in. If you're washing it in a body of water, leave @var{PROP} out."
(cond
((and prop (not (typep (getf (get-props-from-zone (position-of (player-of *game*))) prop) 'yadfa-props:washer)))
(write-line "That's not a washer"))
((and (not prop) (not (underwaterp (get-zone (position-of (player-of *game*)))))) (format t "There's no where to wash that~%"))
((underwaterp (get-zone (position-of (player-of *game*))))
(wash (inventory-of (player-of *game*)))
(write-line "You washed all your soggy and messy clothing. Try not to wet and mess them next time"))
(t (wash-in-washer (getf (get-props-from-zone (position-of (player-of *game*))) prop)))))
(defunassert yadfa-world:place (prop &rest items)
(items list
prop symbol)
"Store items in a prop. @var{ITEMS} is a list of indexes of the items in your inventory. @var{PROP} is a keyword"
(let ((value (iter (for i in items)
(unless (typep i 'integer)
(leave i)))))
(when value
(error 'type-error :datum value :expected-type 'integer)))
(iter (for i in items) (check-type i integer))
(unless (getf (get-props-from-zone (position-of (player-of *game*))) prop)
(write-line "That prop doesn't exist")
(return-from yadfa-world:place))
(unless (placeablep (getf (get-props-from-zone (position-of (player-of *game*))) prop))
(write-line "To avoid breaking the game, you can't place that item here.")
(return-from yadfa-world:place))
(let ((items (sort (remove-duplicates items) #'<)))
(setf items (iter (generate i in items)
(for j in (player-of *game*))
(for (the fixnum k) upfrom 0)
(when (first-iteration-p)
(next i))
(when (= k i)
(collect j)
(next i))))
(unless items
(format t "Those items aren't valid")
(return-from yadfa-world:place))
(iter (for i in items)
(format t "You place your ~a on the ~a~%" (name-of i) (name-of (getf (get-props-from-zone (position-of (player-of *game*))) prop)))
(push i (get-items-from-prop prop (position-of (player-of *game*)))))
(a:deletef (inventory-of (player-of *game*)) items
:test (lambda (o e)
(s:memq e o)))))
(defunassert yadfa-world:use-item (item &rest keys &key user action &allow-other-keys)
(item (or unsigned-byte type-specifier)
action (or null keyword)
user (or null unsigned-byte))
"Uses an item. @var{ITEM} is an index of an item in your inventory. @var{USER} is an index of an ally. Setting this to @code{NIL} will use it on yourself. @var{ACTION} is a keyword when specified will perform a special action with the item, all the other keys specified in this function will be passed to that action. @var{ACTION} doesn't work in battle."
(declare (ignorable action))
(handle-query ((selected-item (typecase item
(unsigned-byte
(nth item (inventory-of (player-of *game*))))
(type-specifier
(find item (inventory-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier))))))
(allies-length (list-length (allies-of *game*))))
(*query-io* ((null selected-item)
(item)
:prompt-text "Enter a different item"
:error-text (format nil "You only have ~a items" (length (inventory-of (player-of *game*)))))
((and user (< allies-length user))
(user)
:prompt-text "Enter a different user"
:error-text (format nil "You only have ~d allies" allies-length)))
(let ((this-user (if user (nth user (allies-of *game*)) (player-of *game*))))
(handler-case (progn
(multiple-value-bind (cant-use plist) (apply 'cant-use-p selected-item (player-of *game*) this-user (getf keys :action) keys)
(when cant-use
(destructuring-bind (&key format-control format-arguments &allow-other-keys) plist
(if format-control
(apply 'format t format-control format-arguments)
(write-line "You can't do that with that item"))
(fresh-line)
(return-from yadfa-world:use-item))))
(let ((ret (apply #'use-item% selected-item (player-of *game*)
:target this-user
keys)))
(incf (time-of *game*))
(iter (for i in (cons (player-of *game*) (allies-of *game*)))
(process-potty i nil))
ret))
(unusable-item (c)
(princ c))))))
(defunassert yadfa-world:reload (ammo-type &optional user)
(ammo-type (and type-specifier (not null))
user (or unsigned-byte null))
(let* ((user (if user
(nth user (allies-of *game*))
(player-of *game*)))
(user-name (name-of user))
(weapon (wield-of user))
(weapon-ammo-type (ammo-type-of weapon))
(weapon-capacity (ammo-capacity-of weapon))
(weapon-name (name-of weapon))
(reload-count (reload-count-of weapon))
(player (player-of *game*)))
(unless (wield-of user)
(format t "~a isn't carrying a weapon~%" user-name)
(return-from yadfa-world:reload))
(unless (and weapon-ammo-type (> weapon-capacity 0))
(format t "~a's ~a doesn't take ammo~%" user-name weapon-name)
(return-from yadfa-world:reload))
(when (list-length-<= weapon-capacity (ammo-of (wield-of user)))
(format t "~a's ~a is already full~%" user-name weapon-name)
(return-from yadfa-world:reload))
(unless (subtypep ammo-type weapon-ammo-type)
(format t "~a ~a doesn't take that ammo~%" user-name weapon-name)
(return-from yadfa-world:reload))
(unless (iter (for i in (inventory-of player))
(when (typep i ammo-type)
(leave t)))
(format t "~a doesn't have that ammo~%" user-name)
(return-from yadfa-world:reload))
(format t "~a reloaded ~a ~a" user-name (if (malep user) "his" "her") weapon-name)
(iter (with count = 0)
(for item in (inventory-of player))
(when (or (list-length-<= weapon-capacity (ammo-of weapon))
(and reload-count (>= count reload-count)))
(leave t))
(when (and (typep item ammo-type) (typep item weapon-ammo-type))
(push item (ammo-of weapon))
(a:deletef item (inventory-of player) :count 1)))))
(defunassert yadfa-world:add-ally-to-team (ally-index)
(ally-index unsigned-byte)
"Adds an ally to your battle team. @var{ALLY-INDEX} is the index of an ally in your list of allies"
(let ((allies-length (list-length (allies-of *game*))))
(if (< allies-length ally-index)
(format t "You only have ~d allies~%" allies-length)
(let* ((ally (nth ally-index (allies-of *game*)))
(old (car (team-of *game*)))
(new (car (pushnew ally (team-of *game*) :test 'eq))))
(if (eq old new)
(format t "~a is already on the battle team~%" (name-of ally))
(format t "~a has joined the battle team~%" (name-of ally)))))))
(defunassert yadfa-world:remove-ally-from-team (team-index)
(team-index unsigned-byte)
"Removes an ally to your battle team. @var{TEAM-INDEX} is the index of an ally in your battle team list"
(let ((team-length (list-length (team-of *game*))))
(cond
((>= team-index team-length)
(format t "You only have ~d members in your team~%" team-length)
(return-from yadfa-world:remove-ally-from-team))
((eq (nth team-index (team-of *game*)) (player-of *game*))
(write-line "You can't remove the player from the team")
(return-from yadfa-world:remove-ally-from-team))
(t (setf (team-of *game*) (remove-nth team-index (team-of *game*)))))))
(defunassert yadfa-world:swap-team-member (team-index-1 team-index-2)
(team-index-1 unsigned-byte
team-index-2 unsigned-byte)
"swap the positions of 2 battle team members. @var{TEAM-INDEX-1} and @var{TEAM-INDEX-2} are the index numbers of these members in your battle team list"
(cond ((or (list-length-> team-index-1 (team-of *game*)) (list-length-> team-index-2 (team-of *game*)))
(format t "You only have ~d members in your team~%" (list-length (team-of *game*)))
(return-from yadfa-world:swap-team-member))
((= team-index-1 team-index-2)
(write-line "Those refer to the same team member")
(return-from yadfa-world:swap-team-member))
(t (rotatef (nth team-index-1 (team-of *game*)) (nth team-index-2 (team-of *game*))))))
(defunassert yadfa-world:fart (&optional user)
(user (or unsigned-byte type-specifier))
(handle-query ((selected-user (typecase user
(null (player-of *game*))
(unsigned-byte (nth user (allies-of *game*)))
(type-specifier (find user (cons (player-of *game*) (allies-of *game*))
:test (lambda (o e)
(typep e o)))))))
(*query-io* ((null selected-user)
(user)
:prompt-text "Enter a different user"
:error-text (typecase user
(unsigned-byte (f:fmt nil "You only have " (length (allies-of *game*)) " allies"))
(type-specifier "you don't have that ally"))))
(multiple-value-bind (result mess) (fart user)
(fart-result-text selected-user result mess))))
| 24,375 | Common Lisp | .lisp | 384 | 50.867188 | 868 | 0.588277 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5036ae94ff0ada04a40c057bf0f080a95543052a2add5172592ee8062ec34495 | 15,654 | [
-1
] |
15,655 | battle.lisp | pouar_yadfa/core/bin/battle.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defunassert yadfa-battle:fight (attack &key target friendly-target)
(target (or null unsigned-byte type-specifier)
friendly-target (or null unsigned-byte type-specifier)
attack (or symbol boolean))
"Use a move on an enemy. @var{ATTACK} is either a keyword which is the indicator to select an attack that you know, or @code{T} for default. @var{TARGET} is the index or type specifier of the enemy you're attacking. @var{FRIENDLY-TARGET} is a member on your team you're using the move on instead. Only specify either a @var{FRIENDLY-TARGET} or @var{TARGET}. Setting both might make the game's code unhappy"
(let ((selected-target (cond (target
(let ((a (typecase target
(unsigned-byte (nth target (enemies-of *battle*)))
(type-specifier (find target (enemies-of *battle*)
:test (lambda (o e)
(typep e o)))))))
(or a
(progn
(write-line "That target doesn't exist")
(return-from yadfa-battle:fight)))))
(friendly-target
(let ((a (typecase friendly-target
(unsigned-byte (nth friendly-target (team-of *game*)))
(type-specifier (find friendly-target (team-of *game*)
:test (lambda (o e)
(typep e o)))))))
(or a
(progn
(write-line "That target doesn't exist")
(return-from yadfa-battle:fight)))))
(t (iter (for i in (enemies-of *battle*))
(when (>= (health-of i) 0)
(leave i)))))))
(process-battle :attack attack :selected-target selected-target)))
(defunassert yadfa-battle:stats (&key user enemy)
(user (or unsigned-byte null)
enemy (or unsigned-byte null))
"Prints the current stats in battle, essentially this game's equivalent of a health and energy bar in battle. @var{USER} is the index of the member in your team, @var{ENEMY} is the index of the enemy in battle. Set both to @code{NIL} to show the stats for everyone."
(cond (user
(present-stats (nth user (team-of *game*))))
(enemy
(present-stats (nth enemy (enemies-of *battle*))))
(t
(format t "Your team:~%~%")
(iter (for i in (team-of *game*))
(present-stats i))
(format t "Their team:~%~%")
(iter (for i in (enemies-of *battle*))
(present-stats i)))))
(defun yadfa-battle:run ()
"Run away from a battle like a coward"
(cond ((continue-battle-of (get-zone (position-of (player-of *game*))))
(write-line "Can't run from this battle")
(return-from yadfa-battle:run))
((and (>=
(bladder/contents-of (player-of *game*))
(bladder/need-to-potty-limit-of (player-of *game*)))
(>=
(bowels/contents-of (player-of *game*))
(bowels/need-to-potty-limit-of (player-of *game*))))
(format t
"~a wet and messed ~aself in fear and ran away like a coward~%"
(name-of (player-of *game*))
(if (malep (player-of *game*))
"him"
"her"))
(wet)
(mess))
((>= (bladder/contents-of (player-of *game*)) (bladder/need-to-potty-limit-of (player-of *game*)))
(format t "~a wet ~aself in fear and ran away like a coward~%" (name-of (player-of *game*))
(if (malep (player-of *game*))
"him"
"her"))
(wet))
((>= (bowels/contents-of (player-of *game*)) (bowels/need-to-potty-limit-of (player-of *game*)))
(format t "~a messed ~aself in fear and ran away like a coward~%" (name-of (player-of *game*))
(if (malep (player-of *game*))
"him"
"her"))
(mess))
(t
(format t "~a ran away like a coward~%" (name-of (player-of *game*)))))
(s:nix *battle*)
(switch-user-packages))
(defunassert yadfa-battle:use-item (item &key target enemy-target)
(item (or unsigned-byte type-specifier)
target (or null unsigned-byte type-specifier)
enemy-target (or null unsigned-byte type-specifier))
"Uses an item. @var{ITEM} is an index of an item in your inventory. @var{TARGET} is an index or type specifier of a character in your team. Setting this to 0 will use it on yourself. @var{ENEMY-TARGET} is an index or type specifier of an enemy in battle if you're using it on an enemy in battle. Only specify either a @var{TARGET} or @var{ENEMY-TARGET}. Setting both might make the game's code unhappy"
(handle-query ((selected-item (typecase item
(unsigned-byte
(nth item (inventory-of (player-of *game*))))
(type-specifier
(find item (inventory-of (player-of *game*))
:test #'(lambda (type-specifier obj)
(typep obj type-specifier))))))
(selected-target (cond ((and target enemy-target)
(format t "Only specify TARGET or ENEMY-TARGET. Not both.")
(return-from yadfa-battle:use-item))
(enemy-target
(or (typecase enemy-target
(unsigned-byte (nth enemy-target (enemies-of *battle*)))
(type-specifier (find enemy-target (enemies-of *battle*)
:test (lambda (o e)
(typep e o)))))))
(target
(or (typecase target
(unsigned-byte (nth target (team-of *game*)))
(type-specifier (find target (team-of *game*)
:test (lambda (o e)
(typep e o)))))))
(t (iter (for i in (enemies-of *battle*))
(when (>= (health-of i) 0)
(leave i)))))))
(*query-io* ((not selected-item)
(item)
:error-text (format nil "You don't have that item~%")
:prompt-text "Enter a different item")
((and target (not selected-target))
(target)
:error-text "That target doesn't exist"
:prompt-text "Enter a different TARGET")
((and enemy-target (not selected-target))
(enemy-target)
:error-text "That target doesn't exist"
:prompt-text "Enter a different ENEMY-TARGET"))
(process-battle
:item selected-item
:selected-target selected-target)))
(defunassert yadfa-battle:reload (&optional ammo-type)
(ammo-type (or null type-specifier))
(let* ((inventory (inventory-of (player-of *game*)))
(user (first (turn-queue-of *battle*)))
(user-name (name-of user))
(weapon (wield-of user))
(weapon-name (name-of weapon))
(ammo-capacity (ammo-capacity-of (wield-of user)))
(weapon-ammo-type (ammo-type-of weapon)))
(unless weapon
(format t "~a isn't carrying a weapon~%" user-name)
(return-from yadfa-battle:reload))
(unless (and weapon-ammo-type (> ammo-capacity 0))
(format t "~a's ~a doesn't take ammo~%" user-name weapon-name)
(return-from yadfa-battle:reload))
(when
(list-length-<= ammo-capacity (ammo-of weapon))
(format t "~a's ~a is already full~%" user-name weapon-name)
(return-from yadfa-battle:reload))
(handle-query ((selected-ammo-type (or ammo-type
(iter (for i in inventory)
(when (typep i weapon-ammo-type)
(leave i)))
(progn (format t "~a doesn't have any ammo~%" (name-of user))
(return-from yadfa-battle:reload)))))
(*query-io*
((and ammo-type (not (subtypep ammo-type weapon-ammo-type)))
(ammo-type)
:error-text (format nil "~a ~a doesn't take that ammo"
user-name
weapon-name)
:prompt-text "Select different ammo")
((and ammo-type (iter (for i in inventory)
(when (typep i ammo-type)
(leave t))))
(ammo-type)
:error-text (format nil "~a doesn't have that ammo" user-name)
:prompt-text "Select different ammo"))
(process-battle :reload selected-ammo-type))))
| 10,049 | Common Lisp | .lisp | 165 | 39.133333 | 408 | 0.471975 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 4babe53358698a61faf9984d49b3989d47705db6d9cf8dc43e39613f6c98a207 | 15,655 | [
-1
] |
15,656 | hooks.lisp | pouar_yadfa/core/libexec/hooks.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(sc:define-hook-type move-command (function (symbol list) (values &rest t)))
(sc:define-hook 'hook-move-command 'yadfa-world:move)
| 232 | Common Lisp | .lisp | 4 | 57 | 80 | 0.701754 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 0747e9010eb23e6c220f237ea76b9c67a3d9dfab0360a2c4f2ea7958297aee3b | 15,656 | [
-1
] |
15,657 | declares.lisp | pouar_yadfa/core/libexec/declares.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(declaim (ftype (function () (values (eql t) &optional)) switch-user-packages go-to-sleep)
(ftype (function (list) (values (or zone null) t &optional)) get-zone)
(ftype (function (integer list) (values boolean &optional)) list-length-<= list-length-< list-length-> list-length->=)
(ftype (function ((or list symbol)) (values boolean &optional)) finished-events unfinished-events)
(ftype (function (closed-bottoms) (values real &optional)) get-diaper-expansion)
(ftype (function (t base-character &key (:duration (or null unsigned-byte)) (:test (or symbol function)) (:key (or symbol function)))
(values (eql t) &optional))
set-status-condition)
(ftype (function ((or symbol list)) (values list &optional)) trigger-event)
(ftype (function (symbol) (values list boolean &optional)) event-attributes)
(ftype (function (symbol list) (values list &optional)) get-warp-point get-destination)
(ftype (function (list &optional list symbol) (values list &optional string)) get-path-end)
(ftype (function (list symbol) (values boolean &optional)) travelablep)
(ftype (function ((or string coerced-function)) (values string &optional)) get-zone-text)
(ftype (function (list &optional list symbol) (values null &optional)) print-enter-text)
(ftype (function () (values list &optional)) get-inventory-list)
(ftype (function (list type-specifier) (values list &optional)) filter-items)
(ftype (function (base-character) (values list &optional)) swell-up% calculate-diaper-usage calculate-wear-stats
calculate-wield-stats calculate-stat-delta calculate-stat-multiplier)
(ftype (function (base-character) (values list symbol &optional)) swell-up)
(ftype (function (list clothing) (values real &optional)) fast-thickness)
(ftype (function (base-character &optional cons) (values list symbol &optional)) pop-from-expansion)
(ftype (function (list &optional (or null unsigned-byte)) (values list &optional)) thickest)
(ftype (function (&key (:wet-amount (or boolean real)) (:force-fill-amount (or null real)) (:pants-down t) (:accident t)
(:force-wet-amount (or boolean real)) (:wetter base-character) (:clothes list)) (values list &optional)) wet)
(ftype (function (&key (:mess-amount (or boolean real)) (:force-fill-amount (or null real)) (:pants-down t) (:accident t)
(:force-mess-amount (or boolean real)) (:messer base-character) (:clothes list)) (values list &optional)) mess)
(ftype (function (list) (values list &optional)) get-props-from-zone thickest-sort calculate-diaper-usage*)
(ftype (function (symbol list) (values list &optional)) get-items-from-prop)
(ftype (function (symbol list) (values real &optional)) get-bitcoins-from-prop)
(ftype (function (symbol base-character) (values (or move null) &optional)) get-move)
(ftype (function (real) (values real real &optional)) calculate-level-to-exp)
(ftype (function (enemy) (values real &optional)) calculate-exp-yield)
(ftype (function (base-character keyword) (values real real &optional)) calculate-stat)
(ftype (function (item &optional boolean) (values (eql t) &optional)) describe-item)
(ftype (function (&optional boolean) (values (eql t) &optional)) finish-battle)
(ftype (function (list) (values null &optional)) wash)
(ftype (function (base-character) (values cons &optional)) go-to-sleep%)
(ftype (function (base-character) (values boolean &optional)) handle-faint)
(ftype (function (base-character boolean) (values boolean &optional)) handle-status-effects)
(ftype (function (list symbol symbol) (values action &optional)) getf-action-from-prop)
(ftype (function (&key (:attack (or symbol boolean)) (:item item) (:reload type-specifier) (:no-team-attack t)
(:selected-target (or null enemy team-member))))
process-battle)
(ftype (function (ally) (values (eql t) &optional)) ally-join)
(ftype (function (simple-string boolean simple-string) (values (eql t) &optional)) set-player)
(ftype (function (list list) (values (member :super-effective :not-very-effective :no-effect nil) real &optional)) effective-type-effectiveness)
(ftype (function (t) (values list &optional)) coerce-element-types)
(ftype (function (list &key (:ignore-lock t) (:direction symbol) (:old-position list))) move-to-zone)
(type (or null battle) *battle*)
(type list yadfa-clim::*records* *mods* *cheat-hooks* *world-packages* *battle-packages* *command-packages*)
(type (or null game) *game*)
(type hash-table *mod-registry* *pattern-cache* *events* *element-types*)
(type boolean *immutable*)
(type unsigned-byte *last-rng-update*))
| 5,157 | Common Lisp | .lisp | 57 | 79.070175 | 153 | 0.657843 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | b016f48ad211092c871a9f4909d08a06f778ba1d51409cadd0a6a4e383caf690 | 15,657 | [
-1
] |
15,658 | mcclim.lisp | pouar_yadfa/core/libexec/mcclim.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa-clim"; coding: utf-8-unix; -*-
(in-package :yadfa-clim)
(c:define-command-table yadfa-world-commands)
(c:define-command-table yadfa-battle-commands)
(c:define-command-table yadfa-bin-commands)
(c:define-command-table yadfa-menu-commands)
(c:define-command-table application-commands)
(c:define-command (com-clear-output :name "Clear Output History"
:command-table application-commands
:menu t
:provide-output-destination-keyword nil)
()
(c:window-clear *standard-output*)
(setf *records* nil))
(c:map-over-command-table-names (lambda (name command)
(unless (eq command 'clim-listener::com-clear-output)
(c:add-command-to-command-table command (c:find-command-table 'application-commands) :errorp nil)
(c:add-menu-item-to-command-table (c:find-command-table 'application-commands) name :command command :errorp nil)))
(c:find-command-table 'clim-listener::application-commands)
:inherited nil)
(cc:define-conditional-application-frame yadfa-listener (clim-listener::listener)
(:enable-commands '(yadfa-bin-commands yadfa-world-commands)
:disable-commands '(yadfa-world-commands))
()
(:panes (clim-listener::interactor-container
(c:make-clim-stream-pane
:type 'clim-listener::listener-interactor-pane
:name 'clim-listener::interactor :scroll-bars t
:default-view clim-listener::+listener-view+
:end-of-line-action :wrap*))
(clim-listener::doc :pointer-documentation :default-view clim-listener::+listener-pointer-documentation-view+)
(clim-listener::wholine (c:make-pane 'clim-listener::wholine-pane
:display-function 'clim-listener::display-wholine
:display-time :command-loop :end-of-line-action :allow)))
(:top-level (c:default-frame-top-level :prompt 'clim-listener::print-listener-prompt))
(:command-table (yadfa-listener
:inherit-from (
clim-listener::listener
yadfa-menu-commands
yadfa-world-commands
yadfa-battle-commands
yadfa-bin-commands
application-commands)
:menu (("Listener" :menu application-commands)
("Lisp" :menu clim-listener::lisp-commands)
("Filesystem" :menu clim-listener::filesystem-commands)
("Show" :menu clim-listener::show-commands)
("Yadfa" :menu yadfa-menu-commands))))
(:disabled-commands clim-listener::com-clear-output)
(:menu-bar t)
(:layouts (default
(c:vertically ()
clim-listener::interactor-container
clim-listener::doc
clim-listener::wholine))))
(c:define-command (yadfa-set-eol-action :command-table yadfa-menu-commands :menu "Set EOL Action")
((keyword '(member :scroll :allow :wrap :wrap*)
:prompt "Keyword"))
(setf (c:stream-end-of-line-action *query-io*) keyword))
(c:define-command (yadfa-gc :command-table yadfa-menu-commands :menu "GC")
()
(trivial-garbage:gc :full t))
(cc:define-conditional-command (com-enable-world)
(yadfa-listener :enable-commands (yadfa-world-commands yadfa-bin-commands)
:disable-commands (yadfa-battle-commands))
())
(cc:define-conditional-command (com-enable-battle)
(yadfa-listener :enable-commands (yadfa-battle-commands yadfa-bin-commands)
:disable-commands (yadfa-world-commands))
())
(c:define-command
(com-inspect :command-table c:global-command-table :name "Inspect")
((obj 'c:expression
:prompt "object"
:gesture :inspect))
(clouseau:inspect obj :new-process t))
(defmacro draw-bar (medium stat &rest colors)
`(multiple-value-bind (x y) (c:stream-cursor-position ,medium)
(c:draw-rectangle* ,medium x y (+ x (* ,stat 400)) (+ y 15)
:ink (cond ,@(iter (for i in colors)
(collect `(,(car i) ,(intern (format nil "+~a+"
(if (typep (car (last i)) 'cons)
(caar (last i))
(car (last i))))
"CLIM"))))))
(c:draw-rectangle* ,medium x y (+ x 400) (+ y 15)
:filled nil)
(c:stream-set-cursor-position ,medium (+ x 400) y)))
(c:define-presentation-method c:present (object (type base-character) stream (view stat-view) &key)
(format stream "Name: ~a~%" (name-of object))
(format stream "Sex: ~a~%" (if (malep object) "Male" "Female"))
(format stream "Species: ~a~%" (species-of object))
(format stream "Description: ~a~%" (description-of object))
(when (typep object 'team-member)
(format stream "Tail: ~a~%" (tail-of object))
(format stream "Wings: ~a~%" (wings-of object))
(format stream "Skin: ~a~%" (skin-of object)))
(format stream "Health: ")
(draw-bar stream (/ (health-of object) (calculate-stat object :health))
((> (health-of object) (* (calculate-stat object :health) 1/2)) :green)
((> (health-of object) (* (calculate-stat object :health) 1/4)) :yellow)
(t :red))
(format stream " ~a~%Energy: "
(if (member object (cons (player-of *game*) (allies-of *game*)))
(format nil "(~a/~a)"
(health-of object)
(calculate-stat object :health))
""))
(draw-bar stream (/ (energy-of object) (calculate-stat object :energy))
((> (energy-of object) (* (calculate-stat object :energy) 1/2)) :green)
((> (energy-of object) (* (calculate-stat object :energy) 1/4)) :yellow)
(t :red))
(format stream " ~a~%"
(if (member object (cons (player-of *game*) (allies-of *game*)))
(format nil "(~a/~a)"
(energy-of object)
(calculate-stat object :energy))
""))
(write-string "Conditions: " stream)
(iter (for i in (status-conditions object))
(format stream "“~a” " (name-of i)))
(write-char #\Newline stream)
(format stream "Stats: ~a~%Base-Stats: ~a~%"
(let ((wield-stats (calculate-wield-stats object))
(wear-stats (calculate-wear-stats object)))
(iter (for (a b) on (base-stats-of object) by #'cddr)
(collect a)
(collect (+ b (getf wield-stats a) (getf wear-stats a)))))
(base-stats-of object))
(let ((c (filter-items (wear-of object) 'closed-bottoms)))
(destructuring-bind (&key (sogginess 0) (sogginess-capacity 0) (messiness 0) (messiness-capacity 0))
(calculate-diaper-usage* c)
(declare (type real sogginess sogginess-capacity messiness messiness-capacity))
(cond ((find '(or diaper pullup stuffer) c :test (lambda (o e) (typep e o)))
(format stream "Diaper State: ~{~a~}~%"
(let ((a ()))
(cond ((>= sogginess sogginess-capacity)
(push "Leaking" a)
(push " " a))
((>= sogginess 100)
(push "Soggy" a)
(push " " a)))
(cond ((>= messiness messiness-capacity)
(push "Blowout" a))
((>= messiness 100)
(push "Messy" a)))
(unless a (push "Clean" a))
a)))
(c
(format stream "Pants State: ~{~a~}~%"
(let ((a ()))
(cond ((>= sogginess sogginess-capacity)
(push "Wet" a)
(push " " a)))
(cond ((>= messiness messiness-capacity)
(push "Messy" a)))
(unless a (push "Clean" a))
a))))
(when c
(write-string "Sogginess: " stream)
(draw-bar stream (/ sogginess sogginess-capacity)
((>= sogginess (- sogginess-capacity (/ sogginess-capacity 4))) :red)
((>= sogginess (/ sogginess-capacity 2)) :yellow)
(t :green))
(terpri stream)
(write-string "Messiness: " stream)
(draw-bar stream (/ messiness messiness-capacity)
((>= messiness (- messiness-capacity (/ messiness-capacity 4))) :red)
((>= messiness (/ messiness-capacity 2)) :yellow)
(t :green))
(terpri stream))))
(write-string "Bladder State: " stream)
(draw-bar stream (/ (bladder/contents-of object) (bladder/maximum-limit-of object))
((>= (bladder/contents-of object) (bladder/potty-desperate-limit-of object)) :red)
((>= (bladder/contents-of object) (bladder/potty-dance-limit-of object)) (:orange :red))
((>= (bladder/contents-of object) (bladder/need-to-potty-limit-of object)) :yellow)
(t :green))
(terpri stream)
(write-string "Bowels State: " stream)
(draw-bar stream (/ (bowels/contents-of object) (bowels/maximum-limit-of object))
((>= (bowels/contents-of object) (bowels/potty-desperate-limit-of object)) :red)
((>= (bowels/contents-of object) (bowels/potty-dance-limit-of object)) (:orange :red))
((>= (bowels/contents-of object) (bowels/need-to-potty-limit-of object)) :yellow)
(t :green))
(terpri stream))
(c:define-command (com-yadfa-move :command-table yadfa-world-commands :menu t :name "Move")
((zone '(or zone form)))
(cond ((typep zone 'zone)
(block nil
(apply #'yadfa-world:move
(destructuring-bind (new-x new-y new-z new-zone) (position-of zone)
(destructuring-bind (old-x old-y old-z old-zone) (position-of (player-of *game*))
(cond
(*battle*
(format t "You can't do this in battle~%")
(return))
((and (< old-x new-x) (= old-y new-y) (= old-z new-z) (equal old-zone new-zone))
(iter (for i from (1+ old-x) to new-x)
(collect :east)))
((and (> old-x new-x) (= old-y new-y) (= old-z new-z) (equal old-zone new-zone))
(iter (for i from (1- old-x) downto new-x)
(collect :west)))
((and (= old-x new-x) (< old-y new-y) (= old-z new-z) (equal old-zone new-zone))
(iter (for i from (1+ old-y) to new-y)
(collect :south)))
((and (= old-x new-x) (> old-y new-y) (= old-z new-z) (equal old-zone new-zone))
(iter (for i from (1- old-y) downto new-y)
(collect :north)))
(t
(format t "You're either already on that zone or you tried specifying a path that involves turning (which this interface can't do because Pouar sucks at writing code that generates paths)~%")
(return))))))))
(t
(apply 'yadfa-world:move zone))))
(c:define-command (com-yadfa-describe-zone :command-table yadfa-bin-commands :menu t :name "Describe Zone")
((zone zone))
(yadfa-bin:lst :describe-zone zone))
(c:define-presentation-to-command-translator com-yadfa-move-translator
(zone com-yadfa-move yadfa-world-commands
:documentation "Move"
:pointer-documentation "Move Here"
:gesture nil
:menu t
:tester ((object) (destructuring-bind (new-x new-y new-z new-zone) (position-of object)
(destructuring-bind (old-x old-y old-z old-zone) (position-of (player-of *game*))
(and (= old-z new-z) (equal old-zone new-zone) (or (and (= old-y new-y) (/= old-x new-x))
(and (= old-x new-x) (/= old-y new-y))))))))
(object)
(list object))
(c:define-presentation-to-command-translator com-yadfa-move-translator-up
(zone com-yadfa-move yadfa-world-commands
:documentation "Move Up"
:pointer-documentation "Move Up"
:gesture nil
:menu t
:tester ((object) (and (equal (position-of (player-of *game*)) (position-of object))
(get-zone (destructuring-bind (x y z zone) (position-of object)
`(,x ,y ,(1+ z) ,zone)))
(yadfa::travelablep (position-of (player-of *game*)) :up))))
(object)
'((:up)))
(c:define-presentation-to-command-translator com-yadfa-move-translator-down
(zone com-yadfa-move yadfa-world-commands
:documentation "Move Down"
:pointer-documentation "Move Down"
:gesture nil
:menu t
:tester ((object) (and (equal (position-of (player-of *game*)) (position-of object))
(get-zone (destructuring-bind (x y z zone) (position-of object)
`(,x ,y ,(1- z) ,zone)))
(yadfa::travelablep (position-of (player-of *game*)) :down))))
(object)
'((:down)))
(c:define-presentation-to-command-translator com-yadfa-move-translator-warp
(zone com-yadfa-move yadfa-world-commands
:documentation "Move To Waypoint"
:pointer-documentation "Move To Waypoint"
:gesture nil
:menu t
:tester ((object) (and (equal (position-of (player-of *game*)) (position-of object))
(iter (for (point position) on (warp-points-of (get-zone (position-of object))) by 'cddr)
(unless (yadfa::travelablep (position-of (player-of *game*)) point)
(collect point))))))
(object)
`((,(let ((*query-io* (c:frame-query-io (c:find-application-frame 'yadfa-listener))))
(c:accepting-values (*query-io* :resynchronize-every-pass t)
(c:accept `(member-alist ,(iter (for (key position) on (warp-points-of (get-zone (position-of object))) by 'cddr)
(unless (yadfa::travelablep (position-of (player-of *game*)) key)
(collect (cons (write-to-string key) key))))) :view clim:+radio-box-view+ :stream *query-io*))))))
(c:define-presentation-to-command-translator com-yadfa-describe-zone-translator
(zone com-yadfa-describe-zone yadfa-bin-commands
:documentation "Describe Zone"
:pointer-documentation "Print Zone Description"
:gesture nil
:menu t)
(object)
(list object))
(c:define-application-frame emacs-frame (c:standard-application-frame)
((lambda :accessor emacs-frame-lambda
:initarg :emacs-frame-lambda
:initform (lambda (frame)
(declare (ignore frame))
t)))
(:panes (int :interactor :height 400 :width 600))
(:layouts
(default int)))
(defmethod c:default-frame-top-level :around ((frame emacs-frame)
&key (command-parser 'c:command-line-command-parser)
(command-unparser 'c:command-line-command-unparser)
(partial-command-parser
'c:command-line-read-remaining-arguments-for-partial-command)
(prompt "Command: "))
(declare (ignore prompt))
(let* ((frame-query-io (c:frame-query-io frame))
(interactorp (typep frame-query-io 'c:interactor-pane))
(*standard-input* (or (c:frame-standard-input frame) *standard-input*))
(*standard-output* (or (c:frame-standard-output frame) *standard-output*))
(*query-io* (or frame-query-io *query-io*))
;; during development, don't alter *error-output*
;; (*error-output* (frame-error-output frame))
(c:*pointer-documentation-output* (c:frame-pointer-documentation-output frame))
(c:*command-parser* command-parser)
(c:*command-unparser* command-unparser)
(c:*partial-command-parser* partial-command-parser))
(restart-case
(progn
(c:redisplay-frame-panes frame :force-p t)
(when interactorp
(setf (c:cursor-visibility (c:stream-text-cursor frame-query-io)) nil))
(funcall (emacs-frame-lambda frame) frame))
(abort ()
:report "Return to application command loop."
(if interactorp
(format frame-query-io "~&Command aborted.~&")
(c:beep))))))
;;; add init function
(defmethod c:default-frame-top-level
((frame yadfa-listener)
&key (command-parser 'c:command-line-command-parser)
(command-unparser 'c:command-line-command-unparser)
(partial-command-parser
'c:command-line-read-remaining-arguments-for-partial-command)
(prompt "Command: "))
;; Give each pane a fresh start first time through.
(let ((needs-redisplay t)
(first-time t))
(loop
;; The variables are rebound each time through the loop because the
;; values of frame-standard-input et al. might be changed by a command.
;;
;; We rebind *QUERY-IO* ensuring variable is always a stream,
;; but we use FRAME-QUERY-IO for our own actions and to decide
;; whenever frame has the query IO stream associated with it..
(let* ((frame-query-io (c:frame-query-io frame))
(interactorp (typep frame-query-io 'c:interactor-pane))
(*standard-input* (or (c:frame-standard-input frame) *standard-input*))
(*standard-output* (or (c:frame-standard-output frame) *standard-output*))
(*query-io* (or frame-query-io *query-io*))
;; during development, don't alter *error-output*
;; (*error-output* (frame-error-output frame))
(c:*pointer-documentation-output* (c:frame-pointer-documentation-output frame))
(c:*command-parser* command-parser)
(c:*command-unparser* command-unparser)
(c:*partial-command-parser* partial-command-parser))
(restart-case
(flet ((execute-command ()
(a:when-let ((command (c:read-frame-command frame :stream frame-query-io)))
(setq needs-redisplay t)
(s:run-hooks 'yadfa:*cheat-hooks*)
(c:execute-frame-command frame command))))
(when needs-redisplay
(dolist (i yadfa-clim::*records*) do (c:redisplay i *standard-output*))
(c:redisplay-frame-panes frame :force-p first-time)
(when first-time
(yadfa::switch-user-packages)
(yadfa:intro-function))
(setq first-time nil
needs-redisplay nil)
(when (>= (yadfa:time-of yadfa:*game*) (+ yadfa::*last-rng-update* 20))
(setf cl:*random-state* (make-random-state t)
yadfa::*last-rng-update* (yadfa:time-of yadfa:*game*))))
(when interactorp
(setf (c:cursor-visibility (c:stream-text-cursor frame-query-io)) nil)
(when prompt
(c:with-text-style (frame-query-io climi::+default-prompt-style+)
(if (stringp prompt)
(write-string prompt frame-query-io)
(funcall prompt frame-query-io frame))
(force-output frame-query-io))))
(execute-command)
(when interactorp
(fresh-line frame-query-io)))
(abort ()
:report "Return to application command loop."
(if interactorp
(format frame-query-io "~&Command aborted.~&")
(c:beep))))))))
(define-condition emm386-memory-manager-error (serious-condition) ()
(:report (lambda (condition stream)
(declare (ignore condition))
(write-line "Thank you for playing Wing Commander!" stream))))
(defmethod c:frame-exit ((frame yadfa-listener))
(unwind-protect (error 'emm386-memory-manager-error)
(call-next-method)))
(defun run-listener (&key (new-process nil)
(debugger t)
(width 1024)
(height 1024)
port
frame-manager
(process-name "Yadfa")
(package :yadfa-user))
(let* ((fm (or frame-manager (c:find-frame-manager :port (or port (c:find-port)))))
(frame (c:make-application-frame 'yadfa-listener
:frame-manager fm
:width width
:height height)))
(flet ((run ()
(let ((*package* (find-package package)))
(unwind-protect
(if debugger
(clim-debugger:with-debugger () (c:run-frame-top-level frame))
(c:run-frame-top-level frame))
(c:disown-frame fm frame)))))
(if new-process
(values (bt:make-thread 'run :name process-name)
frame)
(run)))))
| 22,195 | Common Lisp | .lisp | 407 | 39.515971 | 216 | 0.539938 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 1f948871b3b69b2fa9ebe084cf2e8c43b52313867fad52ec918418e0f94f1f75 | 15,658 | [
-1
] |
15,659 | conditions.lisp | pouar_yadfa/core/libexec/conditions.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(define-condition invalid-user-input (simple-condition) ()
(:documentation "Condition that signals when the player enters an invalid value. Their fault."))
(define-condition onesie-too-thick (simple-condition)
((clothes :type list :initarg :clothes)
(user :type base-character :initarg :user))
(:documentation "Condition signaled by @code{TOGGLE-ONESIE} when the onesie @code{(CAR CLOTHES)} can't fit over the user @var{USER}'s @code{(CDR CLOTHES)}")
(:report (lambda (c s)
(format s "~s doesn't fit over pamps" (car (clothes-of c))))))
(define-condition onesie-locked (simple-condition)
((clothes :type list :initarg :clothes :accessor clothes-of)
(user :type base-character :initarg :user :accessor user-of))
(:documentation "Condition signaled by @code{TOGGLE-ONESIE} when @code{(CAR CLOTHES)} is locked")
(:report (lambda (c s)
(format s "~s is locked" (car (clothes-of c))))))
(define-condition unusable-item ()
((item :initarg :item
:initform nil
:reader unusable-item-item)))
(define-condition item-action-missing (unusable-item)
((action :initarg :action
:initform nil
:reader unusable-item-action))
(:report (lambda (condition stream)
(format stream "Action ~s for ~s doesn't exist" (unusable-item-action condition) (unusable-item-item condition)))))
(define-condition item-use-script-missing (unusable-item)
()
(:report (lambda (condition stream)
(format stream "~s has no ~s method defined" (unusable-item-item condition) 'use-script))))
| 1,672 | Common Lisp | .lisp | 30 | 50.666667 | 158 | 0.69123 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 3ec3baf1aab6cbf9310f28e79cfb62c923d67aa789d4c686e95fa894b4f196b9 | 15,659 | [
-1
] |
15,660 | functions.lisp | pouar_yadfa/core/libexec/functions.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
;;; list-length-< and list-length-<= are based off of sequence-of-length-p from Alexandria
(defun list-length-<= (length list)
(declare (type list list)
(type integer length))
(let ((n (1- length)))
(and (or (minusp n) (nthcdr n list)) t)))
(defun list-length-< (length list)
(declare (type list list)
(type integer length))
(list-length-<= (1+ length) list))
(defun list-length-> (length list)
(declare (type list list)
(type integer length))
(not (list-length-<= length list)))
(defun list-length->= (length list)
(declare (type list list)
(type integer length))
(not (list-length-< length list)))
(defun switch-user-packages (&aux (clim:*application-frame* (clim:find-application-frame 'yadfa-clim::yadfa-listener)))
(declare (special clim:*application-frame*))
(if *battle*
(progn
(unuse-package *world-packages* :yadfa-user)
(use-package *battle-packages* :yadfa-user)
(conditional-commands:change-entity-enabledness 'yadfa-clim::com-enable-battle))
(progn
(unuse-package *battle-packages* :yadfa-user)
(use-package *world-packages* :yadfa-user)
(conditional-commands:change-entity-enabledness 'yadfa-clim::com-enable-world)))
(use-package *command-packages* :yadfa-user)
t)
(defunassert get-event (event-id)
(event-id symbol)
(gethash event-id *events*))
(defunassert (setf get-event) (new-value event-id)
(event-id symbol)
(setf (gethash event-id *events*) new-value))
(defun get-zone (position)
(declare (type list position))
(gethash position (slot-value *game* 'zones)))
(defun (setf get-zone) (new-value position)
(declare (type list position)
(type zone new-value))
(setf (position-of new-value) position
(gethash position (slot-value *game* 'zones)) new-value))
(s:eval-always
(defun set-logical-pathnames ()
(setf (logical-pathname-translations "YADFA")
`(("yadfa:data;**;*.*.*" ,(uiop:merge-pathnames*
(make-pathname
:directory '(:relative "YADFA" :wild-inferiors)
:name :wild
:type :wild
:version :wild
:case :common)
(uiop:xdg-data-home)))
("yadfa:config;**;*.*.*" ,(uiop:merge-pathnames*
(make-pathname
:directory '(:relative "YADFA" :wild-inferiors)
:name :wild
:type :wild
:version :wild
:case :common)
(uiop:xdg-config-home)))
("yadfa:home;**;*.*.*" ,(uiop:merge-pathnames*
(make-pathname
:directory '(:relative :wild-inferiors)
:type :wild
:name :wild
:version :wild
:case :common)
(if uiop:*image-dumped-p*
(make-pathname
:device (pathname-device (truename (uiop:argv0)))
:directory (pathname-directory (truename (uiop:argv0))))
(asdf:component-pathname (asdf:find-system "yadfa")))))))
(illogical-pathnames:define-illogical-host :yadfa.data (uiop:merge-pathnames*
(make-pathname
:directory '(:relative "YADFA")
:case :common)
(uiop:xdg-data-home)))
(illogical-pathnames:define-illogical-host :yadfa.config (uiop:merge-pathnames*
(make-pathname
:directory '(:relative "YADFA")
:case :common)
(uiop:xdg-config-home)))
(illogical-pathnames:define-illogical-host :yadfa.home (if uiop:*image-dumped-p*
(make-pathname
:device (pathname-device (truename (uiop:argv0)))
:directory (pathname-directory (truename (uiop:argv0))))
(asdf:system-source-directory "yadfa"))))
(set-logical-pathnames))
(defun process-potty-dance-check (character attack)
(and (or
(>= (bladder/contents-of character) (bladder/potty-dance-limit-of character))
(>= (bowels/contents-of character) (bowels/potty-dance-limit-of character)))
(< (car (sort (let ((a ())
(x (- (bladder/maximum-limit-of character) (bladder/contents-of character)))
(y (- (bladder/maximum-limit-of character) (bladder/potty-dance-limit-of character))))
(when (>= (bladder/contents-of character) (bladder/potty-dance-limit-of character))
(push (random (expt (u:$ x / y * (expt 5 1.3l0)) (coerce (/ 1 (+ 1 3/10)) 'long-float))) a))
(setf x (- (bowels/maximum-limit-of character) (bowels/contents-of character))
y (- (bowels/maximum-limit-of character) (bowels/potty-dance-limit-of character)))
(when (>= (bowels/contents-of character) (bowels/potty-dance-limit-of character))
(push (random (expt (u:$ x / y * (expt 5 2)) 0.5l0)) a))
a)
'<))
1)
(or (eq attack t) (not (typep (get-move attack character) '(or mess-move-mixin wet-move-mixin))))))
(defunassert get-positions-of-type (type list)
(type type-specifier
list list)
(iter (for i in list)
(for (the fixnum j) upfrom 0)
(when (typep i type)
(collect j))))
(defunassert finished-events (events)
(events (or list symbol))
(iter (for (the (or list symbol) event) in (a:ensure-list events))
#-(or sbcl ccl)
(check-type event (or list symbol))
(unless (gethash (a:ensure-list event) (finished-events-of *game*))
(leave))
(finally (return t))))
(defunassert unfinished-events (events)
(events (or list symbol))
(iter (for (the (or list symbol) event) in (a:ensure-list events))
#-(or sbcl ccl)
(check-type event (or list symbol))
(when (gethash (a:ensure-list event) (finished-events-of *game*))
(leave))
(finally (return t))))
(defunassert finish-events (events)
(events (or list symbol))
(iter (for (the symbol event) in (a:ensure-list events))
#-(or sbcl ccl)
(check-type event symbol)
(remhash event (current-events-of *game*))
(setf (gethash `(,event) (finished-events-of *game*)) t)))
(defunassert get-diaper-expansion (item)
(item closed-bottoms)
(+ (* 10 (/ (+ (sogginess-of item) (messiness-of item))
(- (* 72 36) (* (/ (* 72 5/7) 2) 18/2 pi))))
(thickness-of item)))
(defun initialize-mod-registry ()
(clrhash *mod-registry*)
(labels ((preferred-mod (old new)
(cond ((not old)
new)
((list-length-> (list-length (pathname-directory old))
(pathname-directory new))
new)
((list-length->
(list-length (pathname-directory new))
(pathname-directory old))
old)
((string< (the simple-string (namestring old)) (the simple-string (namestring new)))
old)
(t new))))
(iter (for i in (uiop:directory*
#P((:common :yadfa.data) ("MODS" :**) (:* "ASD") :newest)))
(setf (gethash (pathname-name i) *mod-registry*)
(preferred-mod (gethash (pathname-name i) *mod-registry*)
i)))))
(defun clear-pattern-cache ()
(clrhash *pattern-cache*))
(defunassert find-mod (system)
(system (or symbol simple-string))
(gethash (asdf:primary-system-name system) *mod-registry*))
(defun clear-configuration-hook ()
(set-logical-pathnames)
(clear-pattern-cache)
(initialize-mod-registry))
(defun load-mods (&rest keys &key compiler-verbose &allow-other-keys)
(unless
(and (find "texi" (uiop:command-line-arguments) :test #'string=) (asdf:component-loaded-p "yadfa/docs"))
(let* ((file #P"yadfa:config;mods.conf")
(mods '()))
(ensure-directories-exist #P"yadfa:config;")
(handler-case (a:with-input-from-file (stream file)
(setf mods (read stream)))
(file-error ()
(write-line "The configuration file containing the list of enabled mods seems missing, creating a new one")
(a:with-output-to-file (stream file
:if-exists :supersede
:external-format :utf-8)
(write *mods* :stream stream)))
(error ()
(write-line "The configuration file containing the list of enabled mods seems broken, ignoring")))
(if (and
(typep mods 'list)
(iter (for i in mods)
(unless (typep i '(or string symbol asdf/component:component))
(leave nil))
(finally (return t))))
(setf *mods* mods)
(write-line "The configuration file containing the list of enabled mods isn't valid, ignoring")))
(let ((*compile-verbose* compiler-verbose)
(*compile-print* compiler-verbose))
(iter (for i in *mods*)
(when (asdf:find-system i nil)
(apply #'asdf:load-system i :allow-other-keys t keys))))))
(defun (setf getf-direction) (new-value position direction attribute)
(setf (getf (getf (direction-attributes-of (get-zone position)) direction) attribute) new-value))
(defun getf-direction (position direction attribute)
(getf (getf (direction-attributes-of (get-zone position)) direction) attribute))
(defun remf-direction (position direction attribute)
(remf (getf (direction-attributes-of (get-zone position)) direction) attribute)
(unless (getf (direction-attributes-of (get-zone position)) direction)
(remf (direction-attributes-of (get-zone position)) direction)))
(defunassert status-conditions (user)
(user base-character)
(append (when *battle* (gethash user (%status-conditions-of *battle*)))
(%status-conditions-of user)))
(defunassert deletef-status-conditions (item user &key (test nil testp) (key nil keyp))
(user base-character)
(let ((key (if keyp key 'identity))
(test (if testp test 'eql)))
(when *battle*
(a:deletef (gethash user (%status-conditions-of *battle*)) item
:key key
:test test))
(a:deletef (%status-conditions-of user) item
:key key
:test test)))
(define-compiler-macro deletef-status-conditions (item user &key (test nil testp) (key nil keyp))
(let ((args `(,@(when keyp
`(:key ,key))
,@(when testp
`(:test ,test)))))
`(progn
(when *battle*
(a:deletef (gethash ,user (%status-conditions-of *battle*)) ,item ,@args))
(a:deletef (%status-conditions-of ,user) ,item ,@args))))
(defunassert deletef-status-conditions-if (test user &key (key nil keyp))
(user base-character)
(let ((key (if keyp key 'identity)))
(when *battle*
(deletef-if (gethash user (%status-conditions-of *battle*)) test
:key key))
(deletef-if (%status-conditions-of user) test
:key key)))
(define-compiler-macro deletef-status-conditions-if (user test &key (key nil keyp))
(let ((args `(,@(when keyp
`(:key ,key)))))
`(progn
(when *battle*
(deletef-if (gethash ,user (%status-conditions-of *battle*)) ,test ,@args))
(deletef-if (%status-conditions-of ,user) ,test ,@args))))
(defunassert set-status-condition (status-condition user
&key duration (test nil testp) (key nil keyp)
&aux (status-conditions (status-conditions user))
(i (if (or (eq (accumulative-of (make-instance status-condition)) t)
(list-length-> (accumulative-of (make-instance status-condition)) status-conditions))
(make-instance status-condition)
(car (s:dsu-sort status-conditions (lambda (a b)
(cond ((eq b t)
nil)
((eq a t)
t)
(t (< a b))))
:key #'duration-of))))
(duration (or duration (duration-of (make-instance status-condition)))))
(user base-character i status-condition status-conditions list)
(pushnew i (effective-status-conditions i user)
:key (if keyp key 'identity)
:test (if testp test 'eql))
(when (and (not (eq (duration-of i) t)) (< (duration-of i) duration))
(setf (duration-of i) duration))
t)
(defunassert trigger-event (event-ids)
(event-ids (or symbol list))
(iter (for (the symbol event-id) in (a:ensure-list event-ids))
#-(or sbcl ccl)
(check-type event-id symbol)
(when (and
(funcall (coerce (slot-value (get-event event-id) 'predicate) 'function)
(get-event event-id))
(or (and (slot-value (get-event event-id) 'repeatable) (not (gethash event-id (current-events-of *game*))))
(not (gethash event-id (finished-events-of *game*))))
(finished-events (slot-value (get-event event-id) 'finished-depends)))
(let* ((mission (slot-value (get-event event-id) 'mission))
(accept (when mission
(funcall (coerce (slot-value (get-event event-id) 'mission) 'function)))))
(when mission
(setf (gethash event-id (current-events-of *game*)) t))
(setf (gethash `(,event-id
,@(when (and mission (s:memq accept '(:accepted :declined)))
`(,accept)))
(finished-events-of *game*))
t)
(apply (coerce (slot-value (get-event event-id) 'lambda) 'function)
`(,event-id ,@(when mission `(,accept)))))
(collect event-id))))
(defunassert event-attributes (event-id)
(event-id symbol)
(gethash event-id (slot-value *game* 'event-attributes%)))
(defunassert (setf event-attributes) (instance event-id)
(event-id symbol)
(setf (gethash event-id (slot-value *game* 'event-attributes%)) instance))
(defun set-new-battle (enemies &rest keys &key team-npcs win-events enter-battle-text continuable)
(when continuable
(setf
(continue-battle-of (get-zone (position-of (player-of *game*))))
`(:enemies ,enemies
:win-events ,win-events
:enter-battle-text ,enter-battle-text
:team-npcs ,team-npcs)))
(setf *battle*
(apply #'make-instance 'battle
:enemies (iter (for (the list j) in enemies)
(collect (apply #'make-instance (car j) (eval (cdr j)))))
:team-npcs (iter (for (the list j) in team-npcs)
(collect (apply #'make-instance (car j) (eval (cdr j)))))
keys))
(format t "~a~%" (enter-battle-text-of *battle*))
(iter (for (the symbol j) in (iter (for i in (enemies-of *battle*))
(unless (s:memq (s:class-name-of i) (seen-enemies-of *game*))
(format t "~a was added to your pokedex~%" (name-of i))
(push (s:class-name-of i) (seen-enemies-of *game*))
(collect (s:class-name-of i)))))
(yadfa-bin:pokedex j))
(switch-user-packages)
(process-battle :attack t :no-team-attack t))
(defunassert run-equip-effects (user)
(user base-character)
(iter (for i in (wear-of user))
(wear-script i user))
(when (wield-of user)
(wield-script (wield-of user) user)))
(defunassert get-warp-point (direction position)
(direction symbol position list)
(getf (warp-points-of (get-zone position))
(typecase direction
((member :north :south :east :west :up :down)
direction)
(keyword
(iter (for (k v) on (warp-points-of (get-zone position)) by 'cddr)
(when (and (string= k direction) v)
(leave k))))
(symbol direction))))
(defunassert get-destination (direction position)
(direction symbol position list)
(macrolet ((a (pos x y z)
(a:with-gensyms ((posx "POSX") (posy "POSY") (posz "POSZ") (posm "POSM") (b "B"))
`(let ((,b (destructuring-bind (,posx ,posy ,posz ,posm) ,pos
(declare (type integer ,posx ,posy ,posz)
(type symbol ,posm))
(s:append1 (mapcar #'+ (list ,posx ,posy ,posz) '(,x ,y ,z)) ,posm))))
(when (get-zone ,b)
,b)))))
(case direction
(:north (a position 0 -1 0))
(:south (a position 0 1 0))
(:east (a position 1 0 0))
(:west (a position -1 0 0))
(:up (a position 0 0 1))
(:down (a position 0 0 -1))
(otherwise (get-warp-point direction position)))))
(defunassert get-path-end (destination &optional position direction
&aux (player (player-of *game*)) (allies (allies-of *game*)) (wield (wield-of player))
(wear (wear-of player)) (inventory (inventory-of player)))
(direction symbol position list destination list)
(unless (get-zone destination)
(return-from get-path-end (values nil (format nil "Pick a direction the game knows about~%"))))
(when (or (hiddenp (get-zone destination)) (and position direction (getf-direction position direction :hidden)))
(return-from get-path-end (values nil (format nil "Pick a direction the game knows about~%"))))
(when (and direction (s:memq direction '(:up :down)) (not (s:memq direction (stairs-of (get-zone (or position (position-of player)))))))
(return-from get-path-end (values nil (format nil "There are no stairs there~%"))))
(when (or (and (lockedp (get-zone destination))
(not (member-if (lambda (a)
(typep a (key-of (get-zone destination))))
(append inventory
(cons wield wear)
(let ((a ()))
(iter (for i in allies)
(push (wield-of i) a)
(iter (for j in (wear-of i))
(push j a)))
a)))))
(and position direction
(getf-direction position direction :locked)
(not (member-if (lambda (a)
(typep a (getf-direction position direction :key)))
(append inventory
(cons wield wear)
(let ((a ()))
(iter (for i in allies)
(push (wield-of i) a)
(iter (for j in (wear-of i))
(push j a)))
a))))))
(return-from get-path-end (values nil (format nil "zone ~a is locked~%" destination))))
destination)
(defunassert print-map-pattern-cache (path designs)
(path pathname designs list)
(or (gethash `(:map-pattern ,path ,designs) *pattern-cache*)
(setf (gethash `(:map-pattern ,path ,designs) *pattern-cache*)
(clim:make-pattern-from-bitmap-file
(uiop:merge-pathnames*
path
#P"yadfa:home;pixmaps;map-patterns;")
:format :xpm
:designs designs))))
(defun travelablep (position direction)
(declare (type list position)
(type symbol direction))
(and (get-zone (get-destination direction position))
(get-zone position)
(not (getf-direction position direction :hidden))
(not (hiddenp (get-zone (get-destination direction position))))
(or (and (s:memq direction '(:up :down)) (s:memq direction (stairs-of (get-zone position))))
(and (not (s:memq direction '(:up :down)))))
t))
(defunassert print-map (position &aux (player (player-of *game*)) (player-position (position-of player)) (player-zone (get-zone player-position)))
(player player player-position list player-zone (or null zone))
(labels ((a (position)
(let ((b 0)
(array
#1A(#P"nsew.xpm"
#P"nsw.xpm"
#P"nse.xpm"
#P"ns.xpm"
#P"new.xpm"
#P"nw.xpm"
#P"ne.xpm"
#P"n.xpm"
#P"sew.xpm"
#P"sw.xpm"
#P"se.xpm"
#P"s.xpm"
#P"ew.xpm"
#P"w.xpm"
#P"e.xpm"
#P"dot.xpm")))
(iter (for direction in '(:east :west :south :north))
(for (the fixnum byte-position) upfrom 0)
(unless (travelablep position direction)
(setf (ldb (byte 1 byte-position) b) 1)))
(aref array b))))
(updating-present-with-effective-frame (*query-io* :unique-id `(map% ,position)
:id-test #'equal
:cache-value (sxhash (list player-position
(iter (for i in '(:north :south :east :west :up :down))
(collect (travelablep player-position i)))
(and player-zone
(warp-points-of player-zone)))))
(let ((pattern (print-map-pattern-cache #P"blank.xpm"
(list clim:+background-ink+ clim:+foreground-ink+))))
(multiple-value-bind (start-x start-y) (if c:*application-frame*
(clim:stream-cursor-position *standard-output*)
(values 0 0))
(declare (type real start-x start-y))
(clim:updating-output (t)
;; position needs to be bound inside of clim:updating-output and not outside
;; for the presentation to notice when the floor the player is on changes
(let* ((player-position (position-of (player-of *game*)))
(position (if (eq position t)
player-position
position)))
(declare (type list position player-position))
(destructuring-bind (posx posy posz posm) position
(declare (type integer posx posy posz)
(type symbol posm))
(iter (for (the integer y)
from (- posy 15)
to (+ posy 15))
(for y-pos
from start-y
to (+ start-y (* 30 (the (unsigned-byte 32) (clim:pattern-height pattern))))
by (the (unsigned-byte 32) (clim:pattern-height pattern)))
(iter (for (the integer x)
from (- posx 15)
to (+ posx 15))
(for x-pos
from start-x
to (+ start-x (* 30 (the (unsigned-byte 32) (clim:pattern-width pattern))))
by (the (unsigned-byte 32) (clim:pattern-width pattern)))
(let* ((current-position `(,x ,y ,posz ,posm))
(current-zone (get-zone current-position))
(char (cons (if (or (and current-zone (hiddenp current-zone)) (not current-zone))
#P"blank.xpm"
(a current-position))
(clim:make-rgb-color (if (and current-zone (warp-points-of current-zone)) 1 0)
(if (equal current-position player-position) 0.7l0 0)
(if (or (travelablep current-position :up) (travelablep current-position :down)) 1 0)))))
(setf pattern (print-map-pattern-cache (car char) (list clim:+background-ink+ (cdr char))))
(when (get-zone current-position)
(clim:with-output-as-presentation
(*standard-output* (get-zone current-position) 'zone)
(clim:draw-pattern* *standard-output* pattern x-pos y-pos)))))))))
(when c:*application-frame*
(clim:stream-set-cursor-position *standard-output* start-x (+ start-y (* 31 (the (unsigned-byte 32) (clim:pattern-height pattern)))))))))))
(defunassert get-zone-text (text)
(text (or string coerced-function))
(typecase text
(string
text)
(t
(the (values string &optional) (funcall (coerce text 'function))))))
(defun print-enter-text (position &optional old-position old-direction)
(let ((old-direction (when (and old-direction old-position)
(typecase old-direction
((member :north :south :east :west :up :down)
old-direction)
(keyword
(iter (for (k v) on (warp-points-of (get-zone old-position)) by 'cddr)
(when (and (string= k old-direction) v)
(leave k))))
(symbol old-direction)))))
(format t "~a~%" (get-zone-text (if (and old-position old-direction (getf-direction old-position old-direction :exit-text))
(getf-direction old-position old-direction :exit-text)
(enter-text-of (get-zone position))))))
(flet ((z (delta direction stairs)
(let* ((current-position (destructuring-bind (x y z m) position
(declare (type integer x y z)
(type symbol m))
`(,@(mapcar #'+ (list x y z) delta) ,m)))
(current-zone (get-zone current-position))
(stairs (and current-zone (s:memq direction stairs))))
(when (and current-zone
(not (hiddenp current-zone))
(or (and (s:memq direction '(:up :down)) stairs)
(not (s:memq direction '(:up :down)))))
(format t "To ~s is ~a. " direction (name-of current-zone))))))
(let ((stairs (stairs-of (get-zone position))))
(z '(-1 0 0) :west stairs)
(z '(1 0 0) :east stairs)
(z '(0 1 0) :south stairs)
(z '(0 -1 0) :north stairs)
(z '(0 0 1) :up stairs)
(z '(0 0 -1) :down stairs)))
(iter (for (a b) on (warp-points-of (get-zone position)) by #'cddr)
(when (and (get-zone b) (not (hiddenp (get-zone b))))
(format t "To ~s is ~a. " a (name-of (get-zone b)))))
(format t "~%"))
(defun get-inventory-list ()
(iter (for i in (inventory-of (player-of *game*))) (collect (symbol-name (type-of i)))))
(defunassert filter-items (items type)
(items list type type-specifier)
"This function will return all items in the list @var{ITEMS} that is of type @var{TYPE}"
(iter (for item in items)
(when (typep item type)
(collect item))))
(defunassert swell-up% (user)
(user base-character)
(iter (for i in (filter-items (wear-of user) 'closed-bottoms))
(if (waterproofp i)
(finish)
(progn
(setf (sogginess-of i) (sogginess-capacity-of i))
(collect i)))))
(defunassert swell-up (user &aux (swollen-clothes (swell-up% user)) (name (name-of user)))
(user base-character)
(cond
((filter-items swollen-clothes 'diaper)
(format t "~a's diapers swells up humorously~%~%" name))
((filter-items swollen-clothes 'pullup)
(format t "~a's pullups swells up humorously~%~%" name))
((filter-items swollen-clothes 'stuffer)
(format t "~a's incontinence pad swells up~%~%" name)))
(pop-from-expansion user))
(defunassert total-thickness (clothing)
(clothing list)
(iter (for i in (filter-items clothing 'closed-bottoms))
(with j = 0)
(incf j (get-diaper-expansion i))
(finally (return j))))
(defun fast-thickness (list item)
#+sbcl (declare (type list list)
(type clothing item))
(s:nlet execute (list item (count 0))
(if (or (eq (car list) item) (endp list))
count
(execute (cdr list) item (if (typep (car list) 'closed-bottoms)
(+ count (get-diaper-expansion (car list)))
count)))))
(defunassert pop-from-expansion (user &optional wet/mess &aux (reverse-wear (nreverse (wear-of user))) (last (car reverse-wear)) (return ()))
(user base-character)
(macrolet ((pushclothing (i wet/mess return)
`(progn
(when (and (getf (car ,wet/mess) :wet-amount)
(> (getf (car ,wet/mess) :wet-amount) 0))
(pushnew ,i (getf (car ,wet/mess) :popped)))
(when (and (getf (cdr ,wet/mess) :mess-amount)
(> (getf (cdr ,wet/mess) :mess-amount) 0))
(pushnew ,i (getf (cdr ,wet/mess) :popped)))
(pushnew ,i ,return))))
(iter
(for item in reverse-wear)
(let* ((thickness-capacity (if (typep item 'bottoms) (thickness-capacity-of item)))
(thickness-capacity-threshold (if (typep item 'bottoms) (thickness-capacity-threshold-of item)))
(total-thickness (if (and (typep item 'bottoms)
thickness-capacity
thickness-capacity-threshold)
(fast-thickness reverse-wear item))))
(declare (type (or null (real 0)) thickness-capacity thickness-capacity-threshold total-thickness))
(when
(and (not (eq item last))
total-thickness
thickness-capacity
thickness-capacity-threshold
(> total-thickness (+ thickness-capacity thickness-capacity-threshold)))
(typecase item
(onesie/closed
(toggle-onesie% item)
(if (lockedp item)
(progn (format t "~a's ~a pops open from the expansion destroying the lock in the process~%~%"
(name-of user)
(name-of item))
(setf (lockedp item) nil))
(format t "~a's ~a pops open from the expansion~%~%"
(name-of user)
(name-of item)))
(pushclothing (the item item) wet/mess return))
((or incontinence-product snap-bottoms)
(push item (inventory-of (if (typep user 'team-member)
(player-of *game*)
user)))
(a:deletef (the list reverse-wear) item :count 1)
(format t "~a's ~a comes off from the expansion~%~%"
(name-of user)
(name-of item))
(pushclothing (the item item) wet/mess return))
((and bottoms (not incontinence-product))
(a:deletef (the list reverse-wear) item :count 1)
(format t "~a's ~a tears from the expansion and is destroyed~%~%"
(name-of user)
(name-of item))
(pushclothing (the item item) wet/mess return))))))
(setf (wear-of user) (nreverse reverse-wear))
(cond ((or (getf (car wet/mess) :popped) (getf (cdr wet/mess) :popped))
(values wet/mess :wet/mess))
(return (values return :return))
(t (values nil nil)))))
(defunassert thickest-sort (clothing)
(clothing list)
(s:dsu-sort (iter (for i in clothing)
(when (typep i 'closed-bottoms)
(collect i)))
'>
:key 'get-diaper-expansion))
(defunassert thickest (clothing &optional n &aux (a (iter (for i in clothing)
(when (typep i 'closed-bottoms)
(collect i)))))
(clothing list n (or null unsigned-byte))
(if n
(the (values list &optional)
(s:bestn n a '> :key 'get-diaper-expansion :memo t))
(iter (for i in a)
(finding i maximizing (get-diaper-expansion i)))))
(defun handle-faint (character)
"Checks if @var{CHARACTER} fainted and returns T if so. Also handles @code{(FAINTED-OF *BATTLE*)} as a side effect."
(declare (type base-character character))
(let ((faintedp (member character (fainted-of *battle*))))
(cond ((and (<= (health-of character) 0) (not faintedp))
(f:fmt t (name-of character) " has fainted" #\Newline)
(pushnew character (fainted-of *battle*))
(a:deletef (turn-queue-of *battle*) character)
t)
((and (> (health-of character) 0) faintedp)
(setf (fainted-of *battle*) (s:delq character (fainted-of *battle*)))
nil)
(t (not (null faintedp))))))
(defun handle-status-effects (character battle)
"Returns true if @var{CHARACTER} fainted and false if not, but only if in @var{BATTLE}, otherwise unspecified"
(declare (type base-character character)
(type boolean battle))
(iter (for i in (status-conditions character))
(when (or (eq (duration-of i) t) (> (duration-of i) 0))
(condition-script character i battle)
(when (typep (duration-of i) 'real)
(decf (duration-of i))))
(deletef-status-conditions-if character
(lambda (a) (and (not (eq a t)) (<= a 0)))
:key #'duration-of))
(run-equip-effects character)
(if battle
(let ((faintedp (handle-faint character)))
(process-potty character battle)
faintedp)
(progn (process-potty character battle)
nil)))
(defun move-to-zone (new-position &key ignore-lock direction old-position)
(declare (type list new-position old-position)
(type symbol direction))
(when (iter (for i in (cons (player-of *game*) (allies-of *game*)))
(let ((wear (typecase (must-wear-of (get-zone new-position))
(cons (must-wear-of (get-zone new-position)))
(symbol (gethash (must-wear-of *game*) (must-wear-of (get-zone new-position))))))
(not-wear (typecase (must-not-wear-of (get-zone new-position))
(cons (must-not-wear-of (get-zone new-position)))
(symbol (gethash (must-not-wear-of *game*) (must-not-wear-of (get-zone new-position)))))))
(when (or (and (list-length-> 1 (filter-items (wear-of i) (car wear)))
(not (funcall (coerce (cdr wear) 'function) i)))
(and (list-length-< 0 (filter-items (wear-of i) (car not-wear)))
(not (funcall (coerce (cdr not-wear) 'function) i))))
(leave t))))
(return-from move-to-zone))
(when (and (not ignore-lock)
(or (and (lockedp (get-zone new-position))
(not (member (key-of (get-zone new-position)) (inventory-of (player-of *game*))
:test (lambda (item key)
(typep key item)))))
(and (getf (getf (direction-attributes-of (get-zone (position-of (player-of *game*)))) direction) :locked)
(not (member (getf (getf (direction-attributes-of (get-zone (position-of (player-of *game*)))) direction) :key)
(inventory-of (player-of *game*))
:test (lambda (item key)
(typep key item)))))))
(write-line "That zone is locked and you don't have a key")
(return-from move-to-zone))
(incf (time-of *game*))
(when (or
(and (lockedp (get-zone new-position))
(or ignore-lock (member (key-of (get-zone new-position)) (inventory-of (player-of *game*))
:test (lambda (item key)
(typep key item)))))
(and (getf (getf (direction-attributes-of (get-zone (position-of (player-of *game*)))) direction) :locked)
(member (getf (getf (direction-attributes-of (get-zone (position-of (player-of *game*)))) direction) :key)
(inventory-of (player-of *game*))
:test (lambda (item key)
(typep key item)))))
(format t "You unlock zone ~a~%" new-position)
(setf (lockedp (get-zone new-position)) nil)
(remf (getf (direction-attributes-of (get-zone (position-of (player-of *game*)))) direction) :locked))
(setf (position-of (player-of *game*)) new-position)
(iter (for character in (cons (player-of *game*) (allies-of *game*)))
(with underwater = (underwaterp (get-zone (position-of (player-of *game*)))))
(when underwater
(swell-up character))
(handle-status-effects character nil))
(print-enter-text (position-of (player-of *game*)) old-position direction)
(s:run-hook (sc:find-hook 'yadfa-world:move) direction old-position)
(cond ((continue-battle-of (get-zone (position-of (player-of *game*))))
(set-new-battle (getf (continue-battle-of (get-zone (position-of (player-of *game*)))) :enemies)
:team-npcs (getf (continue-battle-of (get-zone (position-of (player-of *game*)))) :team-npcs)
:win-events (getf (continue-battle-of (get-zone (position-of (player-of *game*)))) :win-events)
:continuable t
:enter-battle-text (getf (continue-battle-of (get-zone (position-of (player-of *game*)))) :enter-battle-text))
(return-from move-to-zone))
((trigger-event (events-of (get-zone (position-of (player-of *game*)))))
(return-from move-to-zone))
((resolve-enemy-spawn-list (get-zone (position-of (player-of *game*))))
(let ((enemy-spawn-list (iter (for i in (resolve-enemy-spawn-list (get-zone (position-of (player-of *game*)))))
(when (< (random 1.0l0) (getf i :chance))
(leave (cond ((getf i :eval)
(eval (getf i :eval)))
((getf i :lambda)
(funcall (coerce (getf i :lambda) 'function)))
(t (getf i :enemies)))))))
(team-npc-spawn-list (iter (for i in (resolve-team-npc-spawn-list (get-zone (position-of (player-of *game*)))))
(when (< (random 1.0l0) (getf i :chance))
(leave (cond ((getf i :eval)
(eval (getf i :eval)))
((getf i :lambda)
(funcall (coerce (getf i :lambda) 'function)))
(t (getf i :enemies))))))))
(when enemy-spawn-list
(set-new-battle enemy-spawn-list :team-npcs team-npc-spawn-list))))))
(defun move-to-secret-underground ()
(when *battle*
(write-line "To avoid breaking the game due to a few assumptions made in this function, please don't run this in a battle~%")
(return-from move-to-secret-underground))
(multiple-value-bind (destination error) (get-path-end '(0 0 0 yadfa-zones:secret-underground))
(unless destination
(format t "~a" error)
(return-from move-to-secret-underground))
(move-to-zone '(0 0 0 yadfa-zones:secret-underground) :ignore-lock t)))
(defun move-to-pocket-map (item)
(when *battle*
(write-line "To avoid breaking the game due to a few assumptions made in this function, please don't run this in a battle~%")
(return-from move-to-pocket-map))
(unless (get-zone '(0 0 0 pocket-map))
(make-pocket-zone (0 0 0)
:name "Pocket Map Entrance"
:description "Welcome to the Pocket Map. It's like the secret bases in Pokémon, except you customize it by scripting, and you can take it with you."
:enter-text "You're at the start of the Pocket Map. Use the Pocket Map machine again at anytime to exit."))
(let ((old-position (position-of (player-of *game*))))
(move-to-zone (if (eq (fourth (position-of (player-of *game*))) :pocket-map)
(getf (attributes-of item) :pocket-map-position)
'(0 0 0 :pocket-map))
:ignore-lock t)
(unless (eq (fourth old-position) :pocket-map)
(setf (getf (attributes-of item) :pocket-map-position) old-position))))
(defunassert wet (&key (wet-amount t) force-fill-amount pants-down accident force-wet-amount (wetter (player-of *game*)) (clothes nil clothes-supplied-p)
&aux (return-value ()) (affected-clothes ()) (random (random 4)) (amount nil)
(clothes (if clothes-supplied-p clothes (wear-of wetter))))
(force-fill-amount (or null real)
force-wet-amount (or boolean real)
wet-amount (or boolean real)
wetter base-character)
#.(format nil "this function is mostly for mods, doesn't print text or diaper expansion, that's handled by other functions. @var{WETTER} is the instance of @code{BASE-CHARACTER} doing the flooding. @var{WET-AMOUNT} is the amount @var{WETTER} floods but won't flood if he/she can't go, passing @code{T} to @var{WET-AMOUNT} means to use @code{(BLADDER/CONTENTS-OF WETTER)}, @var{FORCE-WET-AMOUNT} causes @var{WETTER} to wet regardless. @var{FORCE-FILL-AMOUNT} will set @code{(BLADDER/CONTENTS-OF WETTER)} to that amount first. @var{PANTS-DOWN} is @code{T} if @var{WETTER} pulls his/her pants down first. @var{ACCIDENT} is @code{T} if the wetting isn't intentional and @var{WETTER} may or may not be able to stop the flow. if @var{CLOTHES} is passed, it will be the one @var{WETTER} floods, otherwise it will be @code{(wear-of @var{WETTER})}
~a."
(xref mess :function))
(when force-fill-amount
(setf (bladder/contents-of wetter) force-fill-amount))
(cond (force-wet-amount
(setf amount (cond ((eq force-wet-amount t)
(bladder/contents-of wetter))
((> force-wet-amount (bladder/contents-of wetter))
(bladder/contents-of wetter))
(t
force-wet-amount))))
((< (bladder/contents-of wetter) (bladder/need-to-potty-limit-of wetter))
(return-from wet `(:old-bladder-contents ,(bladder/contents-of wetter)
:new-bladder-contents ,(bladder/contents-of wetter)
:affected-clothes ()
:leak-amount 0
:wet-amount 0)))
(accident
(setf amount
(a:switch (random :test '=)
(3 (* 4 (bladder/fill-rate-of wetter)))
(2 (bladder/need-to-potty-limit-of wetter))
(t (bladder/contents-of wetter)))))
(t (setf amount (cond ((eq wet-amount t)
(bladder/contents-of wetter))
((> wet-amount (bladder/contents-of wetter))
(bladder/contents-of wetter))
(t
wet-amount)))))
(setf (getf return-value :accident)
(if accident
(a:switch (random :test '=)
(3 :dribble)
(2 :some)
(t :all))))
(setf (getf return-value :old-bladder-contents) (bladder/contents-of wetter))
(let* ((amount-left amount))
(cond ((or pants-down (not (filter-items clothes 'closed-bottoms)))
(decf (bladder/contents-of wetter) amount)
(setf amount-left 0))
(t
(decf (bladder/contents-of wetter) amount)
(iter (while (> amount-left 0))
(for i in (reverse clothes))
(when (typep i 'closed-bottoms)
(cond ((> amount-left (- (sogginess-capacity-of i) (sogginess-of i)))
(if (leakproofp i)
(setf amount-left 0)
(decf amount-left (- (sogginess-capacity-of i) (sogginess-of i))))
(setf (sogginess-of i) (sogginess-capacity-of i))
(push i affected-clothes)
)
((> amount-left 0)
(incf (sogginess-of i) amount-left)
(setf amount-left 0)
(push i affected-clothes)))))))
(setf (getf return-value :new-bladder-contents) (bladder/contents-of wetter))
(setf (getf return-value :affected-clothes) affected-clothes)
(setf (getf return-value :leak-amount) amount-left)
(setf (getf return-value :wet-amount) amount))
return-value)
(defunassert mess (&key (mess-amount t) force-fill-amount pants-down accident force-mess-amount (messer (player-of *game*)) (clothes nil clothes-supplied-p)
&aux (return-value ()) (affected-clothes ()) (amount nil) (clothes (if clothes-supplied-p clothes (wear-of messer))))
(force-fill-amount (or null real)
force-mess-amount (or boolean real)
mess-amount (or boolean real)
messer base-character)
#.(format nil "this function is mostly for mods, doesn't print text or diaper expansion, that's handled by other functions. @var{MESSER} is the instance of @code{BASE-CHARACTER} doing the messing. @var{MESS-AMOUNT} is the amount @var{MESSER} messes but won't mess if he/she can't go, passing @code{T} to @var{MESS-AMOUNT} means to use @code{(BOWELS/CONTENTS-OF MESSER)}, @var{FORCE-MESS-AMOUNT} causes @var{MESSER} to mess regardless. @var{FORCE-FILL-AMOUNT} will set @code{(BOWELS/CONTENTS-OF MESSER)} to that amount first. @var{PANTS-DOWN} is @code{T} if @var{MESSER} pulls his/her pants down first. @var{ACCIDENT} is @code{T} if the messing isn't intentional. If @var{CLOTHES} is passed, it will be the one @var{MESSER} messes, otherwise it will be @code{(wear-of @var{MESSER})}
~a."
(xref wet :function))
(when force-fill-amount
(setf (bowels/contents-of messer) force-fill-amount))
(cond (force-mess-amount
(setf amount (cond ((eq force-mess-amount t)
(bowels/contents-of messer))
((> force-mess-amount (bowels/contents-of messer))
(bowels/contents-of messer))
(t
force-mess-amount))))
((< (bowels/contents-of messer) (bowels/need-to-potty-limit-of messer))
(return-from mess `(:old-bowels-contents ,(bowels/contents-of messer)
:new-bowels-contents ,(bowels/contents-of messer)
:affected-clothes ()
:leak-amount 0
:mess-amount 0)))
(accident
(setf amount (bowels/contents-of messer)))
(t (setf amount (cond ((eq mess-amount t)
(bowels/contents-of messer))
((> mess-amount (bowels/contents-of messer))
(bowels/contents-of messer))
(t
mess-amount)))))
(setf (getf return-value :old-bowels-contents) (bowels/contents-of messer))
(let* ((amount-left amount))
(cond ((or pants-down (not (filter-items clothes 'closed-bottoms)))
(decf (bowels/contents-of messer) amount)
(setf amount-left 0))
(t
(decf (bowels/contents-of messer) amount)
(iter (while (> amount-left 0))
(for i in (reverse clothes))
(when (typep i 'closed-bottoms)
(cond ((> amount-left (- (messiness-capacity-of i) (messiness-of i)))
(if (leakproofp i)
(setf amount-left 0)
(decf amount-left (- (messiness-capacity-of i) (messiness-of i))))
(setf (messiness-of i) (messiness-capacity-of i))
(push i affected-clothes))
((> amount-left 0)
(incf (messiness-of i) amount-left)
(setf amount-left 0)
(push i affected-clothes)))))))
(setf (getf return-value :new-bowels-contents) (bowels/contents-of messer))
(setf (getf return-value :affected-clothes) affected-clothes)
(setf (getf return-value :leak-amount) amount-left)
(setf (getf return-value :mess-amount) amount))
(setf (fart-count-of messer) 0)
return-value)
(defunassert potty-on-toilet (prop &key wet mess pants-down (user (player-of *game*)))
(prop yadfa-props:toilet
wet (or boolean real)
mess (or boolean real))
(when (notany #'identity (list wet mess))
(setf wet t
mess t))
(cond
((typep user '(not potty-trained-team-member))
(write-line "Yeah, that's not going to happen")
(return-from potty-on-toilet))
((not (funcall (coerce (can-potty-p (get-zone (position-of (player-of *game*)))) 'function)
prop
:wet wet
:mess mess
:pants-down pants-down
:user user))
(return-from potty-on-toilet))
((and pants-down (iter (for i in (filter-items (wear-of user) 'closed-bottoms))
(when (lockedp i)
(format t "~a struggles to remove ~a ~a, realizes ~a can't, then starts panicking while doing a potty dance.~%"
(name-of user)
(if (malep user) "his" "her")
(name-of i)
(if (malep user) "he" "she"))
(leave t))))
(return-from potty-on-toilet)))
(let* ((mess-return-value (when mess
(mess :mess-amount mess :pants-down pants-down :messer user)))
(wet-return-value (when wet
(wet :wet-amount wet :pants-down pants-down :wetter user))))
(when (and (or (not wet-return-value) (and wet-return-value (= (getf wet-return-value :wet-amount) 0)))
(or (not mess-return-value) (and mess-return-value (= (getf mess-return-value :mess-amount) 0))))
(format t "~a doesn't have to go~%" (name-of user))
(return-from potty-on-toilet))
(if (or pants-down (not (filter-items (wear-of user) 'closed-bottoms)))
(format t "~a used the ~a like a big ~a"
(name-of user)
(name-of prop)
(if (malep user) "boy" "girl"))
(let* ((names ())
(out ()))
(push (if (and wet-return-value (> (getf wet-return-value :wet-amount) 0)) "soggy butt" "mushy butt") names)
(push (format nil "~a ~a"
(if (and wet-return-value (> (getf wet-return-value :wet-amount) 0)) "soggy" "mushy")
(if (malep user) "boy" "girl"))
names)
(when (and wet-return-value (> (getf wet-return-value :wet-amount) 0))
(push (format nil "piddle ~a" (if (malep user) "prince" "princess")) names))
(push (format nil "Looks like you missed a step ~a" (a:random-elt names)) out)
(push (format nil "Aww, looks like the little ~a forgot to take ~a ~a first"
(let ((a names))
(push (format nil "baby ~a" (if (malep user) "boy" "girl")) a)
(a:random-elt a))
(if (malep user) "his" "her")
(cond ((filter-items (wear-of user) 'diaper)
"diapers")
((filter-items (wear-of user) 'pullup)
"pullups")
(t "panties")))
out)
(format t "~a~%" (a:random-elt out))))))
(defunassert potty-on-self-or-prop (prop &key wet mess pants-down (user (player-of *game*)))
(wet (or boolean real)
mess (or boolean real))
(when (notany #'identity (list wet mess))
(setf wet t
mess t))
(cond ((and (typep user '(not potty-trained-team-member))
pants-down)
(write-line "Yeah, that's not going to happen")
(return-from potty-on-self-or-prop))
((funcall (coerce (no-wetting/messing-of (get-zone (position-of (player-of *game*)))) 'function) user)
(return-from potty-on-self-or-prop))
((not (funcall (coerce (can-potty-p (get-zone (position-of (player-of *game*)))) 'function)
prop
:wet wet
:mess mess
:pants-down pants-down
:user user))
(return-from potty-on-self-or-prop))
((and pants-down (iter (for i in (filter-items (wear-of user) 'closed-bottoms))
(when (lockedp i)
(format t "~a struggles to remove ~a ~a, realizes ~a can't, then starts panicking while doing a potty dance.~%"
(name-of user)
(if (malep user) "his" "her")
(name-of i)
(if (malep user) "he" "she"))
(leave t))))
(return-from potty-on-self-or-prop)))
(let*
((mess-return-value (when mess
(mess :mess-amount mess :pants-down pants-down :messer user)))
(wet-return-value (when wet
(wet :wet-amount wet :pants-down pants-down :wetter user)))
(clothes (cond ((filter-items (wear-of user) 'diaper)
'("diapers" "pamps" "huggies" "pampers" "padding"))
((filter-items (wear-of user) 'pullup)
'("pullups" "padding"))
((filter-items (wear-of user) '(and undies bottoms (not incontinence-product)))
'("undies" "panties"))
(t '("pants")))))
(when (and
(or (not wet-return-value) (and wet-return-value (= (getf wet-return-value :wet-amount) 0)))
(or (not mess-return-value) (and mess-return-value (= (getf mess-return-value :mess-amount) 0))))
(format t "~a doesn't have to go~%" (name-of user))
(return-from potty-on-self-or-prop))
(let ((wet-list ())
(mess-list ())
(both-list ())
(wet-leak-list ())
(mess-leak-list ())
(both-leak-list ()))
(flet ((format-lists ()
(cond ((and wet-return-value mess-return-value
(> (getf wet-return-value :wet-amount) 0)
(> (getf mess-return-value :mess-amount) 0)
both-list)
(format t "~a~%" (a:random-elt both-list)))
((and mess-return-value (> (getf mess-return-value :mess-amount) 0) mess-list)
(format t "~a~%" (a:random-elt mess-list)))
((and wet-return-value (> (getf wet-return-value :wet-amount) 0) wet-list)
(format t "~a~%" (a:random-elt wet-list))))
(setf wet-list () mess-list () both-list()))
(format-leak-lists ()
(cond ((and
wet-return-value
mess-return-value
(> (getf wet-return-value :leak-amount) 0)
(> (getf mess-return-value :leak-amount) 0)
both-leak-list)
(format t "~a~%" (a:random-elt both-leak-list)))
((and mess-return-value (> (getf mess-return-value :leak-amount) 0) mess-leak-list)
(format t "~a~%" (a:random-elt mess-leak-list)))
((and wet-return-value (> (getf wet-return-value :leak-amount) 0) wet-leak-list)
(format t "~a~%" (a:random-elt wet-leak-list))))
(setf wet-leak-list ()
mess-leak-list ()
both-leak-list())))
(let* ((male (malep user))
(hisher (if male "his" "her"))
(name (name-of user)))
(cond
;; player pulls his pants down then potty
((and pants-down (filter-items (wear-of user) 'closed-bottoms))
(do-push (format nil "~a pulled down ~a ~a and went potty on the ~a"
name
hisher
(a:random-elt clothes)
(if prop
(name-of prop)
"floor"))
both-list wet-list mess-list)
(do-push (format nil "~a pulls down ~a ~a and marks ~a territory"
name
hisher
(a:random-elt clothes)
hisher)
both-list wet-list mess-list)
(push (format nil "~a pulled down ~a ~a and peed on the ~a"
name
hisher
(a:random-elt clothes)
(if prop
(name-of prop)
"floor"))
wet-list)
(push (format nil "~a pulled down ~a ~a and squats down and mess"
name
hisher
(a:random-elt clothes))
mess-list)
(do-push (format nil "Bad ~a! No going potty on the ~a!"
(species-of user)
(if prop
(name-of prop)
"floor"))
wet-list mess-list both-list)
(format-lists))
;; If the player specifies to pull his pants down without any on, assume he's intentionally going on the floor or prop
(pants-down
(push (format nil "~a goes potty on the ~a like an animal"
name
(if prop
(name-of prop)
"floor"))
both-list)
(push (format nil "~a pees on the ~a like an animal"
name
(if prop
(name-of prop)
"floor"))
wet-list)
(push (format nil "~a squats down and messes on the ~a like an animal"
name
(if prop
(name-of prop)
"floor"))
mess-list)
(push (format nil "~a lifts ~a leg and pees on the ~a, then squats down on all fours and mess"
name
hisher
(if prop
(name-of prop)
"floor"))
both-list)
(push (format nil
"~a lifts ~a leg and pees on the ~a"
name
hisher
(if prop
(name-of prop)
"floor"))
wet-list)
(push (format nil "~a squat down on all fours and messes like an animal" (name-of user)) mess-list)
(do-push (format nil "Bad ~a! No going potty on the ~a!"
(species-of user)
(if prop
(name-of prop)
"floor"))
wet-list mess-list both-list)
(format-lists))
;; otherwise assume the player is just standing there and lets go, possibly forgetting that he's not wearing padding
((not (filter-items (wear-of user) 'closed-bottoms))
(if prop
(progn
(push (format nil "~a lifts ~a leg and pees on the ~a"
name
hisher
(name-of prop))
wet-list)
(push (format nil "~a squats down on all fours and mess like an animal"
name)
mess-list)
(push (format nil "~a lifts ~a leg and pees on the ~a, then squats down on all fours and mess"
name
hisher
(name-of prop))
both-list)
(do-push (format nil "Bad ~a! No going potty on the ~a!"
(species-of user)
(name-of prop))
wet-list mess-list both-list))
(do-push (format nil "~a realized ~a made a horrible mistake. ~a weren't wearing any padding!!!"
name
(if male "he" "she")
(if male "He" "She"))
both-list wet-list mess-list))
(format-lists))
;; player is using his pants like a toilet
(t
(cond ((and (not prop) wet-return-value (< (getf wet-return-value :wet-amount) 30))
(push (format nil "~a lets a little out to relieve the pressure"
name)
wet-list)
(push (format nil "Bad idea as ~a just made a puddle on the floor"
(if (malep user) "he" "she"))
wet-leak-list)
(format-lists)
(format-leak-lists))
((filter-items (wear-of user) 'diaper)
(when prop
(push (format nil "~a lifts ~a leg near the ~a and floods ~a pamps"
name
hisher
(name-of prop)
hisher)
wet-list)
(push (format nil "~a lifts ~a leg near the ~a and floods ~a pamps. Looks like the little ~a isn't house-trained"
name
hisher
(name-of prop)
hisher
(species-of user))
wet-list)
(push (format nil "You lift your leg near the ~a and flood your pamps, then squat down on all fours and mess"
(name-of prop))
both-list)
(push (format nil "~a squats down on all fours~a like an animal and messes ~a diapers"
name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail raised"
hisher)
"")
hisher)
mess-list))
(do-push (format nil "~a goes potty in ~a diapers like a toddler"
name
hisher)
wet-list mess-list both-list)
(when (>= (getf wet-return-value :wet-amount) (bladder/potty-desperate-limit-of user))
(do-push (format nil "after doing a potty dance like a 5 year old, ~a floods ~a diapers with a huge sigh of relief"
name
hisher)
wet-list))
(when (filter-items (wear-of user) '(and diaper ab-clothing))
(do-push (format nil "Aww, is the baby using ~a diapers?"
hisher)
wet-list mess-list both-list))
(push (format nil "~a pauses and floods ~a diapers"
name
hisher)
wet-list)
(push (format nil "~a squats down~a and fills ~a diapers"
name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail raised"
hisher)
"")
hisher)
mess-list)
(push (format nil "heh, the baby blorted ~a diapers" hisher) mess-list)
(push (format nil "~a diapers sprung a leak" name) wet-leak-list)
(do-push (format nil
"~a's diapers leak all over, there goes the carpet" name)
wet-leak-list mess-leak-list both-leak-list)
(push (format nil "Blowout!!!") mess-leak-list)
(push (format nil "Heh, baby made a puddle") wet-leak-list)
(push (format nil "~a piddles ~a pamps" name hisher) wet-list))
((filter-items (wear-of user) 'pullup)
(when prop
(push (format nil "~a lifts ~a leg near the ~a and floods ~a pullups"
name
hisher
(name-of prop)
hisher)
wet-list)
(push (format nil "~a lifts ~a leg near the ~a and floods ~a pullups, then squats down on all fours and messes"
name
hisher
(name-of prop)
hisher)
both-list)
(when (s:memq (car (tail-of user)) '(:medium :large))
(push (format nil "~a squats down on all fours with ~a tail raised like an animal and messes ~a pullups"
name
hisher
hisher)
mess-list)))
(do-push (format nil
"~a's pullups leak all over, there goes the carpet" name)
wet-leak-list mess-leak-list both-leak-list)
(when (filter-items (wear-of user) '(and pullup ab-clothing))
(do-push
(format nil "Bad ~a! You know you're supposed to use the toilet like a big kid"
(if male "boy" "girl"))
wet-list mess-list both-list)
(when (>= (getf wet-return-value :wet-amount) (bladder/potty-desperate-limit-of user))
(do-push (format nil "after doing a potty dance like a 5 year old, ~a floods ~a pullups with a huge sigh of relief and just hopes no one will notice"
name
hisher)
wet-list))
(do-push (format nil "Bad ~a! Look at the mess you made leaking everywhere like that! Do we have to put you back in diapers?!"
(if (malep user) "boy" "girl"))
wet-leak-list mess-leak-list both-leak-list))
(push (format nil "~a squats down and messes ~a pullups like a toddler"
name
hisher)
mess-list)
(do-push (format nil "~a goes potty in ~a pullups like a toddler"
name
hisher)
mess-list wet-list both-list)
(push (format nil "~a pauses and floods ~a pullups"
name
hisher)
wet-list)
(push (format nil "~a floods ~a pullups like a toddler"
name
hisher)
wet-list)
(push (format nil "~a mess falls out of ~a pullups and on the floor"
name
hisher)
mess-leak-list)
(push (format nil "~a's pullups sprung a leak"
name)
wet-leak-list)
(push (format nil "~a makes a puddle"
name)
wet-leak-list)
(when (eq user (player-of *game*))
(push (format nil "You made a puddle on the floor. You sure you're ready for pullups?")
wet-leak-list)))
((filter-items (wear-of user) 'stuffer)
(push (format nil "~a floods ~aself like a toddler"
name
hisher)
wet-list)
(push (format nil "~a squats down and mess ~aself like a toddler"
name
hisher)
mess-list)
(do-push (format nil "~a goes potty in ~a pants like a toddler"
name
hisher)
wet-list mess-list both-list)
(push (format nil "A puddle forms on the floor. Maybe ~a should start wearing diapers"
(if (eq user (player-of *game*)) "you" name))
wet-leak-list)
(do-push (format nil "Heh, baby made a mess on the floor")
wet-leak-list mess-leak-list both-leak-list))
(t
(do-push (format nil "~a realized ~a made a horrible mistake. ~a's not wearing any padding!!!"
name
(if (malep user) "he" "she")
(if (malep user) "He" "She"))
wet-leak-list mess-leak-list both-leak-list)
(push (format nil "~a flood ~aself like a toddler"
(name-of user)
(if (malep user) "him" "her"))
wet-list)
(push (format nil "~a squats down and messes ~aself like a toddler"
(name-of user)
(if (malep user) "him" "her"))
mess-list)
(do-push (format nil "~a goes potty in ~a pants like a toddler"
(name-of user)
hisher)
wet-list mess-list both-list)
(push (format nil "A puddle forms on the floor. Maybe ~a should start wearing diapers"
(if (eq user (player-of *game*)) "you" name))
wet-leak-list)
(do-push (format nil "Heh, baby made a mess on the floor")
wet-leak-list mess-leak-list both-leak-list)))
(format-lists)
(format-leak-lists)
(multiple-value-bind (value key)
(pop-from-expansion user (cons wet-return-value mess-return-value))
(when (eq key :wet/mess)
(setf wet-return-value (car value)
mess-return-value (cdr value))))
(funcall (coerce (potty-trigger-of (get-zone (position-of (player-of *game*)))) 'function)
(cons wet-return-value mess-return-value) user))))))))
(defun coerce-element-types (element-types)
(iter (for element-type in (a:ensure-list element-types))
(collect (coerce-element-type element-type))))
(defun get-props-from-zone (position)
(props-of (get-zone position)))
(defun get-items-from-prop (prop position)
(items-of (getf (get-props-from-zone position) prop)))
(defun get-bitcoins-from-prop (prop position)
(bitcoins-of (getf (get-props-from-zone position) prop)))
(defun (setf get-items-from-prop) (new-value prop position)
(setf (items-of (getf (get-props-from-zone position) prop)) new-value))
(defun (setf get-bitcoins-from-prop) (new-value prop position)
(setf (bitcoins-of (getf (get-props-from-zone position) prop)) new-value))
(defun (setf get-props-from-zone) (new-value position)
(setf (props-of (eval (get-zone position))) new-value))
(defun pushnewmove (move* user)
(pushnew (make-instance move*) (moves-of user)
:test (lambda (a b)
(eq (s:class-name-of a) (s:class-name-of b)))))
(defun get-move (move* user)
(find move* (moves-of user)
:test (lambda (a b)
(if (typep a 'keyword)
(string= a (s:class-name-of b))
(eq a (s:class-name-of b))))))
(defunassert calculate-diaper-usage (user)
(user base-character)
(iter
(with sogginess = 0)
(with sogginess-capacity = 0)
(with messiness = 0)
(with messiness-capacity = 0)
(for i in (wear-of user))
(when (typep i 'closed-bottoms)
(incf sogginess (sogginess-of i))
(incf sogginess-capacity (sogginess-capacity-of i))
(incf messiness (messiness-of i))
(incf messiness-capacity (messiness-capacity-of i)))
(finally (return `(:sogginess ,sogginess :sogginess-capacity ,sogginess-capacity
:messiness ,messiness :messiness-capacity ,messiness-capacity)))))
(defunassert calculate-diaper-usage* (clothes)
(clothes list)
(iter
(with sogginess = 0)
(with sogginess-capacity = 0)
(with messiness = 0)
(with messiness-capacity = 0)
(for i in clothes)
(when (typep i 'closed-bottoms)
(incf sogginess (sogginess-of i))
(incf sogginess-capacity (sogginess-capacity-of i))
(incf messiness (messiness-of i))
(incf messiness-capacity (messiness-capacity-of i)))
(finally (return `(:sogginess ,sogginess :sogginess-capacity ,sogginess-capacity
:messiness ,messiness :messiness-capacity ,messiness-capacity)))))
(defunassert calculate-level-to-exp (level)
(level real)
(floor (/ (* 4 (expt level 3)) 5)))
(defunassert calculate-exp-yield (target)
(target enemy)
(u:$ (exp-yield-of target) * (level-of target) / 7))
(defunassert calculate-wear-stats (user)
(user base-character)
(iter
(with j = (list :health 0 :attack 0 :defense 0 :energy 0 :speed 0))
(for i in (wear-of user))
(iter
(for (a b) on (wear-stats-of i) by #'cddr)
(incf (getf j a) b))
(finally (return j))))
(defunassert calculate-wield-stats (user)
(user base-character)
(iter
(with j = (list :health 0 :attack 0 :defense 0 :energy 0 :speed 0))
(for (a b) on (if (wield-of user) (wield-stats-of (wield-of user)) ()) by #'cddr)
(incf (getf j a) b)
(finally (return j))))
(defunassert calculate-stat-delta (user)
(user base-character)
(iter
(with j = (list :health 0 :attack 0 :defense 0 :energy 0 :speed 0))
(for i in (status-conditions user))
(iter
(for (a b) on (stat-delta-of i) by #'cddr)
(incf (getf j a) b))
(finally (return j))))
(defunassert calculate-stat-multiplier (user)
(user base-character)
(iter
(with j = (list :health 1 :attack 1 :defense 1 :energy 1 :speed 1))
(for i in (status-conditions user))
(iter
(for (a b) on (stat-multiplier-of i) by #'cddr)
(declare (ignorable b))
(setf (getf j a) (* (getf j a))))
(finally (return j))))
(defunassert calculate-stat (user stat-key)
(user base-character)
(round (if (or (eq stat-key :health) (eq stat-key :energy))
(u:$ (u:$ (u:$ (u:$ (u:$ (getf (base-stats-of user) stat-key) +
(getf (iv-stats-of user) stat-key) +
(getf (calculate-wear-stats user) stat-key) +
(getf (calculate-wield-stats user) stat-key) +
(getf (calculate-stat-delta user) stat-key))
* (getf (calculate-stat-multiplier user) stat-key)
* 2)
* (level-of user))
/ 100)
+ (level-of user) + 10)
(u:$ (u:$ (u:$ (u:$ (u:$ (getf (base-stats-of user) stat-key) +
(getf (iv-stats-of user) stat-key) +
(getf (calculate-wear-stats user) stat-key) +
(getf (calculate-wield-stats user) stat-key) +
(getf (calculate-stat-delta user) stat-key))
* (getf (calculate-stat-multiplier user) stat-key)
* 2)
* (level-of user))
/ 100)
+ 5))))
(defun effective-type-effectiveness (source-element-types target-element-types)
(iter (with (the fixnum super-effective) = 0)
(with (the fixnum not-very-effective) = 0)
(with (the fixnum no-effect) = 0)
(for source-element-type in source-element-types)
(iter (for target-element-type in target-element-types)
(case (type-match source-element-type target-element-type)
(:super-effective (incf super-effective))
(:not-very-effective (incf not-very-effective))
(:no-effect (incf no-effect))))
(finally (return (apply 'values (if (> no-effect 0)
'(:no-effect 0)
(let ((magnitude (- super-effective not-very-effective)))
(a:switch (magnitude :test (lambda (o e)
(funcall e o 0)))
('< `(:not-very-effective ,magnitude))
('> `(:super-effective ,magnitude))
('= '(nil 0))))))))))
(defun present-stats (user)
(updating-present-with-effective-frame (*query-io* :unique-id `(stats% ,user) :id-test #'equal)
(clim:updating-output (*query-io*)
(clim:present user (type-of user) :view yadfa-clim:+stat-view+))))
(defun describe-item (item &optional wear)
(format t
"Name: ~a~%Resale Value: ~f~%Description:~%~a~%"
(name-of item)
(/ (value-of item) 2)
(description-of item))
(if wear
(describe-diaper-wear-usage item)
(describe-diaper-inventory-usage item))
(describe-diaper-usage item)
(when (typep item 'weapon)
(format t "Ammo Type: ~s" (ammo-type-of item)))
(when (special-actions-of item)
(iter (for (a b) on (special-actions-of item) by #'cddr)
(format t "Keyword: ~a~%Other Parameters: ~w~%Documentation: ~a~%~%Describe: ~a~%~%"
a
(cddr (lambda-list (action-lambda b)))
(documentation b t)
(with-output-to-string (s)
(let ((*standard-output* s))
(describe (action-lambda b)))))))
t)
(defun finish-battle (&optional lose &aux (player (player-of *game*)) (male (malep player)) (name (name-of player))
(position (position-of player)) (enemies (enemies-of *battle*)) (team (team-of *game*)))
(if lose
(progn (format t "~a was defeated~%" name)
(setf (position-of player) (warp-on-death-point-of player))
(format t
"~a blacked out and flooded and messed ~aself~%~a wakes up and looks at ~a GPS to find out ~a's at ~a at ~a~%"
name
(if male "him" "her")
name
(if male "his" "her")
(if male "he" "she")
(name-of (get-zone position))
position)
(iter (for user in (cons player (allies-of *game*)))
(setf (health-of user) (calculate-stat user :health))
(setf (energy-of user) (calculate-stat user :energy)))
(let ((exp-gained (/ (iter (for enemy in enemies)
(with j = 0)
(incf j (calculate-exp-yield enemy))
(finally (return j)))
2)))
(iter (for team-member in team)
(incf (exp-of team-member) exp-gained)
(let ((old-level (level-of team-member)))
(iter (while (>= (exp-of team-member) (calculate-level-to-exp (+ (level-of team-member) 1))))
(incf (level-of team-member)))
(when (> (level-of team-member) old-level)
(format t "~a level-uped to ~d~%" (name-of team-member) (level-of team-member))
(iter (for level from (1+ old-level) to (level-of team-member))
(iter (for learned-move in (learned-moves-of team-member))
(when (= (car learned-move) level)
(unless (get-move (cdr learned-move) team-member)
(pushnewmove (cdr learned-move) team-member)
(format t "~a learned ~a~%" (name-of team-member) (name-of (get-move (cdr learned-move) team-member)))))))))))
(iter (for team-member in team)
(wet :force-fill-amount (bladder/maximum-limit-of team-member))
(mess :force-fill-amount (bowels/maximum-limit-of team-member))))
(progn (format t "~a won the battle~%~%" name)
(let ((items-looted (iter (for enemy in enemies)
(with j = ())
(setf j (append* j (inventory-of enemy) (wear-of enemy)))
(setf (inventory-of enemy) nil
(wear-of enemy) nil)
(finally (return j))))
(bitcoins-looted (iter (for enemy in enemies)
(with j = 0)
(incf j (if (bitcoins-per-level-of enemy)
(* (bitcoins-per-level-of enemy) (level-of enemy))
(bitcoins-of enemy)))
(finally (return j))))
(exp-gained (iter (for enemy in enemies)
(with j = 0)
(incf j (calculate-exp-yield enemy))
(finally (return j))))
(win-events (win-events-of *battle*)))
(iter (for team-member in team)
(incf (exp-of team-member) exp-gained)
(let ((old-level (level-of team-member)))
(iter (while (>= (exp-of team-member) (calculate-level-to-exp (+ (level-of team-member) 1))))
(incf (level-of team-member)))
(when (> (level-of team-member) old-level)
(format t "~a level-uped to ~d~%" (name-of team-member) (level-of team-member))
(iter (for level from (1+ old-level) to (level-of team-member))
(iter (for learned-move in (learned-moves-of team-member))
(when (= (car learned-move) level)
(unless (get-move (cdr learned-move) team-member)
(pushnewmove (cdr learned-move) team-member)
(format t "~a learned ~a~%" (name-of team-member) (name-of (get-move (cdr learned-move) team-member))))))))))
(cond ((and items-looted (> bitcoins-looted 0))
(format t "~a loots ~d bitcoins and ~d ~a from the enemies~%"
name
bitcoins-looted
(list-length items-looted)
(if (= (list-length items-looted) 1)
"item"
"items")))
(items-looted
(format t "~a loots ~d ~a from the enemy~%"
name
(list-length items-looted)
(if (= (list-length items-looted) 1)
"item"
"items")))
((> bitcoins-looted 0)
(format t "~a loots ~d bitcoins from the enemy~%" name bitcoins-looted)))
(incf (bitcoins-of player) bitcoins-looted)
(a:nconcf (inventory-of player) items-looted)
(setf (continue-battle-of (get-zone position)) nil)
(trigger-event win-events))))
(setf *battle* nil)
(iter (for character in (team-of *game*))
;; Most of the dialog outside of battle makes no sense when the character is fainted
;; and changing the game's logic and dialog to make it make sense is too complicated,
;; so fuck it, characters don't faint outside of battle
(when (<= (health-of character) 0)
(setf (health-of character) (calculate-stat character :health))))
(switch-user-packages))
(defun wash (clothing)
(declare (type list clothing))
(iter (for i in (filter-items clothing 'closed-bottoms))
(when (not (disposablep i))
(setf (sogginess-of i) 0 (messiness-of i) 0))))
(defun go-to-sleep% (user)
(incf (time-of *game*) 60)
(let ((time-difference (- (time-of *game*) (last-process-potty-time-of user))))
(fill-bladder user :times time-difference)
(fill-bowels user :times time-difference))
(setf (health-of user) (calculate-stat user :health)
(last-process-potty-time-of user) (time-of *game*)
(energy-of user) (calculate-stat user :energy))
(cons (wet :wetter user) (mess :messer user)))
(defun go-to-sleep ()
(iter (for i in (cons (player-of *game*) (allies-of *game*)))
(let* ((return-value (go-to-sleep% i))
(out ())
(male (malep i))
(hisher (if male "his" "her"))
(name (name-of i))
(cheshe (if male "He" "She")))
(multiple-value-bind (value key)
(pop-from-expansion i return-value)
(when (eq key :wet/mess)
(setf return-value value)))
(format t "~a wakes up " (name-of i))
(when (> (getf (car return-value) :wet-amount) 0)
(cond ((filter-items (wear-of i) 'diaper)
(if (> (getf (car return-value) :leak-amount) 0)
(progn (push (format nil "feeling all cold and soggy. ~a checks ~a diaper and to ~a embarrassment finds out it's leaking profusely. Seems ~a wet the bed.~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(progn (push (format nil "and hears a squish . ~a looks down at ~a diaper, notices that it's soggy and then folds ~a ears back and blushes. Looks like ~a wet the bed~%"
cheshe
hisher
hisher
name)
out)
(push (format nil "and looks down and pokes ~a diaper, then gets all blushy when it squishes. Seems ~a wet the bed~%"
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
((filter-items (wear-of i) 'pullup)
(if (> (getf (car return-value) :leak-amount) 0)
(progn (push (format nil "feeling all cold and soggy. ~a checks ~a pullups and to ~a embarrassment finds out it's leaking profusely. Seems ~a wet the bed.~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(progn (push (format nil "and hears a squish. ~a looks down at ~a pullups, notices that ~a and then folds ~a ears back and blushes. Looks like ~a wet the bed~%"
cheshe
(if (filter-items (wear-of i) '(ab-clothing pullup))
"the little pictures have faded"
"it's soggy")
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
((filter-items (wear-of i) 'stuffer)
(if (> (getf (car return-value) :leak-amount) 0)
(progn (push (format nil "feeling all cold and soggy. ~a notices ~a PJs, the padding under ~a PJs, and bed are soaked. Seems ~a wet the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(progn (push (format nil "and hears a squish from under ~a PJs. ~a checks the incontinence pad under them and notices that they're soaked and then folds ~a ears back and blushes. Looks like ~a wet the bed~%"
hisher
cheshe
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
((filter-items (wear-of i) 'closed-bottoms)
(push (format nil "feeling all cold and soggy. ~a notices ~a PJs and bed are soaked then folds ~a ears back and blushes. Seems ~a wet the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(t
(push (format nil "feeling all cold and soggy. ~a notices the bed is soaked then folds ~a ears back and blushes. Seems ~a wet the bed~%"
cheshe
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
(when (and (> (getf (cdr return-value) :mess-amount) 0) (> (getf (car return-value) :wet-amount) 0))
(format t "~a is also " (name-of i)))
(when (> (getf (cdr return-value) :mess-amount) 0)
(cond
((filter-items (wear-of i) 'diaper)
(if (> (getf (cdr return-value) :leak-amount) 0)
(progn
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a diaper is leaking poo all over the bed. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(progn
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a diaper is filled with poo. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
((filter-items (wear-of i) 'pullup)
(if (> (getf (cdr return-value) :leak-amount) 0)
(progn
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a pullups is leaking poo all over the bed. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(progn
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a pullup is filled with poo. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
((filter-items (wear-of i) 'stuffer)
(if (> (getf (cdr return-value) :leak-amount) 0)
(progn
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a incontinence pad is leaking poo all over the bed and PJs. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(progn
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a incontinence pad is filled with poo. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))
((filter-items (wear-of i) 'closed-bottoms)
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a PJs have poo in them and is getting on the bed. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))
(t
(push (format nil
"feeling all mushy. ~a notices to ~a embarrassment that ~a bed has poo on it. Seems ~a messed the bed~%"
cheshe
hisher
hisher
name)
out)
(format t "~a" (a:random-elt out))
(setf out ()))))))
t)
(defunassert shopfun (items-for-sale &key items-to-buy items-to-sell user format-items)
(user (or base-character null)
items-to-buy (or list boolean)
items-to-sell (or list boolean)
items-for-sale list)
(when items-to-buy
(if (eq items-to-buy t)
(let (item quantity)
(accept-with-effective-frame (clim:accepting-values (*query-io* :resynchronize-every-pass t)
(fresh-line *query-io*)
(setf item (clim:accept `(clim:member-alist ,(iter (for i in items-for-sale)
(collect (list (name-of (apply 'make-instance (car i) (eval (cdr i))))
i)))) :prompt "Item"
:view (make-instance 'clim:radio-box-view
:orientation :vertical)
:stream *query-io*))
(fresh-line *query-io*)
(setf quantity (clim:accept 'string :prompt "Quantity"
:view clim:+text-field-view+ :stream *query-io*))))
(when (and quantity item (handler-case (if (typep (parse-integer quantity) '(integer 1 *))
t
(progn (format t "Quantity must be an '(integer 1 *)~%")
nil))
(parse-error () (format t "does ~w look like an integer to you?~%" quantity)
nil)))
(setf quantity (parse-integer quantity))
(let ((temp (apply 'make-instance (car item) (eval (cdr item)))))
(cond ((> (* (value-of temp) quantity) (bitcoins-of user))
(format t "You don't have enough bitcoins to buy ~a~%"
(if (= quantity 1)
(format nil "that ~a" (name-of item))
(format nil "~d ~a"
quantity
(if (plural-name-of temp)
(plural-name-of temp)
(format nil "~as" (name-of temp)))))))
(t (dotimes (j quantity)
(push (apply #'make-instance
(car item)
(eval (cdr item)))
(inventory-of user)))
(decf (bitcoins-of user) (* (value-of temp) quantity))
(format t "You buy ~d ~a for ~f bitcoins~%"
quantity
(or (plural-name-of temp) (format nil "~as" (name-of temp)))
(* (value-of temp) quantity)))))))
(iter (for i in items-to-buy)
(let ((item (when (list-length-<= (car i) items-for-sale)
(apply #'make-instance
(car (nth (car i) items-for-sale))
(eval (cdr (nth (car i) items-for-sale)))))))
(cond ((not item)
(format t "item ~d doesn't exist~%" (car i)))
((> (* (value-of item) (cdr i)) (bitcoins-of user))
(format t "You don't have enough bitcoins to buy ~a~%"
(if (= (cdr i) 1)
(format nil "that ~a" (name-of item))
(format nil "~d ~a"
(cdr i)
(if (plural-name-of item)
(plural-name-of item)
(format nil "~as" (name-of item)))))))
(t (dotimes (j (cdr i))
(push (apply #'make-instance
(car (nth (car i) items-for-sale))
(eval (cdr (nth (car i) items-for-sale))))
(inventory-of user)))
(decf (bitcoins-of user) (* (value-of item) (cdr i)))
(format t "You buy ~d ~a for ~f bitcoins~%"
(cdr i)
(or (plural-name-of item) (format nil "~as" (name-of item)))
(* (value-of item) (cdr i)))))))))
(when items-to-sell
(if (eq items-to-sell t)
(let (items)
(accept-with-effective-frame (clim:accepting-values (*query-io* :resynchronize-every-pass t)
(setf items (clim:accept `(clim:subset-alist ,(iter (for item in (remove-duplicates (inventory-of user)))
(collect (cons (name-of item)
item)))) :prompt "Items"
:view clim:+check-box-view+ :stream *query-io*))))
(iter (for i in items)
(format t "You sell your ~a for ~f bitcoins~%"
(name-of i)
(/ (value-of i) 2))
(incf (bitcoins-of user) (/ (value-of i) 2)))
(a:deletef (the list (inventory-of user)) items :test (lambda (o e)
(s:memq e o))))
(let ((items (sort (remove-duplicates items-to-sell) #'<)))
(setf items (iter (generate i in items)
(for j in (inventory-of user))
(for (the fixnum k) upfrom 0)
(when (first-iteration-p)
(next i))
(when (= k i)
(collect j)
(next i))))
(unless items
(format t "Those items aren't valid")
(return-from shopfun))
(iter (for i in items)
(when (not (sellablep i))
(format t "That item isn't sellable~%~%")
(return-from shopfun)))
(iter (for i in items)
(format t "You sell your ~a for ~f bitcoins~%"
(name-of (nth i (inventory-of user)))
(/ (value-of (nth i (inventory-of user))) 2))
(incf (bitcoins-of user) (/ (value-of i) 2)))
(a:deletef (the list (inventory-of user)) items
:test (lambda (o e)
(s:memq e o))))))
(when format-items
(format t "~10a~40a~10@a~%" "Index" "Item" "Price")
(iter (for i in items-for-sale)
(for (the fixnum j) upfrom 0)
(let ((item (apply #'make-instance (car i) (eval (cdr i)))))
(format t "~10a~40a~10@a~%" j (name-of item) (value-of item))))))
(defun getf-action-from-prop (position prop action)
(getf (actions-of (getf (get-props-from-zone position) prop)) action))
(defun (setf getf-action-from-prop) (new-value position prop action)
(setf (getf (actions-of (getf (get-props-from-zone position) prop)) action) new-value))
(defunassert wash-in-washer (washer)
(washer (or yadfa-props:washer null))
"washes your dirty diapers and all the clothes you've ruined. WASHER is an instance of a washer you want to put your clothes in."
(declare (ignorable washer))
(wash (inventory-of (player-of *game*)))
(write-line "You washed all your soggy and messy clothing. Try not to wet and mess them next time"))
(defun process-battle (&key attack item reload no-team-attack selected-target)
"function used to iterate through the battle. @var{ATTACK} is the key of an attack or @code{T} to use the default attack. Pass @code{NIL} if the team member isn't attacking. @var{ITEM} is the item the team member is using, pass @code{NIL} if the team member isn't using an item. @var{RELOAD} is the type specifier of the ammo the team member is using to reload his/her weapon. Pass @code{NIL} if the team member isn't reloading a weapon. set @var{NO-TEAM-ATTACK} to T if the team member isn't attacking first. @var{SELECTED-TARGET} is the target the team member is attacking. set this to @code{NIL} if the team member isn't attacking someone."
(declare (type (or enemy team-member null) selected-target)
(type (or symbol boolean) attack)
(type type-specifier reload)
(type (or item null) item))
(fresh-line)
(when (and (not attack) (not item))
(write-line "You need to either specify an attack or an item to use")
(return-from process-battle))
(let* ((ret nil)
(team-attacked no-team-attack))
(flet ((check-if-done ()
(s:run-hooks '*cheat-hooks*)
(iter (for character in (append (team-of *game*) (enemies-of *battle*)))
(handle-faint character))
(unless (set-difference (team-of *game*) (fainted-of *battle*))
(finish-battle t)
(return-from process-battle t))
(unless (set-difference (enemies-of *battle*) (fainted-of *battle*))
(finish-battle)
(return-from process-battle t))))
(check-if-done)
(unless (or (eq attack t) (get-move attack (first (turn-queue-of *battle*))))
(format t "~a doesn't know ~a~%" (name-of (first (turn-queue-of *battle*))) attack)
(return-from process-battle))
(when item
(multiple-value-bind (cant-use plist) (cant-use-p item (car (turn-queue-of *battle*)) selected-target nil)
(when cant-use
(destructuring-bind (&key format-control format-arguments &allow-other-keys) plist
(if format-control
(apply 'format t format-control format-arguments)
(write-line "You can't do that with that item"))
(return-from process-battle)))))
(when (and (not (eq attack t)) (< (energy-of (first (turn-queue-of *battle*))) (energy-cost-of (get-move attack (first (turn-queue-of *battle*))))))
(format t "~a doesn't have enough energy to use ~a~%"
(name-of (first (turn-queue-of *battle*))) (name-of (get-move attack (first (turn-queue-of *battle*)))))
(return-from process-battle))
(iter (until (and team-attacked (typep (first (turn-queue-of *battle*)) 'team-member)))
(check-if-done)
(let* ((current-character (pop (turn-queue-of *battle*)))
(new-ret (process-battle-turn current-character attack item reload selected-target)))
(iter (for i in (append (team-of *game*) (team-npcs-of *battle*) (enemies-of *battle*)))
(pop-from-expansion i))
(when (typep current-character '(not npc))
(setf team-attacked t
ret new-ret)))
(check-if-done)
(unless (turn-queue-of *battle*)
(incf (time-of *game*))
(setf (turn-queue-of *battle*)
(s:dsu-sort (iter (for i in (append (enemies-of *battle*) (team-npcs-of *battle*) (team-of *game*)))
(when (> (health-of i) 0)
(collect i)))
'>
:key (lambda (a) (calculate-stat a :speed))))))
(format t "~a is next in battle~%" (name-of (first (turn-queue-of *battle*))))
ret)))
(defunassert ally-join (ally)
(ally ally)
(format t "~a Joins the team~%" (name-of ally))
(when (> (bitcoins-of ally) 0)
(format t "~a gets ~f bitcoins from ~a~%" (name-of (player-of *game*)) (bitcoins-of ally) (name-of ally)))
(when (inventory-of ally)
(format t "~a gets some loot from ~a~%" (name-of (player-of *game*)) (name-of ally))
(pushnew ally (allies-of *game*)))
(incf (bitcoins-of (player-of *game*)) (bitcoins-of ally))
(appendf* (inventory-of (player-of *game*)) (inventory-of ally))
(setf (inventory-of ally) ()
(bitcoins-of ally) 0)
t)
(defun use-item% (item user &rest keys &key target action &allow-other-keys
&aux (effective-action (getf (special-actions-of item) action)) (script (when effective-action
(action-lambda effective-action))))
(unless (apply 'cant-use-p item user target action keys)
(cond ((and action effective-action)
(error 'item-action-missing :action action :item item))
((and (not action)
(not (compute-applicable-methods #'use-script (list item user target))))
(error 'item-use-script-missing-error :format-control "~s has no ~s method defined" :format-arguments `(,item use-script))))
(let ((ret (if script
(apply (coerce script 'function) item target keys)
(use-script item user target))))
(when (consumablep item)
(a:deletef (the list (inventory-of user)) item))
(when (> (health-of target) (calculate-stat target :health))
(setf (health-of target) (calculate-stat target :health)))
(when (> (energy-of target) (calculate-stat target :energy))
(setf (energy-of target) (calculate-stat target :energy)))
ret)))
(defunassert set-player (name malep species)
(malep boolean
name simple-string
species simple-string)
"Sets the name, gender, and species of the player"
(setf (name-of (player-of *game*)) name)
(setf (species-of (player-of *game*)) species)
(setf (malep (player-of *game*)) malep)
t)
(defun intro-function (&aux (default (make-instance 'player))
(wear '(yadfa-items:short-dress yadfa-items:tshirt yadfa-items:bra yadfa-items:jeans
yadfa-items:boxers yadfa-items:panties yadfa-items:pullups yadfa-items:diaper))
name male species clothes bladder bowels fill-rate wings skin tail tail-type bio)
"This function sets up the player and prints the back story. If you're trying to create your own game with a different storyline using a mod, you can replace this function. Be careful when enabling mods that change the story line this significantly as they can overwrite each other"
(write-line "Enter your character's name, gender, and species" *query-io*)
(clim:accepting-values (*query-io* :resynchronize-every-pass t :exit-boxes '((:exit "Accept")))
(fresh-line *query-io*)
(setf name (clim:accept 'string :prompt "Name" :default (name-of default) :view clim:+text-field-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf male (clim:accept 'boolean :prompt "Is Male"
:default (malep default) :view clim:+toggle-button-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf species (clim:accept 'string :prompt "Species"
:default (species-of default) :view clim:+text-field-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf clothes (clim:accept `((clim:subset-completion ,wear) :name-key ,(lambda (o) (name-of (make-instance o))))
:prompt "Clothes" :view clim:+check-box-view+ :default '(yadfa-items:tshirt yadfa-items:diaper)
:stream *query-io*))
(fresh-line *query-io*)
(setf bladder (clim:accept '(clim:completion (:normal :low :overactive))
:prompt "Bladder capacity" :default :normal :view clim:+option-pane-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf bowels (clim:accept '(clim:completion (:normal :low :kid))
:prompt "Bowels capacity" :default :normal :view clim:+option-pane-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf fill-rate (clim:accept '(clim:completion (:normal :fast :faster))
:prompt "Bladder/Bowels fill rate" :default :normal :view clim:+option-pane-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf bio (clim:accept 'string :prompt "Description" :default (description-of default) :view '(clim:text-editor-view :ncolumns 80 :nlines 7)
:stream *query-io*)))
(clim:accepting-values (*query-io* :resynchronize-every-pass t :exit-boxes '((:exit "Accept")))
(setf tail-type (clim:accept '(clim:completion (:small :medium :large :lizard :bird-small :bird-large nil))
:prompt "Tail type" :default (car (tail-of default)) :view clim:+option-pane-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf tail (clim:accept '((clim:subset-completion (:multi :scales :fur :feathers)))
:prompt "Tail attributes" :default (cdr (tail-of default)) :view clim:+check-box-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf wings (clim:accept '((clim:subset-completion (:scales :fur :feathers)))
:prompt "Wings attributes" :default (wings-of default) :view clim:+check-box-view+ :stream *query-io*))
(fresh-line *query-io*)
(setf skin (clim:accept '((clim:subset-completion (:scales :fur :feathers)))
:prompt "Skin attributes" :default (skin-of default) :view clim:+check-box-view+ :stream *query-io*)))
(setf (player-of *game*) (make-instance 'player
:position '(0 0 0 yadfa-zones:home)
:name name
:male male
:species species
:description bio
:skin skin
:wings wings
:tail (when tail-type (cons tail-type tail))
:bladder/need-to-potty-limit (getf '(:normal 300 :low 200 :overactive 149) bladder)
:bladder/potty-dance-limit (getf '(:normal 450 :low 300 :overactive 150) bladder)
:bladder/potty-desperate-limit (getf '(:normal 525 :low 350 :overactive 160) bladder)
:bladder/maximum-limit (getf '(:normal 600 :low 400 :overactive 200) bladder)
:bladder/contents (getf '(:normal 450 :low 300 :overactive 150) bladder)
:bowels/need-to-potty-limit (getf '(:normal 400 :low 800/3 :kid 140) bowels)
:bowels/potty-dance-limit (getf '(:normal 600 :low 400 :kid 210) bowels)
:bowels/potty-desperate-limit (getf '(:normal 700 :low 1400/3 :kid 245) bowels)
:bowels/maximum-limit (getf '(:normal 800 :low 1600/3 :kid 280) bowels)
:bladder/fill-rate (getf '(:normal 25/9
:fast 50/9
:faster 100/9)
fill-rate)
:bowels/fill-rate (getf '(:normal 5/9
:fast 10/9
:faster 20/9)
fill-rate)
:wear (iter (for i in wear)
(when (s:memq i clothes)
(collect (make-instance i))))))
(setf (team-of *game*) (list (player-of *game*)))
(iter (for i in (iter (for i in '(yadfa-items:diaper yadfa-items:pullups yadfa-items:boxers yadfa-items:panties))
(when (s:memq i clothes)
(collect i))))
(dotimes (j (random 20))
(push (make-instance i)
(get-items-from-prop :dresser (position-of (player-of *game*))))))
(write-line "You wake up from sleeping, the good news is that you managed to stay dry throughout the night. Bad news is your bladder filled up during the night. You would get up and head to the toilet, but the bed is too comfy, so you just lay there holding it until the discomfort of your bladder exceeds the comfort of your bed. Then eventually get up while holding yourself and hopping from foot to foot hoping you can make it to a bathroom in time" *query-io*))
| 121,345 | Common Lisp | .lisp | 2,111 | 38.122691 | 840 | 0.485436 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | da3ed68e47c14ff236aa2281f3bc64933df31aa1a855fdc3104c3a7e74682078 | 15,660 | [
-1
] |
15,661 | classes.lisp | pouar_yadfa/core/libexec/classes.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defmethod ms:class-persistent-slots ((self standard-object))
(mapcar #'c2mop:slot-definition-name
(c2mop:class-slots (class-of self))))
(defun print-slot (object slot stream)
(if (slot-boundp object slot)
(write (slot-value object slot) :stream stream)
(write-string "#<unbound>" stream)))
(defclass yadfa-class ()
((attributes
:initarg :attributes
:initform '()
:accessor attributes-of
:type list
:documentation "Plist of attributes which are used instead of slots for stuff that aren't shared between slots"))
(:documentation "All the classes that are part of the game's core inherit this class"))
(defclass element-type-class (standard-class) ((name :initform nil)))
(defmethod name-of ((class element-type-class))
(or (slot-value class 'name) (class-name class)))
(defmethod c2mop:validate-superclass ((class element-type-class) (superclass standard-class)) t)
(defmethod c2mop:validate-superclass ((class standard-class) (superclass element-type-class))
(error 'simple-error :format-control "Either you didn't use ~s to define ~s or you tried to inherit a class not defined with ~s" :format-arguments `(define-type ,(class-name class) define-type)))
(defclass element-type () () (:metaclass element-type-class))
(defmethod make-load-form ((object element-type) &optional env)
(make-load-form-saving-slots object :environment env))
(defclass buff () ()
(:documentation #.(f:fmt nil "mixin for " (ref move :class) " or " (ref item :class) " that sets specified " (ref status-condition :class) " that causes buffs also uses this mixin")))
(defclass debuff () ()
(:documentation #.(f:fmt nil "mixin for " (ref move :class) " or " (ref item :class) " that sets specified " (ref status-condition :class) " that causes debuffs also uses this mixin")))
(defclass clear-status-mixin ()
((statuses-cleared
:initarg :statuses-cleared
:accessor statuses-cleared-of
:initform ()
:type list
:documentation "Status conditions that this move or item clears"))
(:documentation #.(f:fmt nil "mixin for " (ref move :class) " or " (ref item :class) " that clears specified " (ref status-condition :class))))
(defclass element-type-mixin ()
((element-types
:accessor element-types-of
:initform nil
:initarg :element-types
:type list
:documentation #.(f:fmt nil "a list of " (ref element-type :class) "s or symbols that makes @code{CL:MAKE-INSTANCE} return one when passed to it"))))
(defclass base-character (yadfa-class element-type-mixin)
((name
:initarg :name
:initform :missingno.
:accessor name-of
:type (or keyword string)
:documentation "Name of the character")
(description
:initarg :description
:initform :?
:accessor description-of
:type (or keyword string)
:documentation "Description of the character")
(health
:initarg :health
:reader health-of
:type (real 0)
:documentation "Health of the character.")
(energy
:initarg :energy
:reader energy-of
:type (real 0)
:documentation "Energy of the character.")
(default-attack-power
:initarg :default-attack-power
:initform 40
:type real
:accessor default-attack-power-of
:documentation "The default attack base stat when no attack is selected and no weapon is equipped")
(level
:initarg :level
:initform 2
:accessor level-of
:type unsigned-byte
:documentation "character's current level")
(male
:initarg :male
:initform t
:accessor malep
:type boolean
:documentation "True if the character is male, false if female")
(wear
:initarg :wear
:initform ()
:accessor wear-of
:type list
:documentation "List of clothes the character is wearing, outer clothes listed first")
(species
:initarg :species
:initform :missingno.
:accessor species-of
:type (or keyword string)
:documentation "Character's species.")
(last-process-potty-time
:initarg :last-process-potty-time
:initform (if *game* (time-of *game*) 0)
:accessor last-process-potty-time-of
:type real
:documentation "Last time process-potty was processed")
(moves
:initarg :moves
:initform ()
:type list
:accessor moves-of
:documentation "list of moves the character knows")
(exp
:initarg :exp
:accessor exp-of
:initform 0
:type (real 0)
:documentation "How many experience points the character has")
(base-stats
:initarg :base-stats
:initform (list :health 45 :attack 80 :defense 50 :energy 45 :speed 120)
:accessor base-stats-of
:type list
:documentation "the base stats of the character")
(iv-stats
:initarg :iv-stats
:initform (list :health (random 16) :attack (random 16) :defense (random 16) :energy (random 16) :speed (random 16))
:accessor iv-stats-of
:type list
:documentation "iv stats of the character")
(bitcoins
:initarg :bitcoins
:initform 0
:type (real 0)
:accessor bitcoins-of
:documentation "Amount of Bitcoins the character has. Not limited to a single country.")
(inventory
:initarg :inventory
:initform ()
:type list
:accessor inventory-of
:documentation "List of items the character has.")
(wield
:initarg :wield
:initform nil
:accessor wield-of
:type (or null item)
:documentation "Item the character is wielding as a weapon")
(status-conditions
:initarg :status-conditions
:initform ()
:accessor %status-conditions-of
:type list
:documentation "Status conditions of the character"))
(:documentation "Base class for the characters in the game"))
(defclass item (yadfa-class)
((description
:initarg :description
:initform :?
:accessor description-of
:type (or keyword string)
:documentation "item description")
(name
:initarg :name
:initform :teru-sama
:accessor name-of
:type (or keyword string)
:documentation "item description")
(plural-name
:initarg :plural-name
:initform nil
:accessor plural-name-of
:type (or null string)
:documentation "The plural name of item")
(consumable
:initarg :consumable
:initform nil
:accessor consumablep
:type boolean
:documentation "Whether this item goes away when you use it")
(tossable
:initarg :tossable
:initform t
:accessor tossablep
:type boolean
:documentation "Whether you can throw this item away or not")
(sellable
:initarg :sellable
:initform t
:accessor sellablep
:type boolean
:documentation "Whether you can sell this item or not")
(value
:initarg :value
:initform 0
:accessor value-of
:type (real 0)
:documentation "Value of item in bitcoins")
(wear-stats
:initarg :wear-stats
:initform ()
:accessor wear-stats-of
:type list
:documentation "stat boost when wearing this item. Is a plist in the form of @code{(list :attack attack :defense defense :health health :energy energy :speed speed)}")
(wield-stats
:initarg :wield-stats
:initform ()
:accessor wield-stats-of
:type list
:documentation "stat boost when wielding this item. Is a plist in the form of @code{(list :attack attack :defense defense :health health :energy energy :speed speed)}")
(special-actions
:initarg :special-actions
:initform ()
:accessor special-actions-of
:type list
:documentation "Plist of actions that the player sees as actions with a lambda with the lambda-list @code{(item user &key &allow-other-keys)} they can perform with the item, @var{ITEM} is the instance that this slot belongs to, @var{USER} is the user using the item"))
(:documentation "Something you can store in your inventory and use"))
(defclass damage-item (item)
((use-power
:initarg :use-power
:initform 40
:type real
:accessor use-power-of
:documentation "attack power of item when used instead of wielded"))
(:documentation "Item that deal damage when used"))
(defclass status-condition (yadfa-class)
((name
:initarg :name
:initform nil
:type (or string null)
:accessor name-of
:documentation "name of status condition")
(description
:initarg :description
:initform nil
:type (or string null)
:accessor description-of
:documentation "description of status conditions")
(target
:initarg :target
:initform nil
:accessor target-of
:documentation "Enemy target that the battle script affects")
(accumulative
:initarg :accumulative
:initform 1
:accessor accumulative-of
:type (or unsigned-byte (eql t))
:documentation "how many of these the user can have at a time, @code{T} if infinite")
(blocks-turn
:initarg :blocks-turn
:initform nil
:type boolean
:accessor blocks-turn-of
:documentation "If @code{T} this condition prevents the player from moving")
(duration
:initarg :duration
:initform t
:accessor duration-of
:type (or unsigned-byte (eql t))
:documentation "How many turns this condition lasts. @code{T} means it lasts indefinitely.")
(stat-delta
:initarg :stat-delta
:initform '()
:accessor stat-delta-of
:type list
:documentation "Plist containing the status modifiers in the form of deltas")
(stat-multiplier
:initarg :stat-multiplier
:initform '()
:type list
:accessor stat-multiplier-of
:documentation "Plist containing the status modifiers in the form of multipliers")
(priority
:initarg :priority
:initform 0
:type unsigned-byte
:accessor priority-of
:documentation "Unsigned integer that specifies How important this condition is to cure. Used for the AI. Lower value means more important")
(curable
:initarg :curable
:initform nil
:type boolean
:accessor curablep
:documentation "Whether items or moves that cure statuses cure this"))
(:documentation "Base class for all the status conditions"))
(defclass persistent-status-condition (status-condition)
()
(:documentation "Status condition that lasts outside of battle"))
(defclass move (yadfa-class element-type-mixin)
((name
:initarg :name
:initform :-
:accessor name-of
:type (or keyword string)
:documentation "name of move")
(description
:initarg :description
:initform :-
:type (or keyword string)
:accessor description-of
:documentation "Description of move")
(energy-cost
:initarg :energy-cost
:initform 0
:type real
:accessor energy-cost-of
:documentation "How much energy this move costs"))
(:documentation "base class of moves used in battle"))
(defclass health-inc-move (move)
((health
:accessor health-of
:initform 0
:type real
:initarg :health)))
(defclass energy-inc-move (move)
((energy
:accessor energy-of
:initform 0
:type real
:initarg :energy)))
(defclass damage-move (move)
((power
:initarg :power
:initform 40
:type real
:accessor power-of
:documentation "Number used to determine the damage of this attack"))
(:documentation "Move that causes damage when used"))
(defclass mess-move-mixin (move) ()
(:documentation "Basically any move that involves messing"))
(defclass wet-move-mixin (move) ()
(:documentation "Basically any move that involves wetting"))
(defclass bladder-character (base-character)
((bladder/contents
:initarg :bladder/contents
:initform 0
:type (real 0)
:accessor bladder/contents-of
:documentation "Amount in ml that the character is holding in in ml.")
(bladder/fill-rate
:initarg :bladder/fill-rate
:initform (* (/ 2000 24 60) 0)
:type real
:accessor bladder/fill-rate-of
:documentation "Amount in ml that the character's bladder fills each turn.")
(bladder/fill-rate/multiplier
:initarg :bladder/fill-rate/multiplier
:initform 1
:type real
:accessor bladder/fill-rate/multiplier-of
:documentation "Multiplier for @var{BLADDER/FILL-RATE}. Decreases by @var{BLADDER/FILL-RATE/COOLDOWN} every turn")
(bladder/fill-rate/cooldown
:initarg :bladder/fill-rate/cooldown
:initform 1/20
:type real
:accessor bladder/fill-rate/cooldown-of
:documentation "How much @var{BLADDER/FILL-RATE/MULTIPLIER} decreases every turn")
(bladder/need-to-potty-limit
:initarg :bladder/need-to-potty-limit
:initform 300
:type (real 0)
:accessor bladder/need-to-potty-limit-of
:documentation "How full the bladder needs to be before the character needs to go")
(bladder/potty-dance-limit
:initarg :bladder/potty-dance-limit
:initform 450
:type (real 0)
:accessor bladder/potty-dance-limit-of
:documentation "How full the character's bladder needs to be before the character starts doing a potty dance")
(bladder/potty-desperate-limit
:initarg :bladder/potty-desperate-limit
:initform 525
:type (real 0)
:accessor bladder/potty-desperate-limit-of
:documentation "How full the character's bladder needs to be before the character starts begging to be taken to the bathroom")
(bladder/maximum-limit
:initarg :bladder/maximum-limit
:initform 600
:type (real 0)
:accessor bladder/maximum-limit-of
:documentation "When the character's bladder gets this full, @{s,he@} wets @{him,her@}self")))
(defclass bowels-character (base-character)
((bowels/contents
:initarg :bowels/contents
:initform 0
:type (real 0)
:accessor bowels/contents-of
:documentation "Amount in grams that the character is holding in")
(bowels/fill-rate
:initarg :bowels/fill-rate
:initform (* (/ 400 24 60) 0)
:type (real 0)
:accessor bowels/fill-rate-of
:documentation "Amount in grams that the character's bowels fills each turn")
(bowels/fill-rate/multiplier
:initarg :bowels/fill-rate/multiplier
:initform 1
:type real
:accessor bowels/fill-rate/multiplier-of
:documentation "Multiplier for @var{BOWELS/FILL-RATE}. Decreases by @var{BOWELS/FILL-RATE/COOLDOWN} every turn")
(bowels/fill-rate/cooldown
:initarg :bowels/fill-rate/cooldown
:initform 1/20
:type real
:accessor bowels/fill-rate/cooldown-of
:documentation "How much @var{BOWELS/FILL-RATE/MULTIPLIER} decreases every turn")
(bowels/need-to-potty-limit
:initarg :bowels/need-to-potty-limit
:initform 400
:type (real 0)
:accessor bowels/need-to-potty-limit-of
:documentation "How full the bowels need to be before the character needs to go")
(bowels/potty-dance-limit
:initarg :bowels/potty-dance-limit
:initform 600
:type (real 0)
:accessor bowels/potty-dance-limit-of
:documentation "How full the character's bowels need to be before the character starts doing a potty dance")
(bowels/potty-desperate-limit
:initarg :bowels/potty-desperate-limit
:initform 700
:type (real 0)
:accessor bowels/potty-desperate-limit-of
:documentation "How full the character's bowels needs to be before the character starts begging to be taken to the bathroom")
(bowels/maximum-limit
:initarg :bowels/maximum-limit
:initform 800
:type (real 0)
:accessor bowels/maximum-limit-of
:documentation "When the character's bowels gets this full, @{he,she@} messes @{him,her@}self")
(fart-count
:initarg :fart-count
:initform 0
:type unsigned-byte
:accessor fart-count-of
:documentation "How many times the character has farted to reduce the pressure since the last mess. Used to calculate how much pressure this relieves and the chance the character might end up messing himself/herself instead.")))
(defclass potty-character (bladder-character bowels-character)
())
(defclass team-member (base-character)
((skin
:initarg :skin
:initform '()
:type list
:accessor skin-of
:documentation "attributes for the character's skin, such as whether he/she has fur or not. current supported elements are @code{:SCALES}, @code{:FUR}, and @code{:FEATHERS}")
(tail
:initarg :tail
:initform nil
:accessor tail-of
:type list
:documentation "attributes for the character's tail. Is @code{NIL} if the character doesn't have a tail. Takes the same syntax as the cdr of a function form with the lambda list @code{(tail-type &optional tail)} current supported values for @var{TAIL-TYPE} are @code{:SMALL}, @code{:MEDIUM}, @code{:LARGE}, @code{:LIZARD}, @code{:BIRD-SMALL}, @code{:BIRD-LARGE}, and @code{NIL}. current supported elements for @var{TAIL} are @code{:MULTI}, @code{:SCALES}, @code{:FUR}, and @code{:FEATHERS}")
(wings
:initarg :wings
:initform '()
:type list
:accessor wings-of
:documentation "list of attributes for the character's wings. current supported elements are @code{:SCALES}, @code{:FUR}, and @code{:FEATHERS}"))
(:documentation "Either the player or an ally inherits this class"))
(defclass potty-trained-team-member (team-member potty-character) ())
(defclass ally (team-member)
((learned-moves
:initarg :learned-moves
:accessor learned-moves-of
:type list
:initform (list (cons 100 'yadfa-moves:superglitch) (cons 11 'yadfa-moves:kamehameha) (cons 7 'yadfa-moves:tickle) (cons 8 'yadfa-moves:mush))
:documentation "Alist of moves the player learns by leveling up, first element is the level when you learn them ove, second is a symbol from the `yadfa-moves' package"))
(:documentation "Team member that is not the player")
(:default-initargs
:base-stats (list :health 35 :attack 55 :defense 40 :energy 35 :speed 90)
:name "Anon"
:level 5
:species "fox"
:bladder/fill-rate (* (/ 2000 24 60) 2)
:bowels/fill-rate (* (/ 400 24 60) 2)
:wear (list (make-instance 'yadfa-items:diaper))
:moves (list (make-instance 'yadfa-moves:watersport) (make-instance 'yadfa-moves:mudsport))))
(defclass ally-no-potty-training (ally potty-character) ())
(defclass ally-rebel-potty-training (ally potty-character) ())
(defclass ally-silent-potty-training (ally potty-trained-team-member) ())
(defclass ally-last-minute-potty-training (ally potty-trained-team-member) ())
(defclass ally-feral (ally potty-trained-team-member) ())
(defclass playable-ally (ally) ())
(defmethod initialize-instance :after
((c base-character) &key (health nil healthp) (energy nil energyp)
(base-health nil base-health-p) (base-attack nil base-attack-p)
(base-defense nil base-defense-p) (base-speed nil base-speed-p) (base-energy nil base-energy-p) &allow-other-keys)
(declare (ignore health energy))
(when base-health-p
(setf (getf (base-stats-of c) :health) base-health))
(when base-attack-p
(setf (getf (base-stats-of c) :attack) base-attack))
(when base-defense-p
(setf (getf (base-stats-of c) :defence) base-defense))
(when base-speed-p
(setf (getf (base-stats-of c) :speed) base-speed))
(when base-energy-p
(setf (getf (base-stats-of c) :energy) base-energy))
(unless healthp
(setf (health-of c) (calculate-stat c :health)))
(unless energyp
(setf (energy-of c) (calculate-stat c :energy)))
(setf (exp-of c) (calculate-level-to-exp (level-of c))))
(defclass player (potty-trained-team-member pantsable-character)
((position
:initarg :position
:initform '(0 0 0 yadfa-zones:debug-map)
:accessor position-of
:type list
:documentation "Current position in the form of `(list x y z map)'.")
(warp-on-death-point
:initarg :warp-on-death-point
:accessor warp-on-death-point-of
:type list
:initform nil
:documentation "Where the player warps to when @{s,@}he dies, same format as POSITION")
(learned-moves
:initarg :learned-moves
:accessor learned-moves-of
:type list
:initform (list (cons 100 'yadfa-moves:superglitch) (cons 11 'yadfa-moves:kamehameha) (cons 7 'yadfa-moves:tickle) (cons 8 'yadfa-moves:mush))
:documentation "Alist of moves the player learns by leveling up, first element is the level when you learn them ove, second is a symbol from the `yadfa-moves'"))
(:documentation "The player")
(:default-initargs
:base-stats (list :health 45 :attack 80 :defense 50 :energy 45 :speed 120)
:name "Anon"
:description "This is you stupid"
:level 5
:species "Fox"
:bladder/fill-rate (* (/ 2000 24 60) 2)
:bowels/fill-rate (* (/ 400 24 60) 2)
:wear (list (make-instance 'yadfa-items:diaper))
:moves (list (make-instance 'yadfa-moves:watersport)
(make-instance 'yadfa-moves:mudsport))
:tail '(:medium :fur)
:skin '(:fur)))
(defmethod initialize-instance :after
((c player) &key (warp-on-death-point nil warp) &allow-other-keys)
(declare (ignore warp-on-death-point))
(unless warp
(setf (warp-on-death-point-of c) (position-of c))))
(defclass zone (yadfa-class)
((description
:initarg :description
:initform "Seems Pouar didn't make the text for this room yet, get to it you lazy fuck"
:accessor description-of
:type string
:documentation "room description")
(enter-text
:initarg :enter-text
:type (or string coerced-function)
:initform "Seems Pouar didn't make the text for this room yet, get to it you lazy fuck"
:accessor enter-text-of
:documentation "Text that pops up when you enter the room. either a string or a function designator or lambda expression with @code{NIL} as the lambda list that returns a string.")
(position
:initarg :position
:initform '()
:type list
:accessor position-of
:documentation "Position of the zone. Used when we can't figure out the position of the zone ahead of time and to avoid iterating through the hash table.")
(name
:initarg :name
:initform "Mystery Zone"
:accessor name-of
:type string
:documentation "Name of the room")
(props
:initarg :props
:initform ()
:accessor props-of
:type list
:documentation #.(format nil "Plist of props in the room, and by `props' I mean instances of the @code{PROP} class
~a."
(xref yadfa:prop :class)))
(events
:initarg :events
:initform ()
:accessor events-of
:type list
:documentation "list of events that run when you enter a room")
(continue-battle
:initarg :continue-battle
:initform nil
:type list
:accessor continue-battle-of
:documentation "A previous battle (which is an instance of the battle class) triggered by an event that you lost. Used to keep the game in a consistent state after losing.")
(underwater
:initarg :underwater
:initform nil
:accessor underwaterp
:type boolean
:documentation "Whether this zone is underwater or not, better get some waterproof clothing if you don't want your diaper to swell up")
(warp-points
:initarg :warp-points
:initform ()
:accessor warp-points-of
:type list
:documentation #.(format nil "Plist of warp points to different maps, values are lists in the same form as the position of the player, keys are passed to the @code{MOVE} function
~a."
(xref yadfa-world:move :function)))
(locked
:initarg :locked
:initform nil
:accessor lockedp
:type boolean
:documentation "Whether this area is locked")
(key
:initarg :key
:initform nil
:accessor key-of
:type type-specifier
:documentation "Whether this area can be unlocked. if non-nil, contains the type specifier of the key needed to unlock it if locked.")
(hidden
:initarg :hidden
:initform nil
:accessor hiddenp
:type boolean
:documentation "When true, the game pretends this room doesn't exist. This is for when certain events in the game makes certain zones disappear from the map and to avoid making them be in the exact same state as in the beginning of the game when they reappear")
(stairs
:initarg :stairs
:initform '()
:accessor stairs-of
:type list
:documentation "list containing the directions of stairs. Contains @code{:UP} if there are stairs going up and @code{:DOWN} if there are stairs going down.")
(direction-attributes
:initarg :direction-attributes
:initform ()
:type list
:accessor direction-attributes-of
:documentation "List of attributes based on the direction rather than the zone itself")
(can-potty
:initarg :can-potty
:initform '(lambda (prop &key wet mess pants-down user)
(declare (ignore prop wet mess pants-down user))
t)
:type coerced-function
:accessor can-potty-p
:documentation "Whether you're allowed to go potty in this zone. @var{PROP} is the prop you're going potty on if any while @var{USER} is the one going potty. @var{PANTS-DOWN} is @code{T} when @var{USER} pulls his/her pants down and @var{WET} and @var{MESS} are the arguments")
(potty-trigger
:initarg :potty-trigger
:initform '(lambda (had-accident user)
(declare (ignore had-accident user))
nil)
:accessor potty-trigger-of
:type coerced-function
:documentation "Runs whenever the user goes potty, whether on purpose or by accident, arguments are the cons called @var{HAD-ACCIDENT} that gets passed from the process-potty function, and @var{USER} which is the user who did it")
(must-wear
:initarg :must-wear
:initform '(t . (lambda (user)
(declare (ignore user))
t))
:type (or cons symbol)
:accessor must-wear-of
:documentation #.(format nil "Used to determine whether you can enter the zone based on what you're wearing. Is either a cons cell or a symbol. When a symbol it is used as key for one of the values in the hash table in the @code{MUST-WEAR} slot in ~a. When a cons cell, the car is a type specifier of what @var{USER} must wear and the cdr is a lambda expression or a function designator with a single @var{USER} argument which is the character that must be wearing the item. It returns a generalized boolean that returns true when you can enter the zone."
(ref game :class)))
(must-wear*
:initarg :must-wear*
:initform '(t . (lambda (user)
(declare (ignore user))
t))
:accessor must-wear*-of
:type (or cons symbol)
:documentation #.(format nil "Similar to the @code{MUST-WEAR} slot but is done when you try to wear or change while still inside the zone. You can also use a symbol as key for one of the values in the hash table in the @code{MUST-WEAR*} slot in ~a."
(ref game :class)))
(must-not-wear
:initarg :must-not-wear
:initform '(nil . (lambda (user)
(declare (ignore user))
t))
:type (or cons symbol)
:accessor must-not-wear-of
:documentation #.(format nil "Used to determine whether you can enter the zone based on what you're wearing. Is either a cons cell or a symbol. When a symbol it is used as key for one of the values in the hash table in the @code{MUST-NOT-WEAR} slot in ~a. When a cons cell, the car is a type specifier of what @var{USER} must not be wearing wear and the cdr is a lambda expression or a function designator with a single @var{USER} argument which is the character that must be wearing the item. It returns a generalized boolean that returns true when you can enter the zone."
(ref game :class)))
(must-not-wear*
:initarg :must-not-wear*
:initform '(nil . (lambda (user)
(declare (ignore user))
t))
:type (or cons symbol)
:accessor must-not-wear*-of
:documentation #.(format nil "Similar to the @code{MUST-NOT-WEAR} slot but is done when you try to wear or change while still inside the zone. You can also use a symbol as key for one of the values in the hash table in the @code{MUST-NOT-WEAR*} slot in ~a."
(ref game :class)))
(no-wetting/messing
:initarg no-wetting/messing
:initform '(lambda (user)
(declare (ignore user))
nil)
:type coerced-function
:accessor no-wetting/messing-of
:documentation "lambda expression or function that tells you if you're allowed to wet or mess voluntarily")
(enemy-spawn-list
:initarg :enemy-spawn-list
:initform ()
:type (or symbol list)
:accessor enemy-spawn-list-of
:documentation "list containing what enemies might show up when you enter an area. Each entry looks like this @code{(:chance chance :enemies enemies)} If @var{RANDOM} is specified, then the probability of the enemy being spawn is @var{CHANCE} out of 1 where @var{CHANCE} is a number between 0 and 1")
(team-npc-spawn-list
:initarg :team-npc-spawn-list
:initform ()
:type (or symbol list)
:accessor team-npc-spawn-list-of
:documentation "list containing what npcs team member might show up when you enter an area. Each entry looks like this @code{(:chance chance :npc npc)} If @var{RANDOM} is specified, then the probability of the enemy being spawn is @var{CHANCE} out of 1 where @var{CHANCE} is a number between 0 and 1")
(placable
:initarg :placable
:initform nil
:accessor placeablep
:documentation "Whether you can place items here or not"))
(:documentation "A zone on the map"))
(defclass prop (yadfa-class)
((description
:initarg :description
:initform ""
:accessor description-of
:type string
:documentation "Description of a prop")
(name
:initarg :name
:initform ""
:accessor name-of
:type string
:documentation "Name of prop")
(placeable
:initarg :placeable
:initform nil
:accessor placeablep
:type boolean
:documentation "Whether you can place items here")
(items
:initarg :items
:initform ()
:type list
:accessor items-of
:documentation "List of items this prop has")
(bitcoins
:initarg :bitcoins
:initform 0
:accessor bitcoins-of
:type real
:documentation "Number of bitcoins this prop has")
(actions
:initarg :actions
:initform ()
:accessor actions-of
:type list
:documentation "Plist of actions who's lambda-list is @code{(prop &key &allow-other-keys)} that the player sees as actions they can perform with the prop, @var{PROP} is the instance that this slot belongs to"))
(:documentation "Tangible objects in the AREA that the player can interact with"))
(defclass placable-prop (prop item)
()
(:documentation "Prop that you can place"))
(defclass consumable (item)
()
(:documentation "Doesn't actually cause items to be consumable, but is there to make filtering easier"))
(defclass ammo (item)
((ammo-power
:initarg :ammo-power
:initform 0
:accessor ammo-power-of
:type real
:documentation "Attack base when using this as ammo."))
(:documentation "Ammo is typically inherited by this class, but nothing in the code actually enforces this and is meant to make filtering easier"))
(defclass damage-wield (item)
((power
:initarg :power
:initform 40
:accessor power-of
:type real
:documentation "Attack base when used as a melee weapon"))
(:documentation "Items that cause damage when wielded"))
(defclass weapon (damage-wield)
((ammo-type
:initarg :ammo-type
:initform nil
:accessor ammo-type-of
:type type-specifier
:documentation "A type specifier specifying the type of ammo this will hold")
(ammo
:initarg :ammo
:initform ()
:accessor ammo-of
:type list
:documentation "List of ammo this item has")
(reload-count
:initarg :reload-count
:initform nil
:accessor reload-count-of
:type (or unsigned-byte null)
:documentation "When in battle, the maximum amount of ammo the user can reload into this item per turn, if nil, then there is no limit")
(ammo-capacity
:initarg :ammo-capacity
:initform 0
:type unsigned-byte
:accessor ammo-capacity-of
:documentation "How much ammo this thing can hold"))
(:documentation "Items intended to be wielded as a weapon"))
(defclass clothing (item)
())
(defclass top (clothing)
())
(defclass headpiece (clothing)
())
(defclass bottoms (clothing)
((bulge-text
:initarg :bulge-text
:initform ()
:type list
:accessor bulge-text-of
:documentation "A list of pairs containing the different text that describes the appearance that your diapers have on your pants based on the thickness, first one is the minimum thickness needed for the second text. the text for thicker padding must be listed first")
(thickness-capacity
:initarg :thickness-capacity
:initform (* (expt 6.0l0 1/3) (+ 25 2/5))
:accessor thickness-capacity-of
:type (or (real 0) null)
:documentation "The maximum thickness of your diaper that this can fit over. @code{NIL} means infinite")
(thickness-capacity-threshold
:initarg :thickness-capacity-threshold
:initform 50
:type (or (real 0) null)
:accessor thickness-capacity-threshold-of
:documentation "How much higher than the thickness capacity the clothing can handle diaper expansion in mm before popping/tearing, @code{NIL} means it won't pop/tear")
(key
:initarg :key
:initform nil
:accessor key-of
:type type-specifier
:documentation "Whether this piece of clothing can be locked to prevent removal. Set this to the quoted type specifier that is needed to unlock it")
(locked
:initarg :locked
:initform nil
:accessor lockedp
:type boolean
:documentation "Whether this clothing is locked to prevent removal"))
(:documentation "Clothing you wear below the waist"))
(defclass closed-bottoms (bottoms)
((thickness
:initarg :thickness
:initform 1
:accessor thickness-of
:type (real 0)
:documentation "the thickness of the undies in mm")
(waterproof
:initarg :waterproof
:initform nil
:accessor waterproofp
:type boolean
:documentation "Whether this prevents your diapers from swelling up in water")
(leakproof
:initarg :leakproof
:initform nil
:accessor leakproofp
:type boolean
:documentation "Whether this diaper leaks")
(disposable
:initarg :disposable
:initform nil
:accessor disposablep
:type boolean
:documentation "Whether you clean this or throw it away")
(sogginess
:initarg :sogginess
:initform 0
:accessor sogginess-of
:type (real 0)
:documentation "sogginess in ml")
(sogginess-capacity
:initarg :sogginess-capacity
:initform 10
:accessor sogginess-capacity-of
:type (real 0)
:documentation "sogginess capacity in ml")
(messiness
:initarg :messiness
:initform 0
:accessor messiness-of
:type (real 0)
:documentation "messiness in grams")
(messiness-capacity
:initarg :messiness-capacity
:initform 10
:accessor messiness-capacity-of
:type (real 0)
:documentation "messiness capacity in grams")
(mess-text
:initarg :mess-text
:initform '()
:accessor mess-text-of
:documentation "Plist that contain the text that comes up in the description when in the inventory with the minimal messiness as the key")
(wet-text
:initarg :wet-text
:initform '()
:accessor wet-text-of
:type list
:documentation "Plist that contains that contain the text that comes up in the description when in the inventory with the minimal sogginess as the key")
(wear-mess-text
:initarg :wear-mess-text
:initform ()
:type list
:accessor wear-mess-text-of
:documentation "Plist that contains the text that comes up in the description when wearing it with the minimal messiness as the key")
(wear-wet-text
:initarg :wear-wet-text
:initform ()
:type list
:accessor wear-wet-text-of
:documentation "Plist that contain the text that comes up in the description when wearing it with the minimal sogginess as the key"))
(:documentation "these are stuff like pants and underwear and not skirts"))
(defclass full-outfit (top bottoms)
())
(defclass closed-full-outfit (full-outfit closed-bottoms)
())
(defclass onesie (full-outfit)
((onesie-thickness-capacity
:initarg :onesie-thickness-capacity
:initform (cons 100 nil)
:accessor onesie-thickness-capacity-of
:type cons
:documentation "cons of values for the thickness capacity of the onesie, first value is for when it's closed, second for when it's opened")
(onesie-thickness-capacity-threshold
:initarg :onesie-thickness-capacity-threshold
:initform (cons 5 nil)
:type cons
:accessor onesie-thickness-capacity-threshold-of
:documentation "cons of values for the thickness capacity threshold of the onesie, first value is for when it's closed, second for when it's opened")
(onesie-waterproof
:initarg :onesie-waterproof
:initform nil
:type boolean
:accessor onesie-waterproof-p
:documentation "Boolean that determines whether the onesie prevents your diaper from swelling up when closed.")
(onesie-bulge-text
:initarg :onesie-bulge-text
:initform (cons () ())
:type cons
:accessor onesie-bulge-text-of
:documentation "A cons containing 2 lists of pairs containing the different text that describes the appearance that your diapers have on your pants based on the thickness, first one is the minimum thickness needed for the second text. the text for thicker padding must be listed first. car is the value for when it's closed, cdr is the value when it's open")))
(defclass onesie/opened (onesie)
())
(defclass onesie/closed (onesie closed-full-outfit)
())
(defmethod update-instance-for-different-class :after ((old onesie/opened) (new onesie/closed) &key)
(setf (thickness-capacity-of new) (car (slot-value old 'onesie-thickness-capacity)))
(setf (thickness-capacity-threshold-of new) (car (slot-value old 'onesie-thickness-capacity-threshold)))
(setf (waterproofp new) (onesie-waterproof-p old))
(setf (bulge-text-of new) (car (slot-value old 'onesie-bulge-text))))
(defmethod update-instance-for-different-class :after ((old onesie/closed) (new onesie/opened) &key)
(setf (thickness-capacity-of new) (cdr (slot-value old 'onesie-thickness-capacity)))
(setf (thickness-capacity-threshold-of new) (cdr (slot-value old 'onesie-thickness-capacity-threshold)))
(setf (bulge-text-of new) (cdr (slot-value old 'onesie-bulge-text))))
(defmethod initialize-instance :after
((c onesie/opened) &key &allow-other-keys)
(setf (thickness-capacity-of c) (cdr (onesie-thickness-capacity-of c)))
(setf (thickness-capacity-threshold-of c) (cdr (onesie-thickness-capacity-threshold-of c)))
(setf (bulge-text-of c) (cdr (onesie-bulge-text-of c))))
(defmethod initialize-instance :after
((c onesie/closed) &key &allow-other-keys)
(setf (thickness-capacity-of c) (car (onesie-thickness-capacity-of c)))
(setf (thickness-capacity-threshold-of c) (car (onesie-thickness-capacity-threshold-of c)))
(setf (waterproofp c) (onesie-waterproof-p c))
(setf (bulge-text-of c) (car (onesie-bulge-text-of c))))
(defclass incontinence-product (closed-bottoms) ()
(:default-initargs
:thickness-capacity-threshold nil
:disposable t
:sellable nil)
(:documentation "these include diapers, pullups, and stuffers"))
(defclass snap-bottoms (bottoms) ()
(:documentation "These have snaps on them so don't tear when the diaper expands but instead come apart"))
(defclass undies (clothing)
())
(defclass padding (incontinence-product) ()
(:documentation "everything but stuffers"))
(defclass ab-clothing (clothing) ()
(:documentation "clothing that is more AB than DL"))
(defclass pullup (padding) ()
(:default-initargs
:thickness (* 1/2 (+ 25 2/5))
:thickness-capacity 40))
(defclass diaper (padding) ()
(:default-initargs
:thickness (+ 25 2/5)
:thickness-capacity 80
:key 'yadfa-items:magic-diaper-key))
(defclass stuffer (incontinence-product) ()
(:default-initargs
:thickness (* 1/4 (+ 25 2/5))
:thickness-capacity 20))
(defclass skirt (bottoms)
()
(:default-initargs
:thickness-capacity 100
:thickness-capacity-threshold nil))
(defclass dress (full-outfit)
()
(:default-initargs
:thickness-capacity 100
:thickness-capacity-threshold nil))
(defclass shirt (top)
())
(defclass pants (closed-bottoms)
())
(defclass npc (base-character)
((watersport-limit
:initarg :watersport-limit
:initform nil
:accessor watersport-limit-of
:type (or null (real 0))
:documentation "How close to @var{BLADDER/MAXIMUM-LIMIT} in ml the enemy is before voluntarily wetting his/her diapers. A value of @code{NIL} means he'll/she'll never wet voluntarily")
(mudsport-limit
:initarg :mudsport-limit
:initform nil
:accessor mudsport-limit-of
:type (or null (real 0))
:documentation "How close to @var{BOWELS/MAXIMUM-LIMIT} in cg the enemy is before voluntarily wetting his/her diapers. A value of @code{NIL} means he'll/she'll never mess voluntarily")
(watersport-chance
:initarg :watersport-chance
:initform 1
:accessor watersport-chance-of
:type (real 0)
:documentation "when @var{WATERSPORT-LIMIT} is reached, there is a 1 in @var{WATERSPORT-CHANCE} he'll voluntarily wet himself")
(mudsport-chance
:initarg :mudsport-chance
:initform 1
:type (real 0)
:accessor mudsport-chance-of
:documentation "when @var{MUDSPORT-LIMIT} is reached, there is a 1 in @var{MUDSPORT-CHANCE} he'll voluntarily mess himself")))
(defclass enemy (npc)
((exp-yield
:initarg :exp-yield
:initform 50
:accessor exp-yield-of
:type (real 0)
:documentation "Integer that is the base exp points that player receives when this guy is defeated")
(bitcoins-per-level
:initarg :bitcoins-per-level
:initform nil
:accessor bitcoins-per-level-of
:type (or (real 0) null)
:documentation "Bitcoins per level that you get from this enemy per battle. Only used not @code{NIL}."))
(:default-initargs
:base-stats (list :health 40
:attack 45
:defense 40
:energy 40
:speed 56)
:bitcoins 0
:level (random-from-range 2 5))
(:documentation "Class for enemies"))
(defclass bladder-enemy (enemy bladder-character) ()
(:documentation "Class for an enemy with a bladder fill rate. This enemy may @{wet,mess@} @{him,her@}self in battle."))
(defclass bowels-enemy (enemy bowels-character) ()
(:documentation "Class for an enemy with a bowels fill rate. This enemy may @{wet,mess@} @{him,her@}self in battle."))
(defclass potty-enemy (bladder-enemy bowels-enemy) ()
(:documentation "Class for an enemy with a bladder and bowels fill rate. This enemy may @{wet,mess@} @{him,her@}self in battle."))
(defclass pantsable-character (base-character) ())
(defclass battle (yadfa-class)
((turn-queue
:initarg :turn-queue
:initform ()
:accessor turn-queue-of
:type list
:documentation "The queue of characters specifying the order of who attacks when in battle")
(enter-battle-text
:initarg :enter-battle-text
:initform nil
:accessor enter-battle-text-of
:type (or string null)
:documentation "The text that comes up when you enter a battle")
(enemies
:initarg :enemies
:initform ()
:accessor enemies-of
:type list
:documentation "List of enemies in battle")
(team-npcs
:initarg :team-npcs
:initform ()
:accessor team-npcs-of
:type list
:documentation "List of team members that the player doesn't actually control but are controlled by the game")
(win-events
:initarg :win-events
:initform ()
:accessor win-events-of
:type list
:documentation "List of events that trigger when you've won the battle")
(fainted
:initarg :fainted
:initform ()
:type list
:accessor fainted-of
:documentation "Characters that have fainted in battle, used so the \"X has fainted\" messages don't appear repeatedly")
(status-conditions
:initarg :status-conditions
:initform (make-hash-table :test 'eq)
:type hash-table
:accessor %status-conditions-of
:documentation #.(f:fmt nil "Hash table of " (ref status-condition :class) " indexed by " (ref base-character :class) ". These only last until the battle ends")))
(:documentation "Class that contains the information about the battle"))
(defmethod initialize-instance :after
((c battle) &key &allow-other-keys)
(unless (enter-battle-text-of c)
(setf
(enter-battle-text-of c)
(with-output-to-string (s)
(iter (for i in (enemies-of c))
(format s "A Wild ~a Appeared!!!~%" (name-of i))))))
(setf (turn-queue-of c) (sort (append* (enemies-of c) (team-npcs-of c) (team-of *game*)) '>
:key (lambda (a)
(calculate-stat a :speed))))
(incf (time-of *game*)))
(defclass game (yadfa-class)
((zones
:initform (make-hash-table :test #'equal :size 500)
:type hash-table
:documentation "Hash table of zones in the game")
(enemy-spawn-list
:initarg :enemy-spawn-list
:initform (make-hash-table :test #'eq)
:type hash-table
:accessor enemy-spawn-list-of
:documentation "contains enemy spawn lists that can be reused. Use a symbol instead of a list in the enemy spawn list to use a key")
(must-wear
:initarg :must-wear
:initform (make-hash-table :test #'eq)
:accessor must-wear-of
:type hash-table
:documentation #.(format nil "hash table of conses that can be used with @code{MUST-WEAR} in ~a.
See @code{MUST-WEAR} in ~a."
(ref zone :class) (ref zone :class)))
(must-not-wear
:initarg :must-not-wear
:initform (make-hash-table :test #'eq)
:type hash-table
:accessor must-not-wear-of
:documentation #.(format nil "hash table of conses that can be used with @code{MUST-NOT-WEAR} in ~a.
See @code{MUST-NOT-WEAR} in ~a."
(ref zone :class) (ref zone :class)))
(must-wear*
:initarg :must-wear*
:initform (make-hash-table :test #'eq)
:type hash-table
:accessor must-wear*-of
:documentation #.(format nil "hash table of conses that can be used with @code{MUST-WEAR*} in ~a.
See @code{MUST-WEAR*} in ~a."
(ref zone :class) (ref zone :class)))
(must-not-wear*
:initarg :must-not-wear*
:initform (make-hash-table :test #'eq)
:type hash-table
:accessor must-not-wear*-of
:documentation #.(format nil "hash table of conses that can be used with @code{MUST-NOT-WEAR*} in ~a.
See @code{MUST-NOT-WEAR*} in ~a."
(ref zone :class) (ref zone :class)))
(player%
:initarg :player
:initform nil
:accessor player-of
:type (or null player)
:documentation "The Player, which is an instance of the player class")
(allies
:initarg :allies
:initform nil
:accessor allies-of
:type list
:documentation "List of characters that have joined you")
(team
:initarg :team
:initform nil
:accessor team-of
:type list
:documentation "List of characters sent out to battle")
(config
:initarg :config
:initform (make-hash-table :test 'equal)
:accessor config-of
:type hash-table
:documentation "Arbitrary Configuration")
(time
:initarg :time
:initform 0
:accessor time-of
:type unsigned-byte
:documentation "Turns since start of game")
(finished-events%
:initarg :finished-events
:initform (make-hash-table :test 'equal)
:type hash-table
:accessor finished-events-of
:documentation "A hash table containing whether past events are finished, accepted, and/or declined. Lambda list of the key is @code{(EVENT &OPTIONAL STATUS)} Where @var{EVENT} is the event symbol and @var{STATUS} is either @code{:ACCEPTED}, @code{:DECLINED}. @var{STATUS} isn't passed if it means it is finished")
(current-events%
:initarg :finished-events
:initform (make-hash-table :test 'eq)
:type hash-table
:accessor current-events-of
:documentation "A hash table containing the events currently in progress. Is @code{T} if it is currently in progress.")
(seen-enemies
:initarg :seen-enemies
:initform '()
:type list
:accessor seen-enemies-of)
(event-attributes%
:initform (make-hash-table :test 'eq)
:type hash-table
:documentation "Stores the event attributes of the game"))
(:documentation "List of all the information in the game"))
(defclass event (yadfa-class)
((id
:initarg :id
:initform nil
:type symbol
:documentation "Unique id identifying the event")
(lambda
:initarg :lambda
:initform (lambda (self &optional accept)
(declare (ignore self accept)) nil)
:type coerced-function
:documentation "Hook that runs when the event is triggered. @var{SELF} is the event id and @var{ACCEPT} is the result of the function in the @code{MISSION} slot")
(predicate
:initarg :predicate
:initform (lambda (self)
(declare (ignore self)) t)
:type coerced-function
:documentation "Returns true if the mission can be triggered and false if not")
(repeatable
:initarg :repeatable
:type boolean
:initform nil
:documentation "Is @code{T} if this event can be triggered more than once")
(mission
:initarg :mission
:initform nil
:type (or null coerced-function)
:documentation "If this event is a mission, this slot contains a function that runs the dialog and returns @code{:ACCEPTED} if the mission was accepted, @code{:DECLINED}, if it was declined, or @code{NIL} if it was deferred")
(finished-depends
:initarg :finished-depends
:initform nil
:type list
:documentation "List of event ids of events that needs to be finished before this event can be triggered")
(documentation
:initform nil
:initarg :documentation
:type (or null simple-string)
:documentation "Documentation explaining the event")))
| 50,384 | Common Lisp | .lisp | 1,240 | 35.674194 | 578 | 0.702485 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 3d120b5623dcea573d933926da27a5feb6081146599bc528bf27bdbb8341c307 | 15,661 | [
-1
] |
15,662 | structs.lisp | pouar_yadfa/core/libexec/structs.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(declaim (inline make-action action-documentation action-lambda action-p))
(defstruct action
"An action for a prop or item"
(documentation nil :type (or null simple-string))
(lambda '(lambda (prop))
:type coerced-function))
(defmethod documentation ((x action) (doc-type (eql t)))
(action-documentation x))
(defmethod describe-object ((object action) stream)
(call-next-method)
;;; copied from SBCL
(let ((doc (handler-bind ((warning #'muffle-warning))
(documentation object t))))
(when doc
(format stream "~%~@:_Documentation:~@:_")
(pprint-logical-block (stream nil :per-line-prefix " ")
(princ doc stream)))))
| 772 | Common Lisp | .lisp | 19 | 36.631579 | 80 | 0.671979 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | bf903a80563b85ef5f9f33ede3c3eab8599f321b41d6c2af1fa2b46f8ed9e82b | 15,662 | [
-1
] |
15,663 | methods.lisp | pouar_yadfa/core/libexec/methods.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defmethod documentation ((x symbol) (doc-type (eql 'event)))
(slot-value (get-event x) 'documentation))
(defmethod print-object ((o element-type) s)
(let ((class (slot-value (class-of o) 'name)))
(if class
(print-unreadable-object-with-prefix (o s :type t :identity t)
(write class :stream s))
(call-next-method))))
(defmethod print-object ((o element-type-class) s)
(let ((class (slot-value o 'name)))
(if class
(print-unreadable-object-with-prefix (o s :type t :identity nil)
(f:fmt s (:s class) " " (:s (class-name o))))
(call-next-method))))
(defmethod print-object ((obj ally) stream)
(print-unreadable-object-with-prefix (obj stream :type t :identity t)
(print-slot obj 'name stream)))
(defmethod print-object ((obj zone) stream)
(print-unreadable-object-with-prefix (obj stream :type t :identity t)
(print-slot obj 'position stream)
(write-string " " stream)
(print-slot obj 'name stream)))
(defmethod print-object ((obj prop) stream)
(print-unreadable-object-with-prefix (obj stream :type t :identity t)
(print-slot obj 'name stream)))
(defmethod print-object ((obj enemy) stream)
(print-unreadable-object-with-prefix (obj stream :type t :identity t)
(cond ((not (slot-boundp obj 'male))
(print-slot obj 'male stream))
((slot-value obj 'male)
(write "Male" :stream stream))
(t (write "Female" :stream stream)))
(write-string " " stream)
(print-slot obj 'species stream)))
(defmethod (setf health-of) (new-value (character base-character))
(let* ((max-health (calculate-stat character :health)))
(setf (slot-value character 'health) (cond ((< new-value 0)
0)
((> new-value max-health)
max-health)
(t new-value)))))
(defmethod (setf health-of) (new-value (character team-member))
(let* ((max-health (calculate-stat character :health)))
(setf (slot-value character 'health) (cond ((< new-value 0)
0)
((> new-value max-health)
max-health)
(t new-value)))))
(defmethod (setf energy-of) (new-value (character base-character))
(let ((max-energy (calculate-stat character :energy)))
(setf (slot-value character 'energy) (cond ((< new-value 0)
0)
((> new-value max-energy)
max-energy)
(t new-value)))))
(defmethod process-potty-dance ((character base-character) attack item reload (selected-target base-character))
(declare (ignore item reload selected-target))
(when (process-potty-dance-check character attack)
(format t "~a is too busy doing a potty dance to fight~%" (name-of character))
t))
#.`(progn ,@(iter (for i in '("BLADDER" "BOWELS"))
(appending (iter (for j in '("CONTENTS-OF" "FILL-RATE-OF"))
(collect `(defmethod ,(a:format-symbol :yadfa "~a/~a" i j) ((object base-character))
(declare (ignore object))
0))
(collect `(defmethod (setf ,(a:format-symbol :yadfa "~a/~a" i j)) (newval (object base-character))
(declare (ignore object newval))
0))))
(appending (iter (for j in '("NEED-TO-POTTY-LIMIT-OF" "POTTY-DANCE-LIMIT-OF" "POTTY-DESPERATE-LIMIT-OF" "MAXIMUM-LIMIT-OF"))
(collect `(defmethod ,(a:format-symbol :yadfa "~a/~a" i j) ((object base-character))
(declare (ignore object))
1))
(collect `(defmethod (setf ,(a:format-symbol :yadfa "~a/~a" i j)) (newval (object base-character))
(declare (ignore object newval))
1))))))
(defmethod toggle-onesie (onesie clothes user)
(error 'invalid-user-input :format-control "That's not a onesie"))
(defmethod toggle-onesie ((onesie onesie/opened) clothes (user base-character))
(if (and (car (onesie-thickness-capacity-of onesie))
(cdr clothes)
(> (total-thickness (cdr clothes)) (car (onesie-thickness-capacity-of onesie))))
(error 'onesie-too-thick :clothes clothes :user user)
(toggle-onesie% onesie)))
(defmethod toggle-onesie ((onesie onesie/closed) clothes (user base-character))
(if (lockedp onesie)
(error 'onesie-locked :clothes clothes :user user)
(toggle-onesie% onesie)))
(defmethod get-babyish-padding ((user team-member))
#.`(cond ,@(iter (for i in '(diaper pullup closed-bottoms))
(collect `((filter-items (wear-of user) ',i)
',i)))
(t nil)))
(defmethod output-process-potty-text (user padding type action had-accident &key (stream *standard-output*))
(declare (ignore user padding type action had-accident stream)))
(defmethod output-process-potty-text ((user player) padding (type (eql :wet)) (action (eql :potty-dance)) had-accident &key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt '("You feel like your bladder is going to explode"
"You're doing a potty dance like a 5 year old"
"You feel like you're going to wet yourself"
"You whine as you hold yourself in desperation"
"Aww, does the baby need to potty?"))))
(defmethod output-process-potty-text ((user player) padding (type (eql :wet)) (action (eql :desparate)) had-accident &key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt '("You feel like your bladder is going to explode"
"You're doing a potty dance like a 5 year old"
"You feel like you're going to wet yourself"
"You whine as you hold yourself in desperation"
"Aww, does the baby need to potty?"))))
(defmethod output-process-potty-text ((user player) padding (type (eql :wet)) (action (eql :need-to-potty)) had-accident &key (stream *standard-output*))
(format stream "You need to pee~%"))
(defmethod output-process-potty-text ((user player) (padding (eql 'diaper)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(let ((j (a:switch ((getf (car had-accident) :accident) :test 'eq)
(:dribble `("You gasp in horror as a little leaks out"
"You think you just leaked a little"
,(format nil "A little squirts out. You quickly grab yourself with a ~a, but manage to stop the flood"
(a:random-elt '("groan" "whine")))))
(:some '("You gasp in horror as you flood yourself, but manage to stop yourself"))
(:all (let ((a `(,(format nil
"LOOK EVERYBODY!!!! ~a IS WETTING ~a DIAPERS!!!!~%~%*~a eeps and hides ~a soggy padding in embarrassment*"
(string-upcase (name-of user))
(if (malep user) "HIS" "HER")
(name-of user)
(if (malep user) "his" "her"))
"After doing a potty dance like a 5 year old, you freeze and pee yourself"
"Grabbing your crotch you pause and blush as you flood yourself like an infant"
"You cross your legs in a vain attempt to hold it in but fail miserably"
"You gasp in embarrassment as you flood yourself like a toddler"
"You let out a groan as your bladder empties itself"
"You fall to your knees clutching the front of your diapers struggling to keep your diapers dry and flood yourself")))
(unless (malep user)
(push "You press your legs together while fidgeting and squirming until your flood your pamps like the baby girl you are" a))
(when (s:memq (car (tail-of user)) '(:medium :large :lizard))
"You clutch the front of your diaper with your legs crossed and your tail between your legs in vain as you flood your pamps")
a)))))
(when (>= (getf (car had-accident) :wet-amount) 300)
(push (format nil "Aww, the baby is using ~a diapers?" (if (malep user) "his" "her")) j))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt '("Your face turns red as you leak everywhere"
"Your diaper leaks all over the place, this is why you're supposed to change it"
"What's the point in having a diaper if you're just going to leak everywhere like you're doing now."
"Your diaper leaks. There goes the carpet."
"Heh, baby made a puddle"
"Your diapers sprung a leak"
"You eep as you make a puddle on the floor then hide your face in embarrassment")))))
(defmethod output-process-potty-text ((user player) (padding (eql 'pullup)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt (a:switch ((getf (car had-accident) :accident) :test 'eq)
(:dribble `(,(format nil "A little squirts out. You quickly grab yourself with a ~a, but manage to stop the flood"
(a:random-elt '("groan" "whine")))
"You gasp in horror as a little leaks out"
"You think you just leaked a little"))
(:some '("You gasp in horror as you flood yourself, but manage to stop yourself"))
(:all `(,(format nil "Naughty ~a wetting your pullups. You know you're supposed to use the toilet like a big kid."
(if (malep user) "boy" "girl"))
,(format nil "LOOK EVERYBODY!!!! ~A IS WETTING ~a PULLUPS!!!!!!~%~%*~a eeps and hides ~a soggy pullups in embarrassment*"
(string-upcase (name-of user))
(if (malep user) "HIS" "HER")
(name-of user)
(if (malep user) "his" "her"))
"After doing a potty dance like a 5 year old, you freeze and pee yourself"
"Grabbing your crotch you pause and blush as you flood yourself like an infant"
"You cross your legs in a vain attempt to hold it in but fail miserably"
"You gasp in embarrassment as you flood yourself like a toddler"
"You let out a groan as your bladder empties itself"
"You fall to your knees clutching the front of your pullups struggling to keep them dry and flood yourself"
"The little pictures on the front of your pullups fade showing everyone what you did")))))
(format stream "~a~%"
(let ((out '("Your face turns red as you leak everywhere"
"Your pullups leak. There goes the carpet."
"Heh, baby made a puddle"
"Your pullups sprung a leak")))
(when (filter-items (wear-of user) '(and pullup ab-clothing))
(push "Your pullups leaks all over the place, You sure you're ready for those?" out))
(a:random-elt out))))
(defmethod output-process-potty-text ((user player) (padding (eql 'closed-bottoms)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt (a:switch ((getf (car had-accident) :accident) :test 'eq)
(:dribble `(,(format nil
"A little squirts out. You quickly grab yourself with a ~a, but manage to stop the flood"
(a:random-elt '("groan" "whine")))
"You gasp in horror as a little leaks out"
"You think you just leaked a little"))
(:some '("You gasp in horror as you flood yourself, but manage to stop yourself"))
(:all '("After doing a potty dance like a 5 year old, you freeze and pee yourself"
"Grabbing your crotch you pause and blush as you flood yourself like an infant"
"You cross your legs in a vain attempt to hold it in but fail miserably"
"You gasp in embarrassment as you flood yourself like a toddler"
"You let out a groan as your bladder empties itself"
"You fall to your knees holding your crotch struggling to keep your pants dry and flood yourself")))))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "Bad ~a! No going potty in the house!" (if (= (random 2) 0) (species-of user) (name-of user)))
,(format nil "Heh, baby wet ~a pants" (if (malep user) "his" "her"))
,(format nil "Bad ~a! Look what you did to your pants!"
(if (= (random 2) 0) (species-of user) (name-of user)))
"Maybe you should start wearing diapers"
"A puddle appears on the floor"
"There goes the carpet"
"Heh, baby made a puddle"
"Your pants are ruined")))))
(defmethod output-process-potty-text ((user player) (padding (eql nil)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(let
((j (a:switch ((getf (car had-accident) :accident) :test 'eq)
(:dribble `(,(format nil "A little squirts out. You quickly grab yourself with a ~a, but manage to stop the flood"
(a:random-elt '("groan" "whine")))
"You gasp in horror as a little leaks out"
"You think you just leaked a little"))
(:some '("You gasp in horror as you flood yourself, but manage to stop yourself"))
(:all '("After doing a potty dance like a 5 year old, you freeze and pee yourself"
"Grabbing your crotch you pause and blush as you flood yourself like an infant"
"You cross your legs in a vain attempt to hold it in but fail miserably"
"You gasp in embarrassment as you flood yourself like a toddler"
"You let out a groan as your bladder empties itself")))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "Bad ~a! No going potty in the house!" (if (= (random 2) 0) (species-of user) (name-of user)))
"Maybe you should start wearing diapers"
"A puddle appears on the floor"
"There goes the carpet"
"Heh, baby made a puddle")))))
(defmethod output-process-potty-text ((user player) padding (type (eql :mess)) (action (eql :potty-dance)) had-accident &key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt '("You feel like you're gonna mess yourself"
"You clench hard trying to avoid messing"
"Aww, does the baby need to potty?"))))
(defmethod output-process-potty-text ((user player) padding (type (eql :mess)) (action (eql :desparate)) had-accident &key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt '("You feel like you're gonna mess yourself"
"You clench hard trying to avoid messing"
"Aww, does the baby need to potty?"))))
(defmethod output-process-potty-text ((user player) padding (type (eql :mess)) (action (eql :need-to-potty)) had-accident &key (stream *standard-output*))
(format stream "You need to poo~%"))
(defmethod output-process-potty-text ((user player) (padding (eql 'diaper)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(let ((j `(,(format nil "Reaching the breaking point, you instinctively squat down~a and mess"
(if (s:memq (car (tail-of user)) '(:medium :large))
" with your tail up"
""))
,(format nil "You instinctively squat down~a and mess your diapers, then hold the back of your diapers checking your load in embarrassment"
(if (s:memq (car (tail-of user)) '(:medium :large))
" with your tail up"
""))
,(format nil "Heh, the baby blorted ~a pamps." (if (malep user) "his" "her"))
"Your struggle to hold it in, but your bowels decide to empty themselves anyway"
"You end up messing your self"
"The back of your diaper expands as you accidentally mess yourself")))
(when (filter-items (wear-of user) '(and diaper ab-clothing))
(push (format nil "Aww, is the baby messing ~a diapers" (if (malep user) "his" "her")) j))
(a:random-elt j)))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt '("Your face turns red as your mess falls out the leg guards"
"Your diaper leaks all over the place, this is why you're supposed to change it"
"What's the point in having a diaper if you're just going to leak everywhere like you're doing now."
"Your diaper leaks. There goes the carpet."
"Not on the carpet!!!"
"Blowout!!!!")))))
(defmethod output-process-potty-text ((user player) (padding (eql 'pullup)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(let ((j `(,(format nil "Reaching the breaking point, you instinctively squat down~a and mess"
(if (s:memq (car (tail-of user)) '(:medium :large))
" with your tail up"
""))
"Your struggle to hold it in, but your bowels decide to empty themselves anyway"
"You end up messing your self"
"The back of your pullups expands as you accidentally mess yourself")))
(when (filter-items (wear-of user) '(or ab-clothing pullup))
(push (format nil "Naughty ~a messing your pullups. You know you're supposed to use the toilet like a big kid"
(if (malep user) "boy" "girl"))
j))
(a:random-elt j)))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt '("Your face turns red as your mess falls out the leg guards"
"Your pullups leaks all over the place, You sure you're ready for those?"
"Your pullups leak. There goes the carpet."
"Not on the carpet!!!")))))
(defmethod output-process-potty-text ((user player) (padding (eql 'closed-bottoms)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt `(,(format nil "Reaching the breaking point, you instinctively squat down~a and mess"
(if (s:memq (car (tail-of user)) '(:medium :large))
" with your tail up"
""))
"Your struggle to hold it in, but your bowels decide to empty themselves anyway"
"You end up messing your self"
"a lump forms at the seat of your pants")))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "Bad ~a! No going potty in the house!"
(if (= (random 2) 0) (species-of user) (name-of user)))
,(format nil "Heh, baby messed ~a pants" (if (malep user) "his" "her"))
,(format nil "Bad ~a! Look what you did to your pants!" (if (= (random 2) 0) (species-of user) (name-of user)))
"Maybe you should start wearing diapers"
"There goes the carpet"
"Heh, baby made a mess"
"Your pants are ruined")))))
(defmethod output-process-potty-text ((user player) (padding (eql nil)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt `(,(format nil "Reaching the breaking point, you instinctively squat down~a and mess"
(if (s:memq (car (tail-of user)) '(:medium :large))
" with your tail up"
""))
"Your struggle to hold it in, but your bowels decide to empty themselves anyway"
"You end up messing your self")))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "Bad ~a! No going potty in the house!"
(if (= (random 2) 0) (species-of user) (name-of user)))
"Maybe you should start wearing diapers"
"There goes the carpet"
"Heh, baby made a mess")))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql 'diaper)) (type (eql :wet)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* (normal
leak
(user-name (name-of user))
(male (malep user))
(player-name (name-of (player-of *game*)))
(hisher (if male "his" "her")))
(if (and (car had-accident) (= (getf (car had-accident) :wet-amount) 10))
(progn
(do-push (with-output-to-string (s)
(format s "~a: *gasps in horror* I think a little just came out!!!!~%~%" user-name)
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format s "~a: You're making a puddle~%~%" player-name)
(format s "~a: NUUUUU!!!!~%~%" user-name)))
normal leak)
(do-push (with-output-to-string (s)
(format s "*~a quietly moans at a little squirts out~%~%" user-name)
(format s "~a: Did you wet yourself?~%~%" player-name)
(format s "~a: *quietly* No ~%~%" user-name)
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format s "~a Your diaper's leaking~%~%" player-name)
(format s "~a: GAH!!!!~%~%" player-name)))
normal leak))
(progn
(do-push (with-output-to-string (s)
(format s "*~a has an accident*~%~%" user-name)
(format s "~a: Aww, did the baby wet ~a diapers~%~%" player-name hisher)
(format s "~a: *heavily blushing* No *tries to hide it with ~a paws~a*~%~%" user-name male
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
""))
(format s "*~a squishes ~a's diaper*~%~%" player-name user-name)
(format s "~a: Looks like it to me~%~%" player-name))
normal)
(do-push (with-output-to-string (s)
(format s "*~a has an accident*~%~%" user-name)
(format s "~a: Aww, did the baby wet ~a diapers~%~%" player-name hisher)
(format s "~a: *heavily blushing* No *tries to hide it with ~a paws~a*~%~%"
user-name
hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
""))
(format s "~a: Aww, the poor baby made puddles~%~%" player-name)
(format s "*~a gasps with a horrified look on ~a face when ~a notices it.~%~%" user-name hisher
(if male "he" "she")))
leak)
(do-push (with-output-to-string (s)
(format s "*~a bounces up and down with ~a knees pressed together and paws pressed against ~a crotch, pauses when ~a bladder gives out looks down and notices "
user-name hisher hisher hisher)
(format s "~a soggy padding, blushes heavily and quickly covers ~a soggy padding with ~a paws~a hoping no one will notice*~%~%"
hisher hisher hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
"")))
normal)
(do-push (with-output-to-string (s)
(format s "*~a bounces up and down with ~a knees pressed together and paws pressed against ~a crotch, pauses when ~a bladder gives out looks down and notices "
user-name hisher hisher hisher)
(format s "~a padding is leaking, blushes heavily and quickly covers ~a soggy padding with ~a paws~a hoping no one will notice*~%~%"
hisher hisher hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
"")))
leak)))
(if (> (getf (car had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql 'pullup)) (type (eql :wet)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* (normal
leak
(male (malep user))
(user-name (name-of user))
(player-name (name-of (player-of *game*)))
(hisher (if (malep user) "his" "her")))
(if (and (car had-accident) (= (getf (car had-accident) :wet-amount) 10))
(progn
(do-push (with-output-to-string (s)
(format s "~a: *gasps in horror* I think a little just came out!!!!~%~%" user-name)
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format s "~a: You're making a puddle~%~%" player-name)
(format s "~a: NUUUUU!!!!~%~%" user-name)))
normal leak)
(do-push (with-output-to-string (s)
(format s "*~a quietly moans at a little squirts out~%~%" user-name)
(format s "~a: Did you wet yourself?~%~%" player-name)
(format s "~a: *quietly* No ~%~%" user-name)
(cond
((filter-items (wear-of user) '(and pullup ab-clothing))
(format s "~a: Those pictures on the front of your pullups better not fade~%~%"
player-name)
(format s "~a: They're not, honest ~%~%" user-name)
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format s "*~a checks ~a's pullups. Notices they're drenched~%~%" player-name user-name)
(format s "~a: Uh huh, sure~%~%" player-name)))))
normal leak))
(progn
(do-push (with-output-to-string (s)
(format s "*~a bounces up and down with ~a knees pressed together and paws pressed against ~a crotch, pauses when ~a bladder gives out looks down and notices "
user-name hisher hisher hisher)
(if (filter-items (wear-of user) '(and pullup ab-clothing))
(format s "the pictures on ~a pullups have faded, blushes heavily and quickly covers ~a soggy pullups with ~a paws~a hoping no one will notice*~%~%"
hisher hisher hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
""))
(format s "that ~a wetted ~a pullups, blushes heavily and quickly covers ~a soggy pullups with ~a paws~a hoping no one will notice*~%~%"
(if male "he" "she")
hisher hisher hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
""))))
normal leak)
(push (with-output-to-string (s)
(format s "*~a has an accident*~%~%" user-name)
(format s "~a: Bad ~a. You know you're supposed to use the toilet like a big ~a. Just look what you did to your pullups~%~%"
player-name user-name (if male "boy" "girl")))
normal)
(when (filter-items (wear-of user) '(and pullup ab-clothing))
(push (with-output-to-string (s)
(format s "*~a has an accident and leaks*~%~%"
user-name)
(format s "~a: Bad ~a. You know you're supposed to use the toilet like a big ~a. Just look at the mess you made on the floor~%~%"
player-name user-name (if male "boy" "girl")))
leak))))
(if (> (getf (car had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql 'closed-bottoms)) (type (eql :wet)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* (normal
leak
(male (malep user))
(user-name (name-of user))
(player-name (name-of (player-of *game*))))
(if (and (car had-accident) (= (getf (car had-accident) :wet-amount) 10))
(progn
(do-push (with-output-to-string (s)
(format s "~a: *gasps in horror* I think a little just came out!!!!~%~%" user-name)
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format s "~a: You're making a puddle~%~%" player-name)
(format s "~a: NUUUUU!!!!~%~%" user-name)))
normal leak)
(do-push (with-output-to-string (s)
(format s "*~a quietly moans at a little squirts out~%~%" user-name)
(format s "~a: Did you wet yourself?~%~%" player-name)
(format s "~a: *quietly* No ~%~%" user-name))
normal leak))
(progn
(do-push (with-output-to-string (s)
(let* ((male (if male "his" "her")))
(format s "*~a bounces up and down with ~a knees pressed together and paws pressed against ~a crotch, pauses when ~a bladder gives out looks down and notices ~a soggy padding, blushes heavily and quickly covers ~a soggy padding with ~a paws~a hoping no one will notice*~%~%"
user-name male male male male male male
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
(format nil " with ~a tail between ~a legs" male male)
""))))
normal leak)))
(if (> (getf (car had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql nil)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let (normal
leak
(user-name (name-of user))
(player-name (name-of (player-of *game*)))
(hisher (if (malep user) "his" "her")))
(if (and (car had-accident) (= (getf (car had-accident) :wet-amount) 10))
(progn
(do-push (with-output-to-string (s)
(format s "~a: *gasps in horror* I think a little just came out!!!!~%~%" user-name)
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format s "~a: You're making a puddle~%~%" player-name)
(format s "~a: NUUUUU!!!!~%~%" user-name)))
normal leak)
(do-push (with-output-to-string (s)
(format s "*~a quietly moans at a little squirts out~%~%" user-name)
(format s "~a: Did you wet yourself?~%~%" player-name)
(format s "~a: *quietly* No ~%~%" user-name))
normal leak))
(progn
(do-push
(with-output-to-string (s)
(format s "*~a crosses ~a legs pressing ~a paws against ~a crotch as a puddle forms beneath ~a feet*~%~%"
user-name hisher hisher hisher hisher))
normal leak)
(do-push
(with-output-to-string (s)
(format s "*~a has an accident and makes a mess on the floor. " user-name)
(format s "Then walks away heavily blushing hoping no one will notice*~%~%"))
normal leak)))
(if (> (getf (car had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) padding (type (eql :wet)) (action (eql :potty-dance)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(player-name (name-of (player-of *game*)))
(male (malep user))
(hisher (if male "his" "her"))
(himher (if male "him" "her")))
(format stream "~a"
(a:random-elt (if (= (random 5) 0)
(list (with-output-to-string (s)
(format s "~a: ~a, do you need to potty?~%~%" player-name user-name)
(format s "~a: No, I'm fine *bounces up and down holding ~aself*~%~%" user-name himher))
(with-output-to-string (s)
(format s "~a: ~a, do you need to potty?~%~%" player-name user-name)
(format s "~a: No, I'm ok *hops from foot to foot holding ~a crotch*~%~%" user-name hisher))
(with-output-to-string (s)
(format s "~a: ~a, do you need to potty?~%~%" player-name user-name)
(format s "~a: No, I'm alright *moans with ~a legs twisted holding ~a crotch*~%~%"
user-name hisher hisher)))
(list (with-output-to-string (s)
(format s "*~a is doing a potty dance like a 5 year old*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a is bouncing up and down with ~a knees knocked together holding ~aself*~%~%"
user-name hisher himher))
(with-output-to-string (s)
(format s "*~a is hopping from foot to foot*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a starts moaning with ~a legs crossed*~%~%" user-name hisher))))))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) padding (type (eql :wet)) (action (eql :desparate)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(player-name (name-of (player-of *game*)))
(male (malep user))
(hisher (if male "his" "her"))
(himher (if male "him" "her")))
(format stream "~a"
(a:random-elt
(if (= (random 5) 0)
(list (with-output-to-string (s)
(format s "~a: ~a!!! I GOTTY POTTY!!! *bounces up and down holding ~aself*~%~%" user-name player-name himher))
(with-output-to-string (s)
(format s "~a: ~a!!! HURRY!!! I CAN'T HOLD IT MUCH LONGER!!! *hops from foot to foot holding ~a crotch*~%~%"
user-name player-name hisher))
(with-output-to-string (s)
(format s "~a: ~a!!! PLEASE TAKE ME TO THE POTTY!!! I'M ABOUT TO WET MYSELF!!! *bounces up and down holding ~aself*~%~%"
user-name player-name himher)))
(list (with-output-to-string (s)
(format s "*~a is doing a potty dance like a 5 year old*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a is bouncing up and down with ~a knees pressed together holding ~aself*~%~%"
user-name hisher himher))
(with-output-to-string (s)
(format s "*~a is hopping from foot to foot*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a starts moaning with ~a legs crossed*~%~%" user-name hisher))))))))
(defmethod output-process-potty-text ((user ally-rebel-potty-training) padding (type (eql :wet)) (action (eql :had-accident)) had-accident &key (stream *standard-output*))
(let* ((user-name (name-of user))
(player-name (name-of (player-of *game*)))
(male (malep user))
(hisher (if male "his" "her")))
(cond ((and
(car had-accident)
(> (getf (car had-accident) :leak-amount) 0))
(format stream "~a"
(a:random-elt
(list (with-output-to-string (s)
(format s "*~a stops in his tracks*~%~%" user-name)
(format s "~a: Is something the matter?~%~%" player-name)
(format s "~a: what do you mean? *a soft hiss can be heard coming from the front of ~a diaper, then yellow streams flow down ~a legs from the leg guards and a puddle starts forming at ~a feet*~%~%"
user-name hisher hisher hisher)
(format s "~a: You're making a puddle~%~%" player-name)
(format s "~a: Oh No!!!~%" user-name))
(with-output-to-string (s)
(format s "*~a floods ~a nappies, then leaks and leaves puddles*~%~%" user-name hisher))
(with-output-to-string (s)
(format s "*~a floods his nappies, then gets an expression of horror on ~a face when ~a diaper leaks and a puddle forms, then starts waddling with ~a legs spread apart*~%~%"
user-name hisher hisher hisher))
(with-output-to-string (s)
(format s "*~a decides to flood ~a already waterlogged diaper, then acts all surprised when it leaks*~%~%"
user-name hisher))
(with-output-to-string (s)
(format s "*~a floods his diapers and starts leaving a puddle, then freaks and waddles towards ~a with ~a legs spread apart like a 5 year old who didn't make it*~%~%"
user-name player-name hisher)
(format s "~a: Umm ~a, I think I need a change.~%~%" user-name player-name)
(format s "~a: No shit~%~%" player-name))))))
((and (car had-accident)
(> (getf (car had-accident) :wet-amount) 0))
(format stream "~a"
(a:random-elt (list (with-output-to-string (s)
(format s "*~a stops in his tracks*~%~%" user-name)
(format s "~a: Is something the matter?~%~%" player-name)
(format s "~a: what do you mean? *a soft hiss can be heard coming from the front of ~a diaper*~%~%"
user-name hisher)
(format s "~a: Oh, never mind~%~%" player-name))
(with-output-to-string (s)
(format s "*~a pauses and floods ~a diapers*~%~%" user-name hisher))
(with-output-to-string (s)
(format s "*~a floods ~a diapers*~%~%" user-name hisher)))))))))
(defmethod output-process-potty-text ((user ally-no-potty-training) padding (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(player-name (name-of (player-of *game*)))
(male (malep user))
(hisher (if male "his" "her")))
(cond ((and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a"
(a:random-elt (list (with-output-to-string (s)
(format s "*~a floods ~a nappies, then leaks and leaves puddles*~%~%" user-name hisher))
(with-output-to-string (s)
(format s "*~a floods his nappies, then gets an expression of horror on ~a face when ~a diaper leaks and a puddle forms, then starts waddling with ~a legs spread apart*~%~%"
user-name hisher hisher hisher))
(with-output-to-string (s)
(format s "*~a decides to flood ~a already waterlogged diaper, then acts all surprised when it leaks*~%~%"
user-name hisher))
(with-output-to-string (s)
(format s "*~a floods his diapers and starts leaving a puddle, then freaks and waddles towards ~a with ~a legs spread apart like a 5 year old who didn't make it*~%~%"
user-name player-name hisher)
(format s "~a: Umm ~a, I think I need a change.~%~%" user-name player-name)
(format s "~a: No shit~%~%" player-name))))))
((and (car had-accident) (> (getf (car had-accident) :wet-amount) 0))
(format stream "*~a floods ~a diapers*~%~%" user-name hisher)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql :diaper)) (type (eql :mess)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* (normal
leak
(user-name (name-of user))
(player-name (name-of (player-of *game*)))
(male (malep user))
(hisher (if male "his" "her")))
(do-push (with-output-to-string (s)
(format s "*~a has an accident*~%~%" user-name)
(format s "~a: Aww, did the baby mess ~a diapers~%~%" player-name hisher)
(format s "~a: *heavily blushing* No *tries to hide it with ~a paws~a*~%~%" user-name hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
""))
(format s "*~a pats the back of ~a's diaper causing ~a to scrunch ~a face*~%~%" player-name user-name user-name hisher)
(format s "~a: Looks like it to me~%~%" player-name))
normal)
(do-push (with-output-to-string (s)
(format s "*~a has an accident*~%~%" user-name)
(format s "~a: Aww, did the baby mess ~a diapers~%~%" player-name hisher)
(format s "~a: *heavily blushing* No *tries to hide it with ~a paws~a*~%~%" user-name hisher
(if (s:memq (car (tail-of user)) '(:medium :large :lizard))
" and tail"
""))
(format s "~a: Aww, the poor baby made a mess on the floor~%~%" player-name)
(apply #'format s "*~a gasps with a horrified look on ~a face when ~a notices it.~%~%" user-name
(if male
'("his" "he")
'("her" "she"))))
leak)
(do-push (with-output-to-string (s)
(apply #'format s "*~a instinctively squats down and accidentally messes ~a diapers then gasps in horror when ~a realized what ~a did*~%~%"
user-name
(if male
'("his" "he" "he")
'("her" "she" "she"))))
normal)
(do-push (with-output-to-string (s)
(apply #'format s "*~a instinctively squats down and accidentally messes ~a diapers then holds the back of ~a diapers checking ~a load in embarrassment*~%~%"
user-name
(if male
'("his" "his" "his" "his")
'("her" "her" "her" "her"))))
normal)
(do-push (with-output-to-string (s)
(apply #'format s "*~a instinctively squats down and accidentally messes ~a diapers then gasps in horror when ~a notices the poo falling down the leg guards*~%~%"
user-name
(if male
'("his" "he")
'("her" "she"))))
leak)
(if (> (getf (cdr had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql :pullup)) (type (eql :mess)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let ((normal ())
(leak ()))
(do-push (with-output-to-string (s)
(apply #'format s "*~a instinctively squats down and accidentally messes ~a pullups then gasps in horror when ~a realized what ~a did*~%~%"
(name-of user)
(if (malep user)
'("his" "he" "he")
'("her" "she" "she"))))
normal)
(do-push (with-output-to-string (s)
(apply #'format s "*~a instinctively squats down and accidentally messes ~a pullups then gasps in horror when ~a notices the poo falling down the leg guards*~%~%"
(name-of user)
(if (malep user)
'("his" "he")
'("her" "she"))))
leak)
(when (filter-items (wear-of user) '(and ab-clothing pullup))
(do-push (with-output-to-string (s)
(format s "*~a has an accident and leaks*~%~%"
(name-of user))
(format s "~a: Bad ~a. You know you're supposed to use the toilet like a big ~a. Just look at the mess you made on the floor~%~%"
(name-of (player-of *game*))
(name-of user)
(if (malep user) "boy" "girl")))
leak))
(if (> (getf (cdr had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql 'closed-bottoms)) (type (eql :mess)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let ((normal ())
(leak ()))
(do-push (with-output-to-string (s)
(apply #'format s "*~a instinctively squats down and accidentally messes ~a pants then gasps in horror when ~a realized what ~a did*~%~%"
(name-of user)
(if (malep user)
'("his" "he" "he")
'("her" "she" "she"))))
normal leak)
(if (> (getf (cdr had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) (padding (eql nil)) (type (eql :mess)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let ((normal ())
(leak ()))
(do-push
(with-output-to-string (s)
(format s "*~a accidentally messes ~aself as it falls on the floor*~%~%"
(name-of user)
(if (malep user) "his" "her"))
(format s "~a: Bad ~a!!! No going potty on the floor!!!~%~%"
(name-of (player-of *game*))
(name-of user))
(format s "~a: I didn't mean to!!!~%~%"
(name-of user))
(format s "~a: A likely story~%~%"
(name-of (player-of *game*))))
normal leak)
(do-push (with-output-to-string (s)
(format s "*~a has an accident and makes a mess on the floor. " (name-of user))
(format s "Then walks away heavily blushing hoping no one will notice*~%~%"))
normal leak)
(if (> (getf (cdr had-accident) :leak-amount) 0)
(format stream "~a" (a:random-elt leak))
(format stream "~a" (a:random-elt normal)))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) padding (type (eql :mess)) (action (eql :potty-dance)) had-accident
&key (stream *standard-output*))
(let* ((player-name (name-of (player-of *game*)))
(user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~a"
(a:random-elt (if (= (random 5) 0)
(list (with-output-to-string (s)
(format s "~a: ~a, do you need to potty?~%~%" player-name user-name)
(format s "~a: No, I'm fine *bounces up and down holding ~aself*~%~%" user-name (if male "him" "her")))
(with-output-to-string (s)
(format s "~a: ~a, do you need to potty?~%~%" player-name user-name)
(format s "~a: No, I'm ok *hops from foot to foot*~%~%" user-name))
(with-output-to-string (s)
(format s "~a: ~a, do you need to potty?~%~%" player-name user-name)
(format s "~a: No, I'm alright *moans with ~a legs twisted*~%~%" user-name hisher)))
(list (with-output-to-string (s)
(format s "*~a is doing a potty dance like a 5 year old*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a is bouncing up and down with ~a knees pressed together holding ~aself*~%~%"
user-name hisher (if male "him" "her")))
(with-output-to-string (s)
(format s "*~a is hopping from foot to foot*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a starts moaning with ~a legs crossed*~%~%" user-name hisher))))))))
(defmethod output-process-potty-text ((user ally-last-minute-potty-training) padding (type (eql :mess)) (action (eql :desparate)) had-accident
&key (stream *standard-output*))
(let* ((player-name (name-of (player-of *game*)))
(user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~a"
(a:random-elt (if (= (random 5) 0)
(list (with-output-to-string (s)
(format s "~a: ~a!!! I GOTTY POTTY!!! *bounces up and down holding ~aself*~%~%" user-name player-name
(if male "him" "her")))
(with-output-to-string (s)
(format s "~a: ~a!!! HURRY!!! I CAN'T HOLD IT MUCH LONGER!!! *hops from foot to foot holding ~a crotch*~%~%"
user-name player-name hisher)))
(progn (with-output-to-string (s)
(format s "*~a is doing a potty dance like a 5 year old*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a is bouncing up and down with ~a knees pressed together holding ~aself*~%~%"
user-name hisher (if male "him" "her")))
(with-output-to-string (s)
(format s "*~a is hopping from foot to foot*~%~%" user-name))
(with-output-to-string (s)
(format s "*~a starts moaning with ~a legs crossed*~%~%" user-name hisher))))))))
(defmethod output-process-potty-text ((user ally-rebel-potty-training) padding (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(cond ((and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "*~a squats down and pushes a big load into ~a already loaded diaper, then predictably has a blowout*~%~%" user-name hisher))
((and (cdr had-accident) (> (getf (cdr had-accident) :mess-amount) 0))
(format stream "~a"
(a:random-elt (list (with-output-to-string (s)
(format s "*~a squats down and pushes a big load into ~a diaper like an infant*~%~%" user-name hisher))
(with-output-to-string (s)
(apply #'format s "*~a squats down and pushes a big load into ~a diaper then holds the back of ~a diaper checking ~a new load as if giving ~aself a diaper check*~%~%"
user-name
(if male
'("his" "his" "his" "him")
'("her" "her" "her" "her")))))))))))
(defmethod output-process-potty-text ((user ally-no-potty-training) padding (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(hisher (if (malep user) "his" "her")))
(cond ((and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a"
(with-output-to-string (s)
(format s "*~a squats down and pushes a big load into ~a already loaded diaper, then predictably has a blowout*~%~%"
user-name hisher))))
((and (cdr had-accident) (> (getf (cdr had-accident) :mess-amount) 0))
(format stream "*~a squats down and pushes a big load into ~a diaper like an infant*~%~%"
user-name hisher)))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) padding (type (eql :wet)) (action (eql :potty-dance)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~a~%"
(a:random-elt (let ((a (list (format nil "*~a is doing a potty dance like a 5 year old*" user-name)
(format nil "*~a hops from foot to foot holding ~a crotch*" user-name hisher)
(format nil "*~a bounces up and down holding ~aself*" user-name hisher))))
(unless male
(push (format nil "~a fidgets and squirms while pressing her legs together" user-name) a))
a)))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) padding (type (eql :wet)) (action (eql :desparate)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user)))
(format stream "~a~%"
(a:random-elt (let ((a (list (format nil "*~a is doing a potty dance like a 5 year old*" user-name)
(format nil "*~a hops from foot to foot holding ~a crotch*" user-name (if male "his" "her"))
(format nil "*~a bounces up and down holding ~aself*" user-name (if male "him" "her"))
(apply #'format nil "*~a whines as ~a hold ~aself in desperation*"
user-name (if male
'("he" "him")
'("she" "her"))))))
(unless male
(push (format nil "~a fidgets, squirms, and bounces while pressing her legs together" user-name)
a))
a)))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql 'diaper)) (type (eql :wet)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a Grabs ~a crotch, pauses and blushes as ~a flood ~a diapers like an infant*"
user-name
(if male
'("his" "he" "his")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*" user-name hisher)
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her")))
(apply #'format nil "~a falls to ~a knees clutching the front of ~a diaper in a desperate attempt to keep ~a diapers dry but ends up flooding ~a diapers"
user-name
(let (a)
(dotimes (i 4 a)
(push hisher a)))))))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a's face turns red as ~a leak everywhere*"
user-name
(if male "he" "she"))
(format nil "*~a leaves a puddle then starts waddling around with ~a legs spread apart leaving a trail like a 5 year old who didn't make it*"
user-name
(if male "he" "she"))
(format nil "*~a's diapers sprung a leak*"
user-name)
(format nil "~a: Aww, looks like ~a's diapers sprung a leak~%~%*~a blushes heavily at the embarrassing comment*"
(name-of (player-of *game*)) user-name user-name)))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql 'pullup)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a Grabs ~a crotch, pauses and blushes as ~a flood ~aself like an infant*"
user-name
(if male
'("his" "he" "him")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name
hisher)
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her")))
(apply #'format nil "~a falls to ~a knees clutching the front of ~a pullups in a desperate attempt to keep the pictures on the front of ~a pullups from fading but ends up flooding ~a pullups"
user-name
(let (a)
(dotimes (i 4 a)
(push hisher a)))))))))
(when (>= (getf (car had-accident) :wet-amount) 300)
(push (format nil "*The little pictures on the front of ~a's pullups fade showing everyone what ~a did*"
user-name
(if male "he" "she"))
j))
(a:random-elt j)))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a's face turns red as ~a leak everywhere*"
user-name
(if male "he" "she"))
(format nil "*~a leaves a puddle then starts waddling around with ~a legs spread apart leaving a trail like a 5 year old who didn't make it*"
user-name
(if male "he" "she"))
(format nil "*~a's pullups sprung a leak*"
user-name))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql 'closed-bottoms)) (type (eql :wet)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her"))
(player-name (name-of (player-of *game*))))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(let ((a (list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a Grabs ~a crotch, pauses and blushes as ~a flood ~aself like an infant*"
user-name
(if male
'("his" "he" "him")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name
hisher)
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her")))
(apply #'format nil "~a falls to ~a knees holding ~a crotch in a desperate attempt to keep ~a pants dry but ends up flooding ~a pants"
user-name
(let (a)
(dotimes (i 4 a)
(push hisher a)))))))
(unless male
(push (format nil "~a struggles to hold it in while pressing her legs together before wetting her pants"
user-name)
a))
a)))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a's on the nose with a newspaper*"
player-name user-name player-name user-name)
,(format nil "~a: Heh, baby ~a made a puddle" player-name user-name)
,(format nil "~a's pants are ruined" user-name)
,(format nil "~a: Heh, baby ~a wet ~a pants" player-name user-name hisher)
,(format nil "~a: Bad ~a! Look what you did to your pants!" player-name user-name)
"A puddle appears on the floor"
"There goes the carpet"))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql nil)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her"))
(player-name (name-of (player-of *game*))))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(let ((a (list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a Grabs ~a crotch, pauses and blushes as ~a flood ~aself like an infant*"
user-name
(if male
'("his" "he" "him")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name hisher)
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her")))
(apply #'format nil "~a falls to ~a knees holding ~a crotch in a desperate attempt to keep from wetting ~aself but ends up wetting ~a pants anyway"
user-name
(if male
'("his" "his" "him" "his")
'("her" "her" "her" "her"))))))
(unless male
(push
(format nil "~a struggles to hold it in while pressing her legs together until urine starts flowing down her legs"
user-name)
a))
a)))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a's on the nose with a newspaper*"
player-name user-name player-name user-name)
,(format nil "~a: Heh, baby ~a made a puddle"
player-name user-name)
"A puddle appears on the floor"
"There goes the carpet"))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) padding (type (eql :mess)) (action (eql :potty-dance)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a is doing a potty dance like a 5 year old*" (name-of user))
(apply #'format nil "*~a crosses ~a legs in an attempt to avoid messing ~aself*"
(name-of user)
(if (malep user)
'("his" "him")
'("her" "her")))
(format nil "*~a is hopping from foot to foot holding the ~a*"
(name-of user)
(funcall (if (malep user)
#'car
#'cdr)
(getf '(diaper ("seat of his diapers" . "seat of her diapers")
pullup ("seat of his pullups" . "seat of her pullups")
closed-bottoms ("seat of his pants" . "seat of her pants")
nil ("back of himself" . "back of herself"))
padding)))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) padding (type (eql :mess)) (action (eql :desparate)) had-accident
&key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a is doing a potty dance like a 5 year old*" (name-of user))
(apply #'format nil "*~a crosses ~a legs in an attempt to avoid messing ~aself*"
(name-of user)
(if (malep user)
'("his" "him")
'("her" "her")))
(format nil "*~a is hopping from foot to foot holding the ~a*"
(name-of user)
(funcall
(if (malep user)
#'car
#'cdr)
(getf '(diaper ("seat of his diapers" . "seat of her diapers")
pullup ("seat of his pullups" . "seat of her pullups")
closed-bottoms ("seat of his pants" . "seat of her pants")
nil ("back of himself" . "back of herself"))
padding)))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql 'diaper)) (type (eql :mess)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~{~a~}~%"
(let ((a (list (a:random-elt (list (format nil "*~a instinctively squats down~a and mess ~a diapers*"
user-name hisher
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up" hisher)
""))
(apply #'format nil
"*The back of ~a's diaper expands as ~a accidentally messes ~aself*"
user-name
(if male
'("he" "him")
'("she" "her")))
(format nil "*~a instinctively squats down~a and messes ~a diapers then holds the back of ~a diapers checking ~a load in embarrassment*~%~%"
user-name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
hisher)
"")
hisher hisher hisher)))))
(b (a:random-elt `(,(format nil "~%~%~a: Heh, baby ~a blorted ~a pamps."
(name-of (player-of *game*))
user-name
hisher)
nil))))
(when b (push b (cdr (last a))))))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "*~a*~%"
(a:random-elt `(,(format nil "~a face turns red as ~a mess falls out the leg guards"
user-name
hisher)
"Blowout!!!!"))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql 'pullup)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~{~a~}~%"
(let ((a (list (a:random-elt (list (format nil "*~a instinctively squats down~a and mess ~a pullups*"
user-name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
hisher)
"")
hisher)
(apply #'format nil "*The back of ~a's pullups expands as ~a accidentally messes ~aself*"
user-name
(if male
'("he" "him")
'("she" "her")))))))
(b (a:random-elt `(,(format nil "~%~%~a: Bad ~a!!! You know you're supposed to use the toilet like a big kid"
(name-of (player-of *game*))
user-name)
nil))))
(when b (push b (cdr (last a))))))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "*~a*~%"
(a:random-elt (list (format nil "~a face turns red as ~a mess falls out the leg guards"
user-name hisher)
(format nil "~a pullups leak all over the place" user-name)))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql 'closed-bottoms)) (type (eql :mess)) (action (eql :had-accident))
had-accident &key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her"))
(player-name (name-of (player-of *game*))))
(format stream "*~a*~%"
(a:random-elt (list (format nil "~a instinctively squats down~a and messes ~a pants"
user-name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
hisher)
"")
hisher)
(apply #'format nil "a lump forms at the seat of ~a's pants"
user-name))))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt (list (format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a on the nose with a newspaper*"
player-name user-name player-name user-name)
(format nil "*~a's pants are ruined*" user-name)
(format nil "*~a makes a mess on the floor*" user-name)
(format nil "~a: Heh, baby ~a messed ~a pants" player-name user-name hisher)
(format nil "~a: Bad ~a! Look what you did to your pants!" (name-of (player-of *game*)) (name-of user))))))))
(defmethod output-process-potty-text ((user ally-silent-potty-training) (padding (eql nil)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(player-name (name-of (player-of *game*))))
(format stream "*~a*~%"
(a:random-elt (list (format nil "Reaching the breaking point, ~a instinctively squats down~a and messes"
user-name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up" (if (malep user) "his" "her"))
""))
(format nil "~a has an accident and makes a mess on the floor" user-name))))
(let ((a (a:random-elt `(,(format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a on the nose with a newspaper*"
player-name user-name player-name user-name)
nil))))
(when a
(format stream "~a~%" a)))))
(defmethod output-process-potty-text ((user ally-feral) padding (type (eql :wet)) (action (eql :potty-dance)) had-accident &key (stream *standard-output*))
(let ((user-name (name-of user)))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a is doing a potty dance like a 5 year old*" user-name)
(format nil "*~a hops from foot to foot*" user-name)
(format nil "*~a runs in circles like a dog needing to potty*" user-name)
(format nil "~a fidgets and squirms while pressing ~a legs together"
(if (malep user) "his" "her")
user-name))))))
(defmethod output-process-potty-text ((user ally-feral) padding (type (eql :wet)) (action (eql :desparate)) had-accident &key (stream *standard-output*))
(let ((user-name (name-of user)))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a is doing a potty dance like a 5 year old*" user-name)
(format nil "*~a hops from foot to foot*" user-name)
(format nil "*~a runs in circles like a dog needing to potty*" user-name)
(format nil "~a fidgets and squirms while pressing ~a legs together"
(if (malep user) "his" "her")
user-name))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql 'diaper)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(male (malep user))
(player-name (name-of (player-of *game*))))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a pauses and blushes as ~a flood ~a diapers like an infant*"
user-name
(if male
'("his" "he" "his")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name
(if male "his" "her"))
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her"))))))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a's face turns red as ~a leak everywhere*"
user-name
(if male "he" "she"))
(format nil "*~a leaves a puddle then starts waddling around with ~a legs spread apart leaving a trail like a 5 year old who didn't make it*"
user-name
(if male "he" "she"))
(format nil "*~a's diapers sprung a leak*"
user-name)
(format nil "~a: Aww, looks like ~a's diapers sprung a leak~%~%*~a blushes heavily at the embarrassing comment*"
player-name user-name user-name)))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql 'pullup)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(male (malep user)))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a pauses and blushes as ~a flood ~aself like an infant*"
user-name
(if male
'("his" "he" "him")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name
(if male
"his"
"her"))
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her"))))))))
(when (>= (getf (car had-accident) :wet-amount) 300)
(push (format nil "*The little pictures on the front of ~a's pullups fade showing everyone what ~a did*"
user-name
(if male "he" "she"))
j))
(a:random-elt j)))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a's face turns red as ~a leak everywhere*"
user-name
(if male "he" "she"))
(format nil "*~a leaves a puddle then starts waddling around with ~a legs spread apart leaving a trail like a 5 year old who didn't make it*"
user-name
(if male "he" "she"))
(format nil "*~a's pullups sprung a leak*"
user-name))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql 'closed-bottoms)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(player-name (name-of (player-of *game*)))
(hisher (if male "his" "her")))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(let ((a (list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a pauses and blushes as ~a flood ~aself like an infant*"
user-name
(if male
'("his" "he" "him")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name
hisher)
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her")))
(format nil "~a struggles to hold it in while pressing ~a legs together before wetting ~a pants"
user-name
hisher
hisher))))
a)))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a's on the nose with a newspaper*"
player-name
user-name
player-name
user-name)
,(format nil "~a: Heh, baby ~a made a puddle"
player-name
user-name)
,(format nil "~a's pants are ruined"
user-name)
,(format nil "~a: Heh, baby ~a wet ~a pants"
player-name
user-name
hisher)
,(format nil "~a: Bad ~a! Look what you did to your pants!"
player-name
user-name)
"A puddle appears on the floor"
"There goes the carpet"))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql nil)) (type (eql :wet)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(male (malep user))
(player-name (name-of (player-of *game*))))
(format stream "~a~%"
(let ((j (cond ((<= (getf (car had-accident) :wet-amount) 10)
(list (format nil "*~a gasps in horror as a little leaks out*" user-name)
(format nil "*~a's bladder just leaked a little*" user-name)))
((and (<= (getf (car had-accident) :wet-amount) 300) (> (getf (car had-accident) :wet-amount) 10))
(list (apply #'format nil "*~a gasps in horror as ~a floods ~aself, but manages to stop ~aself*"
user-name
(if male
'("he" "him" "him")
'("she" "her" "he")))))
((> (getf (car had-accident) :wet-amount) 300)
(let ((a (list (format nil "*After doing a potty dance like a 5 year old, ~a freezes and pee ~aself*"
user-name
(if male
"him"
"her"))
(apply #'format nil "*~a pauses and blushes as ~a flood ~aself like an infant*"
user-name
(if male
'("his" "he" "him")
'("her" "she" "her")))
(format nil "*~a cross ~a legs in a vain attempt to hold it in but fails miserably*"
user-name
(if male
"his"
"her"))
(apply #'format nil "~a gasps in embarrassment as ~a floods ~aself like a toddler"
user-name
(if male
'("he" "him")
'("she" "her")))
(apply #'format nil "~a struggles to hold it in while pressing ~a legs together until urine starts flowing down ~a legs"
user-name
(if male
'("his" "his")
'("her" "her"))))))
a)))))
(a:random-elt j)))
(when (and (car had-accident) (> (getf (car had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt `(,(format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a's on the nose with a newspaper*"
player-name
user-name
player-name
user-name)
,(format nil "~a: Heh, baby ~a made a puddle"
player-name
user-name)
"A puddle appears on the floor"
"There goes the carpet"))))))
(defmethod output-process-potty-text ((user ally-feral) padding (type (eql :mess)) (action (eql :potty-dance)) had-accident &key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a is doing a potty dance like a 5 year old*" (name-of user))
(apply #'format nil "*~a crosses ~a legs in an attempt to avoid messing ~aself*"
(name-of user)
(if (malep user)
'("his" "him")
'("her" "her")))
(format nil "*~a hunches down with ~a legs arched*" (name-of user) (if (malep user) "his" "her"))))))
(defmethod output-process-potty-text ((user ally-feral) padding (type (eql :mess)) (action (eql :desparate)) had-accident &key (stream *standard-output*))
(format stream "~a~%"
(a:random-elt (list (format nil "*~a is doing a potty dance like a 5 year old*" (name-of user))
(apply #'format nil "*~a crosses ~a legs in an attempt to avoid messing ~aself*"
(name-of user)
(if (malep user)
'("his" "him")
'("her" "her")))
(format nil "*~a hunches down with ~a legs arched*" (name-of user) (if (malep user) "his" "her"))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql 'diaper)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let* ((user-name (name-of user))
(male (malep user))
(hisher (if male "his" "her")))
(format stream "~{~a~}~%"
(let ((a (list (a:random-elt (list (format nil "*~a instinctively squats down~a and mess ~a diapers*"
user-name
(if male
"his" "her")
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
hisher)
""))
(apply #'format nil
"*The back of ~a's diaper expands as ~a accidentally messes ~aself*"
user-name
(if male
'("he" "him")
'("she" "her")))))))
(b (a:random-elt `(,(format nil "~%~%~a: Heh, baby ~a blorted ~a pamps."
(name-of (player-of *game*))
user-name
hisher)
nil))))
(when b (push b (cdr (last a))))))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "*~a*~%"
(a:random-elt `(,(format nil "~a face turns red as ~a mess falls out the leg guards"
user-name
hisher)
"Blowout!!!!"))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql 'pullup)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(format stream "~{~a~}~%"
(let ((a (list (a:random-elt (list (format nil "*~a instinctively squats down~a and mess ~a pullups*"
(name-of user)
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
(if (malep user)
"his" "her"))
"")
(if (malep user)
"his" "her"))
(apply #'format nil "*The back of ~a's pullups expands as ~a accidentally messes ~aself*"
(name-of user)
(if (malep user)
'("he" "him")
'("she" "her")))))))
(b (a:random-elt `(,(format nil "~%~%~a: Bad ~a!!! You know you're supposed to use the toilet like a big kid"
(name-of (player-of *game*))
(name-of user))
nil))))
(when b (push b (cdr (last a))))))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "*~a*~%"
(a:random-elt (list (format nil "~a face turns red as ~a mess falls out the leg guards"
(name-of user)
(if (malep user)
"his"
"her"))
(format nil "~a pullups leak all over the place" (name-of user)))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql 'closed-bottoms)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(player-name (name-of (player-of *game*)))
(hisher (if (malep user) "his" "her")))
(format stream "*~a*~%"
(a:random-elt (list (format nil "~a instinctively squats down~a and messes ~a pants"
user-name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
hisher)
"")
hisher)
(apply #'format nil "a lump forms at the seat of ~a's pants"
user-name))))
(when (and (cdr had-accident) (> (getf (cdr had-accident) :leak-amount) 0))
(format stream "~a~%"
(a:random-elt (list (format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a on the nose with a newspaper*"
player-name
user-name
player-name
user-name)
(format nil "*~a's pants are ruined*" user-name)
(format nil "*~a makes a mess on the floor*" user-name)
(format nil "~a: Heh, baby ~a messed ~a pants"
player-name
user-name
hisher)
(format nil "~a: Bad ~a! Look what you did to your pants!" player-name user-name)))))))
(defmethod output-process-potty-text ((user ally-feral) (padding (eql nil)) (type (eql :mess)) (action (eql :had-accident)) had-accident
&key (stream *standard-output*))
(let ((user-name (name-of user))
(player-name (name-of (player-of *game*))))
(format stream "*~a*~%"
(a:random-elt (list (format nil "Reaching the breaking point, ~a instinctively squats down~a and messes"
user-name
(if (s:memq (car (tail-of user)) '(:medium :large))
(format nil " with ~a tail up"
(if (malep user)
"his" "her"))
""))
(format nil "~a has an accident and makes a mess on the floor" (name-of user)))))
(let ((a (a:random-elt `(,(format nil "~a: Bad ~a! No going potty in the house!~%~%*~a baps ~a on the nose with a newspaper*"
player-name user-name player-name user-name)
nil))))
(when a
(format stream "~a~%" a)))))
(defmethod calculate-damage ((target base-character) (user base-character) (attack real))
"Figures out the damage dealt, we use the formula
@mathjax{\\left({\\left({2 \\times level \\over 5}+2\\right) \\times attackbase \\times {attack \\over defense} \\over 50}+2\\right) \\times {randomrange \\over 100}}
which is the same as Pokèmon
level is @code{(level-of @var{user})}
attackbase is @var{attack-base}
attack is @code{(calculate-stat @var{user} :attack)}
defense is @code{(calculate-stat @var{user} :defense)}
randomrange is @code{(random-from-range 85 100)}"
(round (u:$ (u:$ (u:$ (u:$ (u:$ (u:$ (u:$ 2 * (level-of user)) / 5) + 2) * attack * (u:$ (calculate-stat user :attack) / (calculate-stat target :defense)))
/ 50)
+ 2)
* (u:$ (random-from-range 85 100) / 100))))
(defmethod calculate-damage ((target base-character) (user base-character) (attack move))
"Figures out the damage dealt, we use the formula
@mathjax{\\left({\\left({2 \\times level \\over 5}+2\\right) \\times attackbase \\times {attack \\over defense} \\over 50}+2\\right) \\times {randomrange \\over 100}}
which is the same as Pokèmon
level is @code{(level-of @var{user})}
attackbase is @var{attack-base}
attack is @code{(calculate-stat @var{user} :attack)}
defense is @code{(calculate-stat @var{user} :defense)}
randomrange is @code{(random-from-range 85 100)}"
(let ((attack-element-types (element-types-of attack))
(target-element-types (element-types-of target))
(user-element-types (element-types-of user)))
(s:mvlet ((type-effectiveness magnitude (effective-type-effectiveness attack-element-types target-element-types)))
(round (u:$ (u:$ (u:$ (u:$ (u:$ (u:$ (u:$ 2 * (level-of user)) / 5) + 2) * (power-of attack) *
(u:$ (calculate-stat user :attack) / (calculate-stat target :defense)))
/ 50)
+ 2)
* (* (u:$ (random-from-range 85 100) / 100)
(if (eq type-effectiveness :no-effect)
0
(expt 2 magnitude))
(if (intersection user-element-types attack-element-types
:key (lambda (o)
(class-of (coerce-element-type o)))
:test 'subtypep)
1.5
1)))))))
(defmethod describe-diaper-wear-usage (item))
(defmethod describe-diaper-wear-usage ((item closed-bottoms))
(iter (for (a b) on (wear-wet-text-of item) by #'cddr)
(when (>= (sogginess-of item) a)
(f:fmt* t #\Space b #\Newline)
(finish)))
(iter (for (a b) on (wear-mess-text-of item) by #'cddr)
(when (>= (messiness-of item) a)
(f:fmt* t #\Space b #\Newline)
(finish)))
(iter (for (a b) on (bulge-text-of item) by #'cddr)
(when (>= (total-thickness item) a)
(f:fmt* t #\Space b #\Newline)
(finish))))
(defmethod describe-diaper-inventory-usage (item))
(defmethod describe-diaper-inventory-usage ((item closed-bottoms))
(iter (for (a b) on (wet-text-of item) by #'cddr)
(when (>= (sogginess-of item) a)
(f:fmt* t #\Space b #\Newline)
(finish)))
(iter (for (a b) on (mess-text-of item) by #'cddr)
(when (>= (messiness-of item) a)
(f:fmt* t #\Space b #\Newline)
(finish))))
(defmethod describe-diaper-usage (item))
(defmethod describe-diaper-usage ((item closed-bottoms))
(f:fmt t
"Sogginess: " (sogginess-of item) #\Newline
"Sogginess Capacity: " (sogginess-capacity-of item) #\Newline
"Messiness: " (messiness-of item) #\Newline
"Messiness Capacity: " (messiness-capacity-of item) #\Newline))
(defmethod process-battle-turn ((character npc) attack item reload selected-target)
(when (handle-status-effects character t)
(return-from process-battle-turn))
(cond ((process-battle-accident character attack item reload selected-target)
nil)
((iter (for j in (status-conditions character))
(when (blocks-turn-of j)
(leave t))))
((process-potty-dance character attack item reload selected-target) t)
((and (wield-of character)
(ammo-type-of (wield-of character))
(list-length->= 0 (ammo-of (wield-of character)))
(> (ammo-capacity-of (wield-of character)) 0)
(ammo-type-of (wield-of character))
(iter (for i in (inventory-of character))
(when (typep i (ammo-type-of (wield-of character)))
(leave t))))
(format t "~a reloaded ~a ~a"
(name-of character)
(if (malep character)
"his"
"her")
(name-of (wield-of character)))
(iter (with count = 0)
(for item in (inventory-of character))
(when (or (list-length-<= (ammo-capacity-of (wield-of character)) (ammo-of (wield-of character)))
(and (reload-count-of (wield-of character)) (>= count (reload-count-of (wield-of character)))))
(leave t))
(when (typep item (ammo-type-of (wield-of character)))
(incf count)
(push item (ammo-of (wield-of character)))
(a:deletef item (inventory-of character) :count 1))))
(t
(battle-script character (a:random-elt (if (typep character 'enemy)
(team-of *game*)
(enemies-of *battle*)))))))
(defmethod process-battle-turn ((character base-character) attack item reload selected-target)
(when (handle-status-effects character t)
(return-from process-battle-turn))
(cond ((process-battle-accident character attack item reload selected-target)
nil)
((iter (for j in (status-conditions character))
(when (blocks-turn-of j)
(leave t))))
((process-potty-dance character attack item reload selected-target) t)
(item
(format t "~a used ~a ~a on ~a~%"
(name-of character)
(if (malep character) "his" "her")
(name-of (nth item (inventory-of (player-of *game*))))
(name-of selected-target))
(use-item% item character :target selected-target))
(reload (format t "~a reloaded ~a ~a"
(name-of character)
(if (malep character)
"his"
"her")
(name-of (wield-of character)))
(iter (with count = 0)
(for item in (inventory-of (player-of *game*)))
(when (or
(list-length-<= (ammo-capacity-of (wield-of character))
(ammo-of (wield-of character)))
(and
(reload-count-of (wield-of character))
(>=
count
(reload-count-of (wield-of character)))))
(leave t))
(when (and (typep item reload) (typep item (ammo-type-of (wield-of character))))
(incf count)
(push item (ammo-of (wield-of character)))
(a:deletef item (inventory-of (player-of *game*)) :count 1))))
((eq attack t)
(if (wield-of character)
(progn (attack selected-target character (wield-of character))
(when (ammo-of (wield-of character))
(pop (ammo-of (wield-of character)))))
(attack selected-target character nil)))
(attack
(attack selected-target character (get-move attack character))
(decf (energy-of character) (energy-cost-of attack)))))
| 122,181 | Common Lisp | .lisp | 1,740 | 44.377586 | 297 | 0.445054 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 49677a988818b3b5e550950fc438102d6d6cb9635999040a57f603d54eac596b | 15,663 | [
-1
] |
15,664 | generic-functions.lisp | pouar_yadfa/core/libexec/generic-functions.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defgeneric cant-use-p (item user target action &rest keys &key &allow-other-keys)
(:documentation "Function that is used to determine if the player can use this item. Should return 2 values. A boolean indicating whether it can be used, and a plist. Current keys to the plist are :FORMAT-CONTROL and :FORMAT-ARGUMENTS which are used to override the usual dialog that shows up when the player selects an unusable item with their own message.")
(:method (item user target (action (eql nil)) &key &allow-other-keys)
(unless (compute-applicable-methods #'use-script (list item user target))
(values t `(:format-control "~s has no ~s method defined" :format-arguments (,item use-script)))))
(:method (item user target (action symbol) &key &allow-other-keys)
(unless (getf (special-actions-of item) action)
(values t `(:format-control "~s has no special action ~s set" :format-arguments (,item ,action))))))
(defgeneric process-battle-accident (base-character attack item reload selected-target)
(:method ((character base-character) attack item reload selected-target)
(declare (ignore attack item reload selected-target))
(when (or (>= (bladder/contents-of character) (bladder/maximum-limit-of character))
(>= (bowels/contents-of character) (bowels/maximum-limit-of character)))
(when (>= (bladder/contents-of character) (bladder/maximum-limit-of character))
(format t "~a lets out a quiet moan as ~a accidentally wets ~aself in battle~%"
(name-of character)
(if (malep character) "he" "she")
(if (malep character) "him" "her"))
(let ((wet (wet :wetter character)))
(when (> (getf wet :leak-amount) 0)
(f:fmt t "A puddle starts to form at " (name-of character) "'s feet" #\Newline)))
(set-status-condition 'yadfa-status-conditions:wetting character))
(when (>= (bladder/contents-of character) (bladder/maximum-limit-of character))
(format t "~a instinctively squats down as ~a accidentally messes ~aself in battle~%"
(name-of character)
(if (malep character) "he" "she")
(if (malep character) "him" "her"))
(let ((mess (mess :messer character)))
(when (> (getf mess :leak-amount) 0)
(f:fmt t (name-of character) " starts to make a mess on the floor" #\Newline)))
(set-status-condition 'yadfa-status-conditions:messing character))
t))
(:method ((character ally-no-potty-training) attack (item item) reload (selected-target base-character))
(declare (ignore attack item reload selected-target))
(when (>= (bladder/contents-of character) (bladder/need-to-potty-limit-of character))
(let ((wet-status (wet :wetter character)))
(format t "~a wet ~aself~%" (name-of character) (if (malep character) "him" "her"))
(when (> (getf wet-status :leak-amount) 0))
(format t "~a leaks and leaves puddles~%" (name-of character))))
(when (and (>= (bowels/contents-of character) (bowels/need-to-potty-limit-of character)))
(let ((mess-status (mess :messer character)))
(format t "~a messed ~aself~%" (name-of character) (if (malep character) "him" "her"))
(when (> (getf mess-status :leak-amount) 0))
(format t "~a has a blowout and leaves a mess~%" (name-of character)))))
(:method ((character enemy) attack (item item) reload (selected-target base-character))
(declare (ignore attack item reload selected-target))
(let* ((male (malep character))
(heshe (if male "he" "she"))
(himher (if male "him" "her"))
(name (name-of character))
(bladder/maximum-limit (bladder/maximum-limit-of character))
(bowels/maximum-limit (bowels/maximum-limit-of character))
(mudsport-limit (mudsport-limit-of character))
(watersport-limit (watersport-limit-of character))
(bladder/contents (bladder/contents-of character))
(bowels/contents (bowels/contents-of character)))
(cond ((or (>= bladder/contents bladder/maximum-limit)
(>= bowels/contents bowels/maximum-limit))
(when (>= bladder/contents bladder/maximum-limit)
(format t "~a lets out a quiet moan as ~a accidentally wets ~aself in battle~%"
name
heshe
himher)
(let ((wet (wet :wetter character)))
(when (> (getf wet :leak-amount) 0)
(f:fmt t "A puddle starts to form at " (name-of character) "'s feet" #\Newline)))
(set-status-condition 'yadfa-status-conditions:wetting character))
(when (>= bowels/contents bowels/maximum-limit)
(format t "~a involuntarily squats down as ~a accidentally messes ~aself in battle~%"
name
heshe
himher)
(let ((mess (mess :messer character)))
(when (> (getf mess :leak-amount) 0)
(f:fmt t (name-of character) " starts to make a mess on the floor" #\Newline)))
(set-status-condition 'yadfa-status-conditions:messing character))
t)
((and watersport-limit
(<= (- bladder/maximum-limit (bladder/contents-of character)) watersport-limit)
(< (random (watersport-chance-of character)) 1))
(let ((a (make-instance 'yadfa-moves:watersport)))
(attack (player-of *game*) character a))
t)
((and mudsport-limit
(<= (- bowels/maximum-limit (bowels/contents-of character)) mudsport-limit)
(< (random (mudsport-chance-of character)) 1))
(let ((a (make-instance 'yadfa-moves:mudsport)))
(attack (player-of *game*) character a))
t))))
(:method ((character ally-rebel-potty-training) attack (item item) reload (selected-target ally-rebel-potty-training))
(declare (ignore item reload))
(cond ((and (not (typep (get-move attack character)
'yadfa-moves:watersport))
(>= (bladder/contents-of character) (bladder/need-to-potty-limit-of character)))
(let ((a (make-instance 'yadfa-moves:watersport)))
(format t "~a: YOU DON'T HAVE ENOUGH BADGES TO TRAIN ME!~%~%" (name-of character))
(format t "*~a uses ~a instead*~%~%" (name-of character) (name-of a))
(attack selected-target character a))
t)
((and (not (typep (get-move attack character) 'yadfa-moves:mudsport))
(>= (bowels/contents-of character) (bowels/need-to-potty-limit-of character)))
(let ((a (make-instance 'yadfa-moves:mudsport)))
(format t "~a: YOU DON'T HAVE ENOUGH BADGES TO TRAIN ME!~%~%" (name-of character))
(format t "*~a uses ~a instead*~%~%" (name-of character) (name-of a))
(attack selected-target character a))
t))))
(defgeneric use-script (item user target)
(:documentation "Function that runs when @var{USER} uses @var{ITEM} on @var{TARGET}. @var{ITEM} is the instance of the item and @var{USER} and @var{TARGET} are instances of base-character")
(:method :before ((item damage-item) (user base-character) (target base-character))
(decf (health-of target) (calculate-damage target user (use-power-of item))))
(:method :after ((item damage-item) (user base-character) (target base-character))
(format t "~a received ~a damage~%" (name-of target) (calculate-damage target user (use-power-of item))))
(:method ((item damage-item) (user base-character) (target base-character))))
(defgeneric wield-script (item user)
(:documentation "Function that runs when @var{USER} is wielding @var{ITEM}. @var{ITEM} is the instance of the item and @var{USER} is the user you're using it on.")
(:method ((item item) (user base-character))))
(defgeneric wear-script (item user)
(:documentation "Function that runs when @var{USER} is wearing @var{ITEM}. @var{ITEM} is the instance of the item and @var{USER} is the user you're using it on.")
(:method ((item item) (user base-character))))
(defgeneric resolve-enemy-spawn-list (element)
(:documentation "returns the enemy-spawn-list in the hash table (enemy-spawn-list-of *game*) if a symbol or itself if a list")
(:method ((element symbol)) (gethash element (enemy-spawn-list-of *game*)))
(:method ((element list)) element)
(:method ((element zone)) (resolve-enemy-spawn-list (enemy-spawn-list-of element))))
(defgeneric resolve-team-npc-spawn-list (element)
(:documentation "returns the team-npc-spawn-list in the hash table (team-npc-spawn-list-of *game*) if a symbol or itself if a list")
(:method ((element symbol)) (gethash element (team-npc-spawn-list-of *game*)))
(:method ((element list)) element)
(:method ((element zone)) (resolve-team-npc-spawn-list (team-npc-spawn-list-of element))))
(defgeneric attack (target user attack)
(:documentation #.(f:fmt nil "Method run when attacking. @var{ATTACK} is @code{NIL} when it is the default attack without any weapons. is an instance of " (ref move :class) " when it is an attack using a move and is an instance of " (ref item :class) " when that instance is being used as a weapon"))
(:method ((target base-character) (user base-character) (attack move)))
(:method ((target base-character) (user base-character) (attack item)))
(:method :before ((target base-character) (user base-character) (attack damage-move))
(decf (health-of target) (calculate-damage target user attack)))
(:method :around ((target base-character) (user base-character) (item weapon))
(apply #'format t
(if (first (ammo-of item))
(list "~a fires ~a ~a at ~a~%"
(name-of user)
(if (malep user) "his" "her")
(name-of item)
(name-of target))
(list "~a whacks ~a ~a at ~a~%"
(name-of user)
(if (malep user) "his" "her")
(name-of item)
(name-of target)))))
(:method :before ((target base-character) (user base-character) (item weapon))
(decf (health-of target) (calculate-damage target user
(if (first (ammo-of item))
(ammo-power-of (first (ammo-of item)))
(power-of item)))))
(:method :before ((target base-character) (user base-character) (item damage-wield))
(decf (health-of target) (calculate-damage target user (power-of item))))
(:method :before ((target base-character) (user base-character) (attack move))
(format t "~a used ~a~%" (name-of user) (name-of attack)))
(:method :before ((target base-character) (user base-character) (attack clear-status-mixin))
(deletef-status-conditions (statuses-cleared-of attack) target
:test (lambda (o e) (typep e o))))
(:method :after ((target base-character) (user base-character) (attack damage-move))
(f:fmt t (name-of target) " received " (calculate-damage target user attack) " damage" #\Newline
(:esc (case (effective-type-effectiveness (element-types-of attack) (element-types-of target))
(:not-very-effective (:fmt "It's not very effective" #\Newline))
(:super-effective (:fmt "It's super effective" #\Newline))
(:no-effect (:fmt "It had no effect" #\Newline))))))
(:method :after ((target base-character) (user base-character) (item weapon))
(f:fmt t (name-of target) " received " (calculate-damage target user
(if (first (ammo-of item))
(ammo-power-of (first (ammo-of item)))
(power-of item)))
" damage" #\Newline))
(:method :after ((target base-character) (user base-character) (item damage-wield))
(format t "~a received ~a damage~%" (name-of target) (calculate-damage target user (power-of item))))
(:method ((target base-character) (user base-character) (attack null))
(declare (ignore attack))
(let ((a (calculate-damage target user (default-attack-power-of user))))
(format t "~a attacks ~a~%" (name-of user) (name-of target))
(decf (health-of target) a)
(format t "~a received ~a damage~%" (name-of target) a)
a))
(:method ((target base-character) (user base-character) (item item))
(declare (ignorable target user item))
(format t "~a whacks ~a with ~a ~a~%"
(name-of user)
(name-of target)
(if (malep user) "his" "her")
(name-of item))
(format t "It had no effect~%"))
(:method ((target base-character) (user base-character) (item damage-wield))
(declare (ignorable target user item))
(format t "~a whacks ~a with ~a ~a~%"
(name-of user)
(name-of target)
(if (malep user) "his" "her")
(name-of item))))
(defgeneric battle-script (npc target)
(:documentation #.(f:fmt nil "function that runs when it's time for @var{NPC} to attack @var{TARGET} and what @var{NPC} does to attack. Basically the \"AI\""))
(:method ((self npc) (target base-character))
(let ((moves-with-health
(iter (for i in (moves-of self))
(when (and (>= (energy-of self) (energy-cost-of i)) (typep i 'health-inc-move))
(collect i))))
(moves-can-use (iter (for i in (moves-of self))
(when (>= (energy-of self) (energy-cost-of i))
(collect i))))
(move-to-use nil))
(cond
((and (<= (health-of self) (/ (calculate-stat self :health) 4)) moves-with-health)
(setf move-to-use (a:random-elt moves-with-health))
(attack target self move-to-use))
(t
(when moves-can-use
(setf move-to-use (a:random-elt moves-can-use)))
(cond ((and moves-can-use (= (random 2) 0))
(attack target self move-to-use)
(decf (energy-of self) (energy-cost-of move-to-use)))
((wield-of self)
(attack target self (wield-of self)))
(t
(attack target self nil))))))))
(defgeneric condition-script (user condition battle)
(:documentation
#.(f:fmt nil "Function that runs at the beginning of each turn" #\Newline #\Newline
"@var{USER} is the character who has the @var{CONDITION}." #\Newline #\Newline
"@var{CONDITION} is a " (ref status-condition :class) #\Newline #\Newline
" @var{BATTLE} is whether the condition happens in battle or not" #\Newline #\Newline
"Dumb limitation of the API: Game assumes that characters don't faint outside of battle" #\Newline #\Newline
"This is because most of the dialog doesn't make sense when the character is fainted," #\Newline #\Newline
"such as talking, walking around, and doing a potty dance and acting embarrassed when having an accident." #\Newline #\Newline
"Fixing this made the code way too complicated."))
(:method ((user base-character) (condition status-condition) battle)))
(defgeneric effective-status-conditions (status-condition user)
(:method ((status-condition status-condition) (user base-character))
(gethash user (%status-conditions-of *battle*)))
(:method ((status-condition persistent-status-condition) (user base-character))
(%status-conditions-of user)))
(defgeneric (setf effective-status-conditions) (new-value status-condition user)
(:method (new-value (status-condition status-condition) (user base-character))
(setf (gethash user (%status-conditions-of *battle*)) new-value))
(:method (new-value (status-condition persistent-status-condition) (user base-character))
(setf new-value (%status-conditions-of user))))
(defgeneric toggle-onesie% (onesie))
(defgeneric toggle-onesie (onesie clothes user))
;;; Wish the API I made for this wasn't so complex, but I wasn't sure how to make it simple and still retain the functionality
(defgeneric get-babyish-padding (user))
(defgeneric get-process-potty-action-type (user type had-accident)
(:method ((user ally-last-minute-potty-training) (type (eql :wet)) had-accident)
(cond ((and
(car had-accident)
(> (getf (car had-accident) :wet-amount) 0))
:had-accident)
((>=
(bladder/contents-of user)
(bladder/potty-desperate-limit-of user))
:desparate)
((>= (bladder/contents-of user) (bladder/potty-dance-limit-of user))
:potty-dance)))
(:method ((user ally-last-minute-potty-training) (type (eql :mess)) had-accident)
(cond ((and
(cdr had-accident)
(> (getf (cdr had-accident) :mess-amount) 0))
:had-accident)
((>=
(bowels/contents-of user)
(bowels/potty-desperate-limit-of user))
:desparate)
((>= (bowels/contents-of user) (bowels/potty-dance-limit-of user))
:potty-dance)))
(:method ((user ally) (type (eql :wet)) had-accident)
(when (and (car had-accident) (> (getf (car had-accident) :wet-amount) 0))
:had-accident))
(:method ((user ally) (type (eql :mess)) had-accident)
(when (and (cdr had-accident) (> (getf (cdr had-accident) :mess-amount) 0))
:had-accident))
(:method ((user player) (type (eql :wet)) had-accident)
(cond ((and (car had-accident) (> (getf (car had-accident) :wet-amount) 0))
:had-accident)
((>= (bladder/contents-of user) (bladder/potty-dance-limit-of user))
:potty-dance)
((>= (bladder/contents-of user) (bladder/need-to-potty-limit-of user))
:need-to-potty)))
(:method ((user player) (type (eql :mess)) had-accident)
(cond ((and (cdr had-accident) (> (getf (cdr had-accident) :mess-amount) 0))
:had-accident)
((>= (bowels/contents-of user) (bowels/potty-dance-limit-of user))
:potty-dance)
((>= (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
:need-to-potty))))
(defgeneric output-process-potty-text (user padding type action had-accident &key stream))
(defgeneric coerce-element-type (element)
(:method ((element-type (eql nil)))
nil)
(:method ((element-type symbol))
(or (gethash element-type *element-types*)
(setf (gethash element-type *element-types*) (make-instance element-type))))
(:method ((element-type element-type))
element-type))
(defgeneric type-match (source target)
(:documentation "Used to determine the effectiveness of element type @var{SOURCE} against element type @var{TARGET}. Valid return values are @code{NIL}, @code{:SUPER-EFFECTIVE}, @code{:NOT-VERY-EFFECTIVE}, and @code{:NO-EFFECT}, which represent the effectiveness")
(:method (source target) (type-match (coerce-element-type source) (coerce-element-type target)))
(:method ((source element-type) (target element-type)) nil)
(:method ((source (eql nil)) target)
nil)
(:method (source (target (eql nil)))
nil))
(defgeneric bladder/fill-rate (user)
(:method ((user bladder-character))
(* (bladder/fill-rate-of user) (bladder/fill-rate/multiplier-of user)))
(:method ((user base-character))
0))
(defgeneric bowels/fill-rate (user)
(:method ((user bowels-character))
(* (bowels/fill-rate-of user) (bowels/fill-rate/multiplier-of user)))
(:method ((user base-character))
0))
(defgeneric fill-bladder (user &key &allow-other-keys)
(:method ((user bladder-character) &key (times 1) &allow-other-keys)
(iter (for i from 1 to times)
(with multiplier = (bladder/fill-rate/multiplier-of user))
(with fill-rate = (bladder/fill-rate-of user))
(with cooldown = (bladder/fill-rate/cooldown-of user))
(with bladder = (bladder/contents-of user))
(incf bladder (* fill-rate multiplier))
(cond ((> (- multiplier cooldown) 1) (decf multiplier cooldown))
((< (+ multiplier cooldown) 1) (incf multiplier cooldown))
(t (setf multiplier 1)))
(finally (setf (bladder/contents-of user) bladder
(bladder/fill-rate/multiplier-of user) multiplier))))
(:method ((user base-character) &key &allow-other-keys)
0))
(defgeneric fill-bowels (user &key &allow-other-keys)
(:method ((user bowels-character) &key (times 1) &allow-other-keys)
(iter (for i from 1 to times)
(with multiplier = (bowels/fill-rate/multiplier-of user))
(with fill-rate = (bowels/fill-rate-of user))
(with cooldown = (bowels/fill-rate/cooldown-of user))
(with bowels = (bowels/contents-of user))
(incf bowels (* fill-rate multiplier))
(cond ((> (- multiplier cooldown) 1) (decf multiplier cooldown))
((< (+ multiplier cooldown) 1) (incf multiplier cooldown))
(t (setf multiplier 1)))
(finally (setf (bowels/contents-of user) bowels
(bowels/fill-rate/multiplier-of user) multiplier))))
(:method ((user base-character) &key &allow-other-keys)
0))
(defgeneric fart (user)
(:method ((user bowels-character) &aux (fart-count (fart-count-of user)) (bowels (bowels/contents-of user))
(maximum-limit (bowels/maximum-limit-of user)) (rate (bowels/fill-rate-of user)))
(cond ((< (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
:cant-go)
((= 0 (random (expt 2 fart-count)))
(decf (bowels/contents-of user)
(cond ((>= bowels (/ maximum-limit 2))
(/ maximum-limit (expt 2 (+ 2 fart-count))))
((> (- bowels (* (/ 100 (expt 2 fart-count)) rate)) 0)
(* (/ 100 (expt 2 fart-count)) rate))
(t bowels)))
:success)
(t (values :fail (mess :messer user))))))
(defgeneric fart-result-text (user result mess &key stream)
(:method ((user bowels-character) (result (eql :cant-go)) mess &key (stream *standard-output*))
(f:fmt stream (name-of user) " Doesn't have to go" #\Newline))
(:method ((user bowels-character) (result (eql :success)) mess &key (stream *standard-output*))
(f:fmt stream (name-of user) " farts to relieve the pressure" #\Newline))
(:method ((user bowels-character) (result (eql :failure)) mess &key (stream *standard-output*))
(f:fmt stream (name-of user) "tries to fart to relive the pressure then gets a look of horror on " (if (malep user) "his" "her") " face as "
(if (malep user) "he" "she") " ends up messing " (if (malep user) "himself" "herself") " instead" #\Newline)))
(defgeneric process-potty (character battle)
(:method ((user base-character) battle))
(:method ((user potty-character) (battle null))
(let ((time-difference (- (time-of *game*) (last-process-potty-time-of user))))
(fill-bladder user :times time-difference)
(fill-bowels user :times time-difference))
(setf (last-process-potty-time-of user) (time-of *game*))
(let ((had-accident (if (typep user 'potty-trained-team-member)
(cons (when (>= (bladder/contents-of user) (bladder/maximum-limit-of user))
(wet :accident t :wetter user))
(when (>= (bowels/contents-of user) (bowels/maximum-limit-of user))
(mess :accident t :messer user)))
(cons (when (>= (bladder/contents-of user) (bladder/need-to-potty-limit-of user))
(wet :wetter user))
(when (>= (bowels/contents-of user) (bowels/need-to-potty-limit-of user))
(mess :messer user))))))
(iter (for i in '(:wet :mess))
(output-process-potty-text user
(get-babyish-padding user)
i
(get-process-potty-action-type user
i
had-accident)
had-accident))
(multiple-value-bind
(value key)
(pop-from-expansion user had-accident)
(when (eq key :wet/mess)
(setf had-accident value)))
(funcall (coerce (potty-trigger-of (get-zone (position-of (player-of *game*))))
'function)
had-accident user)
had-accident))
(:method ((character potty-character) (battle (eql t)))
(let ((time-passed (- (time-of *game*) (last-process-potty-time-of character))))
(when (> (health-of character) 0)
(fill-bladder character :times time-passed)
(fill-bowels character :times time-passed)))
(setf (last-process-potty-time-of character) (time-of *game*))))
| 25,432 | Common Lisp | .lisp | 409 | 51.266504 | 361 | 0.609424 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | ffcc4fdd61751b63b32928890f9ea9d97e699d6ecc2f6d86c9a7a3827b0ead44 | 15,664 | [
-1
] |
15,665 | game.lisp | pouar_yadfa/core/libexec/game.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(unless *game* (setf *game* (make-instance 'game)))
| 153 | Common Lisp | .lisp | 3 | 50 | 80 | 0.646667 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | fdb21646cd047b91fd3d588b8105d0a0571d66ea0718e7cc5dd57ed7c8521fb9 | 15,665 | [
-1
] |
15,666 | macros.lisp | pouar_yadfa/core/libexec/macros.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa)
(defmacro handle-query (bindings (stream &rest forms) &body body)
"Macro used to prompt the user for input using restarts when the user enters the wrong input. @var{FORMS} is a list containing the lambda list @code{(case (&optional set-value) &key (error-text \"\") (prompt-text \"\"))}"
(a:with-gensyms (tag block)
`(block ,block
(tagbody
,tag
(let* ,bindings
,@(iter (for form in forms)
(collect (a:with-gensyms (value)
(destructuring-bind (case (&optional set-value) &key (error-text "") (prompt-text ""))
form
`(restart-case (when ,case
(error 'invalid-user-input :format-control ,error-text))
,@(when set-value
`((use-value (,value)
:interactive (lambda ()
(if clim:*application-frame*
;; For some reason McCLIM does not echo when using CL:READ on the
;; Listener's standard input until CL:READ returns. CLIM:ACCEPT otoh
;; actually does, so let's use that with McCLIM instead.
(list (eval (clim:accept 'clim:expression
:stream ,stream
:prompt ,prompt-text)))
(progn
(format ,stream "~s: " ,prompt-text)
(list (eval (read ,stream))))))
:report ,prompt-text
(setf ,set-value ,value)
(go ,tag)))))))))
(return-from ,block (progn ,@body)))))))
(defmacro defmatch (source target &body return)
(flet ((arg (arg sym)
(typecase arg
((and list (not null)) arg)
(null (a:make-gensym sym))
((eql t) `(,(a:make-gensym sym) element-type))
((and symbol (not keyword)) `(,(a:make-gensym sym) ,arg))
(t (error 'simple-error :format-control "Invalid argument ~s" :format-arguments `(,arg))))))
`(defmethod type-match (,(arg source 'source)
,(arg target 'target))
,@return)))
(defmacro define-type (name (&rest superclasses) (&rest slot-specifiers) &rest class-options)
`(progn (s:eval-always (defclass ,name (,@superclasses element-type) ,slot-specifiers
(:metaclass element-type-class)
,@(iter (for class-option in class-options)
(unless (s:memq (car class-option) '(:super-effective :not-very-effective :no-effect :element-name))
(collect class-option)))))
(or (gethash ',name *element-types*)
(setf (gethash ',name *element-types*) (make-instance ',name)))
,@(iter (for class-option in class-options)
(let ((option-name (car class-option)))
(when (s:memq option-name '(:super-effective :not-very-effective :no-effect))
(appending (iter (for target in (cdr class-option))
(collect `(s:eval-always (unless (find-class ',target nil)
(defclass ,target (element-type) () (:metaclass element-type-class)))))
(collect `(defmatch ,name ,target ,option-name)))))
(collect `(setf (slot-value (find-class ',name) 'name) ,(if (eq option-name :element-name)
(second class-option)
nil)))))
(find-class ',name)))
(defmacro accept-with-effective-frame (&body body)
`(cond
(c:*application-frame*
,@body)
(t (clim:run-frame-top-level (clim:make-application-frame 'yadfa-clim::emacs-frame
:width 1024 :height 768
:emacs-frame-lambda (lambda (frame)
(let ((*query-io* (clim:frame-query-io frame)))
,@body)))))))
(defmacro with-effective-frame (&body body)
`(cond
(c:*application-frame*
,@body)
(t (clim:run-frame-top-level (clim:make-application-frame 'yadfa-clim::emacs-frame
:width 1024 :height 768
:emacs-frame-lambda (lambda (frame)
(let ((*query-io* (clim:frame-query-io frame)))
,@body
(loop until (eql #\Return (c:read-gesture
:stream *query-io*))))))))))
(defmacro present-with-effective-frame (&body body)
`(cond
(c:*application-frame*
(push (clim:updating-output (*query-io*)
,@body)
yadfa-clim::*records*))
(t (clim:run-frame-top-level (clim:make-application-frame 'yadfa-clim::emacs-frame
:width 1024 :height 768
:emacs-frame-lambda (lambda (frame)
(let ((*query-io* (clim:frame-query-io frame)))
,@body
(loop until (eql #\Return (c:read-gesture
:stream *query-io*))))))))))
(defmacro updating-present-with-effective-frame
((stream
&key (unique-id nil unique-id-supplied-p) (id-test nil id-test-supplied-p)
(cache-value nil cache-value-supplied-p)
(cache-test nil cache-test-supplied-p)
(fixed-position nil fixed-position-supplied-p)
(all-new nil all-new-supplied-p)
(parent-cache nil parent-cache-supplied-p)
(record-type nil record-type-supplied-p)
&allow-other-keys) &body body)
`(cond
(c:*application-frame*
(push (clim:updating-output (,stream ,@(and unique-id-supplied-p `(:unique-id ,unique-id)) ,@(and id-test-supplied-p `(:id-test ,id-test))
,@(and cache-value-supplied-p `(:cache-value ,cache-value)) ,@(and cache-test-supplied-p `(:cache-test ,cache-test))
,@(and fixed-position-supplied-p `(:fixed-position ,fixed-position)) ,@(and all-new-supplied-p `(:all-new ,all-new))
,@(and parent-cache-supplied-p `(:parent-cache ,parent-cache))
,@(and record-type-supplied-p (and `(:record-type ,record-type))))
,@body)
yadfa-clim::*records*))
(t (clim:run-frame-top-level (clim:make-application-frame 'yadfa-clim::emacs-frame
:width 1024 :height 768
:emacs-frame-lambda (lambda (frame)
(let ((*query-io* (clim:frame-query-io frame)))
,@body
(loop until (eql #\Return (c:read-gesture
:stream *query-io*))))))))))
(defmacro defevent (event-id &rest args)
`(progn
(setf (gethash ',event-id *events*) (make-instance 'event :id ',event-id ,@args))
',event-id))
(defmacro defonesie (base-class direct-superclasses &body body)
#.(format nil "macro that generates the classes and methods of the onesie used to open and close the snaps of them. method used to toggle the onesie is @code{TOGGLE-ONESIE}. @var{BASE-CLASS} is the name of the class you want to give the onesie.@var{DIRECT-SUPERCLASSES} are the direct superclasses of @var{BASE-CLASS} (obviously). @var{BODY} is the slot specifier and class options of @var{BASE-CLASS}
~a."
(xref yadfa-bin:toggle-onesie :function))
`(progn
(defclass ,(a:format-symbol (symbol-package base-class) "~a" (symbol-name base-class))
,(if (iter (for i in direct-superclasses)
(when (subtypep i 'yadfa:onesie)
(leave t)))
direct-superclasses
`(yadfa:onesie ,@direct-superclasses))
,@body)
(defclass ,(a:format-symbol (symbol-package base-class) "~a/OPENED" (symbol-name base-class))
(,(a:format-symbol (symbol-package base-class) "~a" (symbol-name base-class))
yadfa:onesie/opened) ())
(defclass ,(a:format-symbol (symbol-package base-class) "~a/CLOSED" (symbol-name base-class))
(,(a:format-symbol (symbol-package base-class) "~a" (symbol-name base-class))
yadfa:onesie/closed) ())
(export '(,(a:format-symbol (symbol-package base-class) "~a" (symbol-name base-class))
,(a:format-symbol (symbol-package base-class) "~a/OPENED" (symbol-name base-class))
,(a:format-symbol (symbol-package base-class) (format nil "~a/CLOSED" (symbol-name base-class))))
,(symbol-package base-class))
(defmethod toggle-onesie% ((self ,(a:format-symbol (symbol-package base-class) "~a/OPENED" (symbol-name base-class))))
(change-class self ',(a:format-symbol (symbol-package base-class) "~a/CLOSED" (symbol-name base-class))))
(defmethod toggle-onesie% ((self ,(a:format-symbol (symbol-package base-class) "~a/CLOSED" (symbol-name base-class))))
(change-class self ',(a:format-symbol (symbol-package base-class) "~a/OPENED" (symbol-name base-class))))))
(defmacro ensure-zone (position &body body)
#.(format nil "defines the classes of the zones and adds an instance of them to the game's map hash table if it's not already there
~a, ~a, ~a."
(xref defzone :macro) (xref defzone* :macro) (xref ensure-zone* :macro))
(declare (type list position))
#-(or sbcl ccl) (check-type position list)
`(progn (unless (get-zone ',position)
(setf (get-zone ',position)
(make-instance 'zone ,@body)))
(export ',(fourth position) ',(symbol-package (fourth position)))
(get-zone ',position)))
(defmacro defzone (position &body body)
#.(format nil "defines the classes of the zones and adds an instance of them to the game's map hash table. Intended to be used to replace existing zones in more intrusive mods. Best to wrap this in an event and run @code{TRIGGER-EVENT} so it doesn't overwrite the zone every time this piece of code is loaded
~a, ~a, ~a, ~a."
(xref defzone* :macro) (xref ensure-zone :macro) (xref ensure-zone* :macro) (xref trigger-event :function))
(declare (type list position))
#-(or sbcl ccl)
(check-type position list)
`(progn
(setf (get-zone ',position)
(make-instance 'zone ,@body))
(export ',(fourth position) ',(symbol-package (fourth position)))
(get-zone ',position)))
(defmacro ensure-zone* (position &body body)
#.(format nil "Like @code{ENSURE-ZONE}, but position is a quoted list
~a, ~a, ~a."
(xref defzone :macro) (xref defzone* :macro) (xref ensure-zone :macro))
(declare (type list position))
#-(or sbcl ccl)
(check-type position list)
`(progn (unless (get-zone ,position)
(setf (get-zone ,position)
(make-instance 'zone ,@body)))
(export ',(fourth position) ',(symbol-package (fourth position)))
(get-zone ,position)))
(defmacro defzone* (position &body body)
#.(format nil "Like @code{DEFZONE}, but position is a quoted list
~a, ~a, ~a."
(xref defzone :macro) (xref ensure-zone :macro) (xref ensure-zone* :macro))
(declare (type list position))
#-(or sbcl ccl)
(check-type position list)
`(progn
(setf (get-zone ,position)
(make-instance 'zone ,@body))
(export ',(fourth position) ',(symbol-package (fourth position)))
(get-zone ,position)))
(defmacro make-pocket-zone (position &body body)
"defines the classes of the zones and adds an instance of them to the game's map hash table if it's not already there"
(declare (type list position))
#-(or sbcl ccl)
(check-type position list)
`(setf (get-zone '(,@position :pocket-map))
(make-instance 'zone ,@body)))
| 13,931 | Common Lisp | .lisp | 205 | 45.234146 | 403 | 0.490999 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | da9b78a6397684e418eec80be67777ca9219a5602385733d2114c60a057b3797 | 15,666 | [
-1
] |
15,667 | init.lisp | pouar_yadfa/core/libexec/init.lisp | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
(in-package :yadfa-clim)
(defclass stat-view (c:view) ())
(defconstant +stat-view+ (make-instance 'stat-view))
(in-package :yadfa)
(s:eval-always
(defmacro ref (symbol type)
(if (asdf:component-loaded-p "yadfa/docs")
(let* ((package-name (uiop:symbol-call '#:net.didierverna.declt '#:escape (package-name (symbol-package symbol))))
(symbol-name (uiop:symbol-call '#:net.didierverna.declt '#:escape symbol))
(external (if (eq (nth-value 1 symbol) :external)
2 1)))
(f:fmt nil "@ref{"
(uiop:symbol-call '#:net.didierverna.declt '#:escape-anchor
(uiop:symbol-call '#:net.didierverna.declt '#:anchor-name
(uiop:symbol-call '#:net.didierverna.declt
(make-symbol (string-upcase (format nil "make-~a-definition" type)))
:symbol symbol)))
",@code{" package-name (:times "∶" external) symbol-name "},@code{" package-name (:times ":" external) symbol-name "}}"))
(let ((*package* (find-package :cl)))
(format nil "~s" symbol))))
(defmacro xref (symbol type)
(if (asdf:component-loaded-p "yadfa/docs")
(let* ((package-name (uiop:symbol-call '#:net.didierverna.declt '#:escape (package-name (symbol-package symbol))))
(symbol-name (uiop:symbol-call '#:net.didierverna.declt '#:escape symbol))
(external (if (eq (nth-value 1 symbol) :external)
2 1)))
(f:fmt nil "@xref{"
(uiop:symbol-call '#:net.didierverna.declt '#:escape-anchor
(uiop:symbol-call '#:net.didierverna.declt '#:anchor-name
(uiop:symbol-call '#:net.didierverna.declt
(make-symbol (string-upcase (format nil "make-~a-definition" type)))
:symbol symbol)))
",@code{" package-name (:times "∶" external) symbol-name "},@code{" package-name (:times ":" external) symbol-name "}}"))
(let ((*package* (find-package :cl)))
(format nil "See ~s" symbol)))))
(g:define-global-var *events* (make-hash-table :test #'equal :size 100))
(g:define-global-var yadfa-clim::*records* ())
(g:define-global-var *battle* nil)
(g:define-global-var *mod-registry* (make-hash-table :test #'equal))
(g:define-global-var *pattern-cache* (make-hash-table :test #'equal))
(g:define-global-var *mods* '())
(g:define-global-var *cheat-hooks* '()
"Put functions that sets crap to fixed values here. Intended to be used similar to the feature in Cheat Engine used to set variables to a constant value, although will probably run less frequently and is generally easier to use since it doesn't involve working with memory addresses")
(g:define-global-var *game* nil
"contains the information to be serialized when saving and loading a game")
(g:define-global-var *battle-packages* '(:yadfa-battle :yadfa-battle-commands)
"contains the package designators for the exported symbols to be used as commands in battle")
(g:define-global-var *world-packages* '(:yadfa-world :yadfa-world-commands)
"contains the package designators for the exported symbols to be used as commands outside of battle")
(g:define-global-var *command-packages* '(:yadfa-bin)
"contains the package designators for the exported symbols to be used as commands")
(g:define-global-var *last-rng-update* 0)
(g:define-global-var *immutable* nil)
(g:define-global-var *element-types* (make-hash-table :test 'eq)
"Hash table containing preinitialized element types. Used instead of defining a bunch of constants.")
| 4,021 | Common Lisp | .lisp | 56 | 57.482143 | 286 | 0.597324 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 4f063a6b397c5908b3c4e0cbb200d74f2008f07e9c29fd6c43122ee699e731ce | 15,667 | [
-1
] |
15,668 | package.lisp | pouar_yadfa/mods/example/package.lisp | (in-package :cl-user)
(uiop:define-package :yadfa.furaffinity.pouar.myawesomemod
(:use :cl)
(:export :celebrate)
(:local-nicknames (:y :yadfa) (:yz :yadfa-zones)))
| 170 | Common Lisp | .lisp | 5 | 31.8 | 58 | 0.709091 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | c876e3c35dac1b80863232013a56c994f4a5f23556bdc5faecf9ae11efb15f7a | 15,668 | [
-1
] |
15,669 | example.lisp | pouar_yadfa/mods/example/example.lisp | (in-package #:yadfa.furaffinity.pouar.myawesomemod)
(defun test () (print 1))
(y:defevent test-4
:lambda (lambda (self)
(declare (ignore self))
(format t "Print some text~%")))
(y:defevent test-5
:lambda (lambda (self)
(declare (ignore self))
(setf
(getf (y:actions-of (getf (y:props-of (y:get-zone '(0 0 0 yz:debug-map))) :shop)) :mod)
(y:make-action
:documentation "This Mod Works"
:lambda (lambda
(prop &rest keys &key &allow-other-keys)
(declare (ignore prop keys))
(format t "Hello World~%"))))))
(y:trigger-event 'test-5)
(pushnew 'test-4 (y:events-of (y:get-zone '(0 0 -1 yz:debug-map))))
(defclass celebrate (y:move) ()
(:default-initargs
:description "The Pokémon congratulates you on your special day!"
:name "Celebrate"
:attack '(lambda (target user self)
(let ((a (y:calculate-damage target user (y:power-of self))))
(format t "~a used ~a~%" (y:name-of user) (y:name-of self))
(format t "Congratulations ~a!~%" (y:name-of (y:player-of *game*)))))))
| 1,196 | Common Lisp | .lisp | 27 | 34.62963 | 100 | 0.557742 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 15b1d94233f217a9b39474b35b5982c7ab2efb9ffab4d0f44dfd080fb7364462 | 15,669 | [
-1
] |
15,670 | yadfa-tests.asd | pouar_yadfa/yadfa-tests.asd | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "asdf-user"; coding: utf-8-unix; -*-
(asdf:defsystem :yadfa-tests
:depends-on (:yadfa :fiveam)
:defsystem-depends-on (:fiveam-asdf)
:class :fiveam-tester-system
:test-package :yadfa-tests
:test-names (#:all-tests)
:components ((:module "t" :serial t
:components ((:file "package")
(:file "main")))))
| 405 | Common Lisp | .asd | 10 | 33.8 | 84 | 0.6 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | e90ed175cd1e7fb9094362007f83fc071b29dcbcc3e5e5f3c206e936db6ce2d0 | 15,670 | [
-1
] |
15,671 | yadfa.asd | pouar_yadfa/yadfa.asd | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "asdf-user"; coding: utf-8-unix; -*-
(defsystem :yadfa
:name "YADFA"
:version "0.9"
:author "Pouar"
:mailto "[email protected]"
:licence "GPL"
:description "Yet Another Diaperfur Adventure"
:long-description "Yet Another Diaperfur Adventure"
:build-operation :program-op
:in-order-to ((test-op (test-op :yadfa-tests)))
:build-pathname "yadfa"
:entry-point "yadfa::main"
:depends-on (:marshal :iterate :ugly-tiny-infix-macro :closer-mop :clim-listener :mcclim-raster-image :trivial-garbage :cl-ansi-text
:alexandria :serapeum :global-vars :float-features :asdf :uiop :illogical-pathnames :fmt
(:feature :sbcl :yadfa/docs) (:feature :ecl :fare-quasiquote-extras))
:components ((:file "packages")
(:file "main" :depends-on ("packages" "core"))
(:module "core"
:depends-on ("packages")
:components ((:file "util")
(:module "libexec" :depends-on ("util" "patches")
:components ((:file "declares")
(:file "macros" :depends-on ("declares" "init"))
(:file "functions" :depends-on ("macros" "declares" "init"))
(:file "conditions" :depends-on ("declares"))
(:file "methods" :depends-on ("classes" "generic-functions" "macros" "declares" "functions" "conditions"))
(:file "generic-functions" :depends-on ("classes" "macros" "declares" "functions"))
(:file "classes" :depends-on ("init" "declares"))
(:file "hooks" :depends-on ("declares" "init"))
(:file "game" :depends-on ("classes" "init" "declares"))
(:file "mcclim" :depends-on ("init" "declares" "functions" "generic-functions" "macros"))
(:file "structs" :depends-on ("init" "declares"))
(:file "init" :depends-on ("declares"))))
(:module "bin" :depends-on ("libexec")
:components ((:file "bin") (:file "world") (:file "battle")))
(:file "patches")))
(:module "data"
:depends-on ("core")
:components ((:module "moves"
:depends-on ("prolog" "element-types")
:components ((:file "dbz") (:file "haunted") (:file "pokemon") (:file "regular")))
(:module "items"
:depends-on ("moves" "prolog")
:components ((:file "abdl") (:file "armor") (:file "clothes") (:file "consumable")
(:file "debug") (:file "diaper") (:file "misc") (:file "weapons")))
(:module "prolog"
:components ((:file "allies") (:file "enemies") (:file "map")))
(:module "enemies"
:depends-on ("moves" "items" "prolog" "element-types")
:components ((:file "eggbots") (:file "fursuiters") (:file "haunted") (:file "navy")
(:file "pirates") (:file "pokemon") (:file "raccoon-bandits")
(:file "rpgmaker")))
(:module "element-types"
:depends-on ("prolog")
:components ((:file "pokemon")))
(:module "team-members"
:depends-on ("moves" "items" "prolog")
:components ((:file "allies") (:file "catchables")))
(:module "props"
:depends-on ("items" "enemies" "team-members" "prolog")
:components ((:file "base")
(:module "props"
:depends-on ("base")
:components ((:file "toilets") (:file "washers") (:file "beds")))))
(:module "events"
:depends-on ("moves" "items" "enemies" "team-members" "props" "prolog")
:components ((:file "bandits-domain") (:file "base") (:file "debug") (:file "dirty-chasm")
(:file "ironside") (:file "lukurbo") (:file "peachs-castle-wannabe")
(:file "pirates-cove") (:file "pyramid") (:file "secret-underground")
(:file "silver-cape")))
(:module "map"
:depends-on ( "moves" "items" "enemies" "team-members" "props" "events" "prolog")
:components ((:file "bandits-domain") (:file "debug-map") (:file "dirty-chasm")
(:file "haunted-forest") (:file "haunted-house") (:file "home")
(:file "ironside") (:file "lukurbo") (:file "peachs-castle-wannabe")
(:file "pirates-cove") (:file "pyramid") (:file "rpgmaker-dungeon")
(:file "secret-underground") (:file "silver-cape") (:file "sky")
(:file "your-ship")))
(:module "status-conditions"
:depends-on ("prolog")
:components ((:file "abdl") (:file "misc") (:file "pokemon")))
(:module "epilog"
:depends-on ("prolog" "enemies" "events" "items" "map" "moves" "props" "status-conditions" "team-members" "element-types")
:components ((:file "allies") (:file "blackjack") (:file "enemies") (:file "items")
(:file "puzzle" :depends-on ("pyramid")) (:file "pyramid")))))))
(defsystem :yadfa/docs
:depends-on (:net.didierverna.declt)
:description "Used for building the docs. Contains patches to Declt for using Texinfo commands in docstrings"
:components ((:module "core"
:components ((:file "declt-patches")))))
| 6,687 | Common Lisp | .asd | 91 | 46.395604 | 152 | 0.436022 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 2b0dac813992e86fbfd5883c30e05824ded069142e1bab9b8fad9b843447e48e | 15,671 | [
-1
] |
15,672 | yadfa-reference.asd | pouar_yadfa/docs/reference/yadfa-reference.asd | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "asdf-user"; coding: utf-8-unix; -*-
(defsystem :yadfa-reference
:defsystem-depends-on (:yadfa-asdf)
:depends-on (:yadfa :yadfa/docs)
:components (("yadfa-asdf:declt-texi" "yadfa-reference")
("yadfa-asdf:make" "Makefile"
:depends-on ("yadfa-reference")
:outputs #.(loop :for i :in '("dvi" "html" "info" "pdf" "ps")
:collect `(:type ,i :name "yadfa-reference")))))
| 552 | Common Lisp | .asd | 9 | 44.777778 | 99 | 0.504604 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | cff157ee8f1ed2024732441a79e38fa9f03c1e1d68c300d2479e123c75fcaa49 | 15,672 | [
-1
] |
15,673 | yadfa.furaffinity.pouar.myawesomemod.asd | pouar_yadfa/mods/example/yadfa.furaffinity.pouar.myawesomemod.asd | (defsystem "yadfa.furaffinity.pouar.myawesomemod"
:name "Example Mod"
:version "1.0"
:author "Pouar"
:mailto "[email protected]"
:license "MIT"
:depends-on ("yadfa")
:components ((:file "package")
(:file "example" :depends-on ("package"))))
| 268 | Common Lisp | .asd | 9 | 25.555556 | 58 | 0.644788 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 8eef980105109fb62db0172be24404e51d239094e23d681e1165af4d9452e086 | 15,673 | [
-1
] |
15,674 | yadfa-asdf.asd | pouar_yadfa/asdf/yadfa-asdf.asd | ;;;; -*- mode: Common-Lisp; sly-buffer-package: "asdf-user"; coding: utf-8-unix; -*-
(defsystem :yadfa-asdf
:description "ASDF extensions intended to the Makefiles for the docs with ASDF. Used internally."
:long-description "ASDF extensions intended to integrate the docs and it's dependencies with ASDF, as make has absolutely no knowledge of the rest of the game which these docs depend on in order to generate the references. Giving ASDF knowledge of this and let it invoke make instead of having make guess that these dependencies are satisfied seemed like the most reliable solution."
:depends-on (:asdf :uiop :iterate :bibtex :cl-date-time-parser :local-time :net.didierverna.declt)
:components ((:file "yadfa-asdf")))
| 733 | Common Lisp | .asd | 6 | 119.833333 | 385 | 0.770289 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 431a7cc10a04d1e0fd2ac13858d9556aa321268ad3e59869f8e24275b7aeb1aa | 15,674 | [
-1
] |
15,675 | yadfa-reference.declt | pouar_yadfa/docs/reference/yadfa-reference.declt | (:yadfa
:license :gpl
:texi-name "yadfa-reference"
:introduction "Yadfa is yet another diaperfur game, written in Common Lisp. This here is the reference manual for it which is generated automatically") | 202 | Common Lisp | .cl | 4 | 49.75 | 151 | 0.80402 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 4dc9acc0a7e2361b632af08143090f55b86c9291b6104c3575c9bbef19a14f4b | 15,675 | [
-1
] |
15,676 | 0001-Listener-remove-cl-fad-dependency.patch | pouar_yadfa/flatpak/0001-Listener-remove-cl-fad-dependency.patch | From 90d6e08131bb75dbee0c7918cb54cc70c0aea55f Mon Sep 17 00:00:00 2001
From: admich <[email protected]>
Date: Sun, 22 Dec 2019 14:43:00 +0100
Subject: [PATCH] Listener: remove cl-fad dependency
---
Apps/Listener/asdf.lisp | 3 ++-
Apps/Listener/clim-listener.asd | 2 +-
Apps/Listener/dev-commands.lisp | 21 +++++++++++----------
Apps/Listener/file-types.lisp | 2 +-
Apps/Listener/icons.lisp | 5 ++---
5 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/Apps/Listener/asdf.lisp b/Apps/Listener/asdf.lisp
index eb9843e1..a944af15 100644
--- a/Apps/Listener/asdf.lisp
+++ b/Apps/Listener/asdf.lisp
@@ -50,7 +50,8 @@
(mapc (lambda (path)
(when (string-equal (pathname-type path) "asd")
(systems (truename path))))
- (cl-fad:list-directory (eval reg))))))
+ (uiop:directory-files
+ (uiop:ensure-directory-pathname (eval reg)))))))
(defun asdf-operation-pretty-name (op)
(case op
diff --git a/Apps/Listener/clim-listener.asd b/Apps/Listener/clim-listener.asd
index dfc8b495..2376a46e 100644
--- a/Apps/Listener/clim-listener.asd
+++ b/Apps/Listener/clim-listener.asd
@@ -15,7 +15,7 @@ experimentation. Present features include:
- Navigation of the filesystem, including a directory stack
- Launching of external programs sensitive to file type (determined by mailcap
and mime.types files)"
- :depends-on (#:mcclim #:clim-debugger #:uiop #:cl-fad #+sbcl #:sb-posix)
+ :depends-on (#:mcclim #:clim-debugger #:uiop #+sbcl #:sb-posix)
:serial t
:build-operation asdf:program-op
:build-pathname "clim-listener"
diff --git a/Apps/Listener/dev-commands.lisp b/Apps/Listener/dev-commands.lisp
index 63d96ded..6dd21399 100644
--- a/Apps/Listener/dev-commands.lisp
+++ b/Apps/Listener/dev-commands.lisp
@@ -1047,7 +1047,7 @@ if you are interested in fixing this."))
(terpri stream))
(defun actual-name (pathname)
- (if (cl-fad:directory-pathname-p pathname)
+ (if (uiop:directory-pathname-p pathname)
(if (stringp (car (last (pathname-directory pathname))))
(car (last (pathname-directory pathname)))
(directory-namestring pathname))
@@ -1062,8 +1062,8 @@ if you are interested in fixing this."))
(mapcar (lambda (x) (sort-pathnames x sort-by))
(multiple-value-list
(if (not group-dirs) (values list)
- (values (remove-if-not #'cl-fad:directory-pathname-p list)
- (remove-if #'cl-fad:directory-pathname-p list))))))
+ (values (remove-if-not #'uiop:directory-pathname-p list)
+ (remove-if #'uiop:directory-pathname-p list))))))
(defun garbage-name-p (name)
(when (> (length name) 2)
@@ -1099,7 +1099,7 @@ if you are interested in fixing this."))
(list-all-direct-subdirectories 'boolean :default nil :prompt "list all direct subdirectories?"))
(let* ((pathname (probe-file pathname))
- (base-pathname (cl-fad:pathname-directory-pathname pathname))
+ (base-pathname (uiop:pathname-directory-pathname pathname))
(query-pathname (make-pathname :name (or (pathname-name pathname) :wild)
:type (or (pathname-type pathname) :wild)
:directory :wild
@@ -1108,10 +1108,11 @@ if you are interested in fixing this."))
(mapc (lambda (path)
(when (or (pathname-match-p path query-pathname)
(and list-all-direct-subdirectories
- (cl-fad:directory-pathname-p path)))
+ (uiop:directory-pathname-p path)))
;; files is a collector defined above
(files (truename path))))
- (cl-fad:list-directory base-pathname)))))
+ (append (uiop:subdirectories base-pathname)
+ (uiop:directory-files base-pathname))))))
(with-text-family (t :sans-serif)
(invoke-as-heading
(lambda ()
@@ -1163,7 +1164,7 @@ if you are interested in fixing this."))
((pathname 'pathname :prompt "pathname"))
(let ((pathname (merge-pathnames
;; helpfully fix things if trailing slash wasn't entered
- (cl-fad:pathname-as-directory pathname))))
+ (uiop:ensure-directory-pathname pathname))))
(if (not (probe-file pathname))
(note "~A does not exist.~%" pathname)
(progn
@@ -1194,7 +1195,7 @@ if you are interested in fixing this."))
(format stream "Change to this directory"))
:tester ((object)
- (cl-fad:directory-pathname-p object)))
+ (uiop:directory-pathname-p object)))
(object)
(list object))
@@ -1246,7 +1247,7 @@ if you are interested in fixing this."))
(format nil "Show Files Matching ~A" pathname)))
((not (probe-file pathname))
(values nil nil nil))
- ((cl-fad:directory-pathname-p pathname)
+ ((uiop:directory-pathname-p pathname)
(values `(com-show-directory ,pathname)
"Show Directory"
(format nil "Show Directory ~A" pathname)))
@@ -1297,7 +1298,7 @@ if you are interested in fixing this."))
:menu t
:command-table directory-stack-commands)
((pathname 'pathname :prompt "directory"))
- (let ((pathname (merge-pathnames (cl-fad:pathname-as-directory pathname))))
+ (let ((pathname (merge-pathnames (uiop:ensure-directory-pathname pathname))))
(if (not (probe-file pathname))
(note "~A does not exist.~%" pathname)
(progn (push *default-pathname-defaults* *directory-stack*)
diff --git a/Apps/Listener/file-types.lisp b/Apps/Listener/file-types.lisp
index 857df81e..4cdaa45a 100644
--- a/Apps/Listener/file-types.lisp
+++ b/Apps/Listener/file-types.lisp
@@ -135,7 +135,7 @@
(cond ((wild-pathname-p pathname) (standard-icon "wild.xpm"))
((not (probe-file pathname)) (standard-icon "invalid.xpm"))
;; FIXME: use inode mime types
- ((cl-fad:directory-pathname-p pathname) *folder-icon*)
+ ((uiop:directory-pathname-p pathname) *folder-icon*)
(t (let ((mime-class (find-class (pathname-mime-type pathname) nil)))
(if mime-class
(or (gethash (class-name mime-class) *icon-mapping*)
diff --git a/Apps/Listener/icons.lisp b/Apps/Listener/icons.lisp
index 684b4f68..632409a0 100644
--- a/Apps/Listener/icons.lisp
+++ b/Apps/Listener/icons.lisp
@@ -66,9 +66,8 @@
(stream-increment-cursor-position stream (+ (pattern-width pattern) extra-spacing) 0))))
(defun precache-icons ()
- (let ((pathnames (remove-if #'cl-fad:directory-pathname-p
- (cl-fad:list-directory
- (cl-fad:pathname-directory-pathname *icon-path*)))))
+ (let ((pathnames (uiop:directory-files
+ (uiop:pathname-directory-pathname *icon-path*))))
(dolist (pn pathnames)
(standard-icon (namestring (make-pathname :name (pathname-name pn)
:type (pathname-type pn)))))))
--
2.25.1
| 7,119 | Common Lisp | .cl | 145 | 43.427586 | 103 | 0.629294 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | b435ca4cf7d80f2c78d93b12b173ecf13c7201541606cd61a4278253d55ffbaf | 15,676 | [
-1
] |
15,677 | 99-mcclim.conf | pouar_yadfa/flatpak/99-mcclim.conf | <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
</its:rules>
<description>Set preferable fonts for McCLIM</description>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
</fontconfig>
| 670 | Common Lisp | .cl | 26 | 21.846154 | 88 | 0.659938 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | d637743191d120a34a521dac08d0322655684c85c822291fb74c2802048b8705 | 15,677 | [
-1
] |
15,678 | build-ccl.sh | pouar_yadfa/ci/build-ccl.sh | #!/bin/sh
cd "$1/lisp-kernel/win64"
make -j$(nproc)
cd "$1"
./wx86cl64.exe -n -l lib/x8664env.lisp -e '(ccl:xload-level-0)' -e '(ccl:compile-ccl)' -e '(uiop:quit)'
echo '(ccl:save-application "wx86cl64.image")'|./wx86cl64.exe --image-name wx86-boot64.image --no-init --quiet --batch
| 284 | Common Lisp | .cl | 6 | 46.166667 | 119 | 0.676259 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5694c99aff81acc173759b3e9415ea6bb9725a6fff2d8f395cda36b4d0a72db6 | 15,678 | [
-1
] |
15,684 | .gitlab-ci.yml | pouar_yadfa/.gitlab-ci.yml | image: centos:latest
pages:
only:
- master
before_script:
- tar -xf cache.tar || true
script:
- dnf -y upgrade
- dnf -y install flatpak flatpak-builder gnupg git xz bzip2 librsvg2
- gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
- printf '%s' "$GPGKEY"|base64 -d|gpg --import
- flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- flatpak-builder --install-deps-from=flathub --force-clean build flatpak/net.pouar.yadfa.yml
- flatpak build-export --gpg-sign='677EE149B5AFD7E5A4A5E246C65B2BA168C7FDC4' public build
- flatpak build-update-repo --gpg-sign='677EE149B5AFD7E5A4A5E246C65B2BA168C7FDC4' --prune-depth=10 --prune --generate-static-deltas public
- tar -cf cache.tar .flatpak-builder public
- mkdir yadfa-docs
- cp build/files/share/doc/yadfa/* build/files/lib/yadfa/docs/reference/* build/files/share/info/dir build/files/share/info/yadfa-reference.info yadfa-docs
- tar -cf - yadfa-docs|xz -9ec --lzma2=preset=9e,dict=100MB,pb=0,nice=273 - > public/yadfa-docs.tar.xz
environment:
name: production
artifacts:
paths:
- public
cache:
paths:
- cache.tar
test:
except:
- master
script:
- dnf -y upgrade
- dnf -y install flatpak flatpak-builder gnupg git xz bzip2 librsvg2
- gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
- flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- flatpak-builder --install-deps-from=flathub --force-clean build flatpak/net.pouar.yadfa.yml
environment:
name: production
| 1,661 | Common Lisp | .l | 38 | 39.368421 | 159 | 0.724691 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5516ccb7a09abf7b3dbf67b4f48acf027aa16793ebc166fb1966e873957335f0 | 15,684 | [
-1
] |
15,690 | .appveyor.yml | pouar_yadfa/.appveyor.yml | image: Visual Studio 2017
platform: x64
clone_depth: 1
environment:
CACHE: 'c:\cache\'
SBCL_HOME: 'C:\Program Files\Steel Bank Common Lisp\2.0.1\'
bintrayapikey:
secure: O42a6FepgN/X3CzWpPbJkuKRhmENlIwBfbtMVQLKSWR/annp514THuh4Dynu6xLZ
install:
# Like Windows Installer, Chocolatey's build files are apparently incapable of building the sources
- ps: If(!(test-path $env:CACHE )) { mkdir $env:CACHE; }
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://beta.quicklisp.org/quicklisp.lisp" -OutFile $env:CACHE\quicklisp.lisp
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/Clozure/ccl/releases/download/v1.12/windowsx86.zip" -OutFile $env:CACHE\ccl-bootstrap.zip
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/Clozure/ccl/archive/master.zip" -OutFile $env:CACHE\ccl.zip
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://gitlab.common-lisp.net/asdf/asdf/-/archive/3.3.4.4/asdf-3.3.4.4.zip" -OutFile $env:CACHE\asdf.zip
#- ps: Invoke-WebRequest -UserAgent wget -Uri "https://downloads.sourceforge.net/project/sbcl/sbcl/2.0.1/sbcl-2.0.1-x86-64-windows-binary.msi" -OutFile $env:CACHE\sbcl.msi
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/joaotavora/sly/archive/master.zip" -OutFile "$env:CACHE\sly.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/didierverna/declt/archive/master.zip" -OutFile "$env:CACHE\declt.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/McCLIM/McCLIM/archive/master.zip" -OutFile "$env:CACHE\mcclim.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/edicl/flexi-streams/archive/master.zip" -OutFile "$env:CACHE\flexi-streams.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://gitlab.com/pouar/illogical-pathnames/-/archive/pouar/illogical-pathnames-pouar.zip" -OutFile "$env:CACHE\illogical-pathnames.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://gitlab.com/pouar/iterate/-/archive/pouar/iterate-pouar.zip" -OutFile "$env:CACHE\iterate.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/pouar/cl-marshal/archive/pouar.zip" -OutFile "$env:CACHE\marshal.zip"
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://downloads.sourceforge.net/project/dejavu/dejavu/2.37/dejavu-fonts-ttf-2.37.zip" -OutFile $env:CACHE\dejavu.zip
- ps: Invoke-WebRequest -UserAgent wget -Uri "https://github.com/Clozure/ccl/commit/8e0ef117f75011b1c79bb036b94b8ba96bc6b285.patch" -OutFile $env:CACHE\8e0ef117f75011b1c79bb036b94b8ba96bc6b285.patch
#- cmd: 'C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages texinfo-tex,texlive-collection-xetex,jq,patch,make,m4,mingw64-x86_64-binutils,mingw64-x86_64-gcc-core,mingw64-x86_64-headers,mingw64-x86_64-pthreads,mingw64-x86_64-runtime'
- cmd: 'C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages jq,patch,make,m4,mingw64-x86_64-binutils,mingw64-x86_64-gcc-core,mingw64-x86_64-headers,mingw64-x86_64-pthreads,mingw64-x86_64-runtime'
- ps: Expand-Archive $env:CACHE\ccl.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\ccl-bootstrap.zip -DestinationPath $env:CACHE
- ps: New-Item -ItemType Directory -Force -Path $env:USERPROFILE\common-lisp\
- ps: Expand-Archive $env:CACHE\asdf.zip -DestinationPath $env:USERPROFILE\common-lisp\
- ps: Expand-Archive $env:CACHE\sly.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\declt.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\mcclim.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\dejavu.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\illogical-pathnames.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\iterate.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\flexi-streams.zip -DestinationPath $env:CACHE
- ps: Expand-Archive $env:CACHE\marshal.zip -DestinationPath $env:CACHE
- ps: Copy-Item $env:CACHE\win64-headers\ -recurse -destination $env:CACHE\ccl-master\
- ps: Copy-Item $env:CACHE\wx86cl64.image -destination $env:CACHE\ccl-master\
- ps: Copy-Item $env:CACHE\dejavu-fonts-ttf-2.37\ttf\*.ttf -destination C:\Windows\Fonts
- cmd: refreshenv
# - cmd: 'start /wait msiexec /i %CACHE%\sbcl.msi /quiet /qn /norestart /log sbcl-install.log'
- cmd: 'C:\cygwin64\bin\bash.exe -lc "patch -d /cygdrive/c/cache/ccl-master -p1 -i /cygdrive/c/cache/8e0ef117f75011b1c79bb036b94b8ba96bc6b285.patch"'
- cmd: 'C:\cygwin64\bin\bash.exe -lc "/cygdrive/c/projects/yadfa/ci/build-ccl.sh /cygdrive/c/cache/ccl-master"'
- cmd: '"%CACHE%\ccl-master\wx86cl64.exe" -b -l "%CACHE%\quicklisp.lisp" -e "(quicklisp-quickstart:install)" -e "(ql:quickload (list :fiveam :fiveam-asdf))" -e "(uiop:quit)"'
- ps: Copy-Item ci\ccl-init.lisp -Destination $env:USERPROFILE\ccl-init.lisp
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\yadfa -ItemType SymbolicLink -Value $pwd
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\sly -ItemType SymbolicLink -Value $env:CACHE\sly-master
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\flexi-streams -ItemType SymbolicLink -Value $env:CACHE\flexi-streams-master
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\declt -ItemType SymbolicLink -Value $env:CACHE\declt-master
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\McCLIM -ItemType SymbolicLink -Value $env:CACHE\McCLIM-master
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\illogical-pathnames -ItemType SymbolicLink -Value $env:CACHE\illogical-pathnames-pouar
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\iterate -ItemType SymbolicLink -Value $env:CACHE\iterate-pouar
- ps: New-Item -Path $env:USERPROFILE\quicklisp\local-projects\cl-marshal -ItemType SymbolicLink -Value $env:CACHE\cl-marshal-pouar
- cmd: 'C:\cygwin64\bin\bash.exe -lc "patch -d /cygdrive/c/cache/McCLIM-master -p1 -i /cygdrive/c/projects/yadfa/flatpak/0001-Listener-remove-cl-fad-dependency.patch"'
build_script:
#- cmd: '"C:\Program Files\Steel Bank Common Lisp\2.0.1\sbcl" --script "appveyor-build-docs.lisp" texi'
#- cmd: 'C:\cygwin64\bin\bash.exe -lc "cd /cygdrive/c/projects/yadfa/docs/reference;make -j4 all"'
- cmd: '"%CACHE%\ccl-master\wx86cl64.exe" -b -l appveyor-build.lisp -- immutable'
- ps: cp chocolatey/yadfa.nuspec yadfa.nuspec # for some reason Chocolatey seems to expect the package build file to be in the same directory as the source directory
- ps: choco pack yadfa.nuspec --version $(Get-Date -UFormat "0.9.%s")
- ps: ./yadfa test
artifacts:
- path: yadfa*.nupkg
name: NuPKG
test_script:
- ps: |
If(!(test-path C:\projects\yadfa\yadfa.exe )) { echo "yadfa.exe was not built";exit 1; }
Else { echo "yadfa.exe was built"; }
#If(!(test-path C:\projects\yadfa\docs\reference\yadfa-reference.html )) { echo "yadfa-reference.html was not built";exit 1; }
#Else { echo "yadfa-reference.html was built"; }
#If(!(test-path C:\projects\yadfa\docs\reference\yadfa-reference.pdf )) { echo "yadfa-reference.pdf was not built";exit 1; }
#Else { echo "yadfa-reference.pdf was built"; }
#If(!(test-path C:\projects\yadfa\docs\reference\yadfa-reference.info )) { echo "yadfa-reference.info was not built";exit 1; }
#Else { echo "yadfa-reference.info was built"; }
#If(!(test-path C:\projects\yadfa\docs\reference\yadfa-reference.ps )) { echo "yadfa-reference.ps was not built";exit 1; }
#Else { echo "yadfa-reference.ps was built"; }
#If(!(test-path C:\projects\yadfa\docs\reference\yadfa-reference.dvi )) { echo "yadfa-reference.dvi was not built";exit 1; }
#Else { echo "yadfa-reference.dvi was built"; }
#If(!(test-path C:\projects\yadfa\docs\reference\yadfa-reference.xml )) { echo "yadfa-reference.xml was not built";exit 1; }
#Else { echo "yadfa-reference.xml was built"; }
If(!(Get-ChildItem C:\projects\yadfa\yadfa*.nupkg )) { echo "nupkg was not built";exit 1; }
Else { echo "nupkg was built"; }
deploy_script:
- ps: |
if( $env:APPVEYOR_REPO_BRANCH -like "master") {
nuget sources Add -Name Bintray -Source https://api.bintray.com/nuget/pouar/yadfa-chocolatey -UserName pouar -Password $env:bintrayapikey
nuget setapikey 'pouar:'$env:bintrayapikey -Source Bintray
nuget push $([string[]](Get-Item yadfa*.nupkg)) -Source https://api.bintray.com/nuget/pouar/yadfa-chocolatey
}
- cmd: 'C:\cygwin64\bin\bash.exe -lc "export bintrayapikey APPVEYOR_REPO_BRANCH;/cygdrive/c/projects/yadfa/ci/clear-old-versions.sh"'
| 8,495 | Common Lisp | .l | 93 | 89.172043 | 264 | 0.754434 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 565f987fb65f6d92ee3b4c284ba60a935b8ef621db4ad5a2ccf9aad789b0116a | 15,690 | [
-1
] |
15,756 | blank.xpm | pouar_yadfa/pixmaps/map-patterns/blank.xpm | /* XPM */
static char *blank[] = {
/* columns rows colors chars-per-pixel */
"16 16 2 1 ",
" c black",
". c white",
/* pixels */
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};
| 452 | Common Lisp | .l | 24 | 17.833333 | 41 | 0.168224 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 8b8eedca70d7a304ebf6ee880b8a9b9ae280302e290902c453aec72402472df5 | 15,756 | [
-1
] |
15,757 | solid.xpm | pouar_yadfa/pixmaps/map-patterns/solid.xpm | /* XPM */
static char *solid[] = {
/* columns rows colors chars-per-pixel */
"16 16 2 1 ",
" c black",
". c white",
/* pixels */
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................"
};
| 452 | Common Lisp | .l | 24 | 17.833333 | 41 | 0.168224 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 4b5fcffef9312679cc0186ea35dd7fd828c41727534687a064ec06f115246cbd | 15,757 | [
-1
] |
15,758 | hollow.xpm | pouar_yadfa/pixmaps/map-patterns/hollow.xpm | /* XPM */
static char *hollow[] = {
/* columns rows colors chars-per-pixel */
"16 16 2 1 ",
" c black",
". c white",
/* pixels */
"................",
"................",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
".. ..",
"................",
"................"
};
| 453 | Common Lisp | .l | 24 | 17.875 | 41 | 0.170163 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | f397711a114ee85706856b0325f0167431c2bb62c7a3633d5c03a64d1968faf6 | 15,758 | [
-1
] |
15,759 | style-common.css | pouar_yadfa/docs/reference/style-common.css | /*
* taken from https://sourceforge.net/p/sbcl/sbcl/ci/master/tree/doc/manual
*/
/*
* Based on version 1.0.1 of the texinfo-css stylesheet published by
* sirgazil (https://bitbucket.org/sirgazil/texinfo-css).
*
* Public domain 2016 sirgazil. All rights waived.
*/
/* NATIVE ELEMENTS */
a:link,
a:visited {
color: #1E90FF;
text-decoration: none;
}
a:active,
a:focus,
a:hover {
text-decoration: underline;
}
abbr,
acronym {
cursor: help;
}
blockquote {
color: #555753;
font-style: oblique;
margin: 30px 0px;
padding-left: 3em;
}
body {
background-color: white;
box-shadow: 0 0 2px gray;
box-sizing: border-box;
color: #333;
font-family: sans-serif;
font-size: 16px;
margin: 50px auto;
max-width: 70em; /*960px;*/
padding: 50px;
}
code,
samp,
tt,
var {
color: purple;
font-size: 0.8em;
}
div.example,
div.lisp {
margin: 0px;
}
dl {
margin: 3em 0em;
}
dl dl {
margin: 0em;
}
dt {
background-color: #F5F5F5;
padding: 0.5em;
}
h1,
h2,
h2.contents-heading,
h3,
h4 {
padding: 20px 0px 0px 0px;
font-weight: normal;
}
h1 {
font-size: 2.4em;
}
h2 {
font-size: 2.2em;
font-weight: bold;
}
h3 {
font-size: 1.8em;
}
h4 {
font-size: 1.4em;
}
hr {
background-color: silver;
border-style: none;
height: 1px;
margin: 0px;
}
html {
background-color: #F5F5F5;
}
img {
max-width: 100%;
}
li {
padding: 5px;
}
div.display,
div.example,
div.format,
div.lisp,
div.verbatim {
overflow: auto;
}
div.example,
div.lisp,
div.verbatim {
background-color: #F5F5F5; /* #2D3743;*/
border-color: #000;
border-style: solid;
border-width: thin;
/*color: #E1E1E1;*/
font-size: smaller;
padding: 1em;
}
pre {
padding: 0;
margin: 0 0 1em 0;
}
pre:last-of-type {
margin: 0 0 0 0;
}
table {
border-collapse: collapse;
margin: 40px 0px;
}
table.index-cp *,
table.index-fn *,
table.index-ky *,
table.index-pg *,
table.index-tp *,
table.index-vr * {
background-color: inherit;
border-style: none;
}
td,
th {
border-color: silver;
border-style: solid;
border-width: thin;
padding: 10px;
}
th {
background-color: #F5F5F5;
}
/* END NATIVE ELEMENTS */
/* CLASSES */
.contents {
margin-bottom: 4em;
}
.float {
margin: 3em 0em;
}
.float-caption {
font-size: smaller;
text-align: center;
}
.float > img {
display: block;
margin: auto;
}
.footnote {
font-size: smaller;
margin: 5em 0em;
}
.footnote h3 {
display: inline;
font-size: small;
}
.key {
color: purple;
font-size: 0.8em;
}
/* END CLASSES */
| 2,673 | Common Lisp | .l | 175 | 12.428571 | 75 | 0.648923 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 967970666cfb9ba3a29e70bc0dd54afcbc5b5452a53c54b6838e9adf324d9d2e | 15,759 | [
-1
] |
15,761 | Makefile | pouar_yadfa/docs/reference/Makefile | SRC := yadfa-reference.texi
export MAKEINFO := makeinfo
export TEX := pdftex --output-format=dvi
export PDFTEX := xetex
TEXOBJS := yadfa-reference.ps yadfa-reference.dvi yadfa-reference.pdf
OBJS := yadfa-reference.info yadfa-reference.html
INSTALL := install
INSTALL_DATA := $(INSTALL) -m644
INSTALL_DIR := $(INSTALL) -Ddm755
.PHONY: maketex install-info install-pdf install-html install-ps install-dvi install-texi install-docs dvi pdf info ps html
prefix := /usr/local
datarootdir := $(prefix)/share
docdir := $(datarootdir)/doc/yadfa
infodir := $(datarootdir)/info
SHELL := /bin/sh
all: $(OBJS) maketex
yadfa-reference.info: $(SRC)
$(MAKEINFO) --no-split $<
yadfa-reference.dvi: $(SRC)
$(MAKEINFO) --no-split --dvi $<
yadfa-reference.html: $(SRC)
$(MAKEINFO) --css-include=style-common.css --css-include=style-single.css --no-split --html $<
yadfa-reference.pdf: $(SRC)
$(MAKEINFO) --no-split --pdf $<
yadfa-reference.ps: $(SRC)
$(MAKEINFO) --no-split --ps $<
maketex: $(SRC)
$(MAKE) -j1 $(TEXOBJS)
$(DESTDIR)$(docdir) $(DESTDIR)$(infodir): %:
$(INSTALL_DIR) $@
install-info: yadfa-reference.info $(DESTDIR)$(infodir)
$(INSTALL_DATA) yadfa-reference.info $(DESTDIR)$(infodir)/
if $(SHELL) -c 'install-info --version' \
>/dev/null 2>&1; then \
install-info --dir-file="$(DESTDIR)$(infodir)/dir" \
"$(DESTDIR)$(infodir)/yadfa-reference.info"; \
else true; fi
install-pdf: yadfa-reference.pdf $(DESTDIR)$(docdir)
$(INSTALL_DATA) yadfa-reference.pdf $(DESTDIR)$(docdir)/
install-html: yadfa-reference.html $(DESTDIR)$(docdir)
$(INSTALL_DATA) yadfa-reference.html $(DESTDIR)$(docdir)/
install-ps: yadfa-reference.ps $(DESTDIR)$(docdir)
$(INSTALL_DATA) yadfa-reference.ps $(DESTDIR)$(docdir)/
install-dvi: yadfa-reference.dvi $(DESTDIR)$(docdir)
$(INSTALL_DATA) yadfa-reference.dvi $(DESTDIR)$(docdir)/
install-texi: yadfa-reference.texi $(DESTDIR)$(docdir)
$(INSTALL_DATA) yadfa-reference.texi $(DESTDIR)$(docdir)/
install-docs: install-info install-pdf install-html install-ps install-dvi
clean:
rm -f $(OBJS) $(TEXOBJS) yadfa-reference.aux yadfa-reference.log yadfa-reference.tmp yadfa-reference.toc yadfa-reference.cps yadfa-reference.cp yadfa-reference.fns yadfa-reference.fn yadfa-reference.tps yadfa-reference.tp yadfa-reference.vrs yadfa-reference.vr
dvi: yadfa-reference.dvi
pdf: yadfa-reference.pdf
info: yadfa-reference.info
ps: yadfa-reference.ps
html: yadfa-reference.html
| 2,510 | Common Lisp | .l | 55 | 42.327273 | 261 | 0.715811 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | caeb2b08d5301c691896e0e1cfb06955b302ad9d64dd3fff3471541a71ba498f | 15,761 | [
-1
] |
15,762 | style-single.css | pouar_yadfa/docs/reference/style-single.css | .header {
display: none;
}
.menu {
display: none;
}
| 61 | Common Lisp | .l | 6 | 7.666667 | 18 | 0.592593 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | e57eb5a308d7aac8a46f9d04e475db6b45fbb562a6f50f59ab6ec7606955298c | 15,762 | [
-1
] |
15,763 | style-multi.css | pouar_yadfa/docs/reference/style-multi.css | .header {
background-color: #F2F2F2;
font-size: small;
padding: 0.2em 1em;
}
.menu * {
border-style: none;
}
.menu td {
padding: 0.5em 0em;
}
.menu td:last-child {
width: 60%;
}
.menu th {
background-color: inherit;
}
| 250 | Common Lisp | .l | 17 | 11.823529 | 30 | 0.624454 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | cc17d45c29c8714998da1b8e95023c5a3807c7bf7ef54e8938fc9b610a269b49 | 15,763 | [
-1
] |
15,766 | net.pouar.yadfa.yml | pouar_yadfa/flatpak/net.pouar.yadfa.yml | app-id: net.pouar.yadfa
runtime: org.freedesktop.Platform
runtime-version: '19.08'
sdk: org.freedesktop.Sdk
command: /app/bin/yadfa
cleanup:
- /tmp
- /bin/wget
- /etc
- /share/runtime
- /share/locale
- /share/man
- /lib/debug
- /lib/yadfa/ci
- /lib/yadfa/flatpak
- /lib/yadfa/chocolatey
- /lib/yadfa/.*
- /lib/yadfa/appveyor-*.lisp
finish-args:
- --share=ipc
- --socket=x11
- --share=network
- --device=dri
build-options:
build-args:
- --share=network
modules:
- name: wget
buildsystem: autotools
sources:
- type: archive
url: https://ftp.gnu.org/gnu/wget/wget-1.20.3.tar.gz
sha256: 31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e
build-options:
strip: true
post-install:
- rm -rf /app/share /app/etc
- name: tinytex
buildsystem: simple
build-commands:
- bash -c 'export TEXDIR=/app/tmp/texlive PATH="$PATH:/app/tmp/texlive/$(uname -m)-linux/bin";sh tools/install-base.sh - "$@" && rm -rf $TEXDIR && mkdir -p $TEXDIR && mv texlive/* $TEXDIR && rm -r texlive && $TEXDIR/bin/$(uname -m)-linux/tlmgr install $(cat pkgs-custom.txt | tr "\n" " ") && $TEXDIR/bin/$(uname -m)-linux/tlmgr path add'
sources:
- type: archive
sha256: 3d4739ef4505771b144b8d8d455a0d78f122669cf9bd8143b786c1ac8abec880
url: https://github.com/yihui/tinytex/archive/v0.25.tar.gz
- type: file
path: pkgs-custom.txt
sha256: 03a78d417c605e5dbbf22e467a45ad808a1ed02c168d109eaefed33344ba40a4
post-install:
- rm -rf /app/bin
- name: sbcl-bin
buildsystem: simple
build-commands:
- INSTALL_ROOT="/app/tmp/sbcl-bin" sh install.sh
- printf "#!/bin/sh\necho net.pouar.yadfa\n" > /app/tmp/sbcl-bin/bin/hostname
- chmod +x /app/tmp/sbcl-bin/bin/hostname
sources:
- type: archive
url: https://downloads.sourceforge.net/project/sbcl/sbcl/2.0.8/sbcl-2.0.8-x86-64-linux-binary.tar.bz2
sha256: c1dfdd9421c849a4aa992b26bc31388a368177bdd3f8479350b3b7c4f1078e40
- name: sbcl
build-options:
strip: true
buildsystem: simple
build-commands:
- sed -i 's|-C $@ test <|-C $@ <|' contrib/build-contrib
- sh -c 'SBCL_HOME="/app/tmp/sbcl-bin/lib/sbcl" PATH="$PATH:/app/tmp/sbcl-bin/bin" HOME="/app/tmp/home/" sh make.sh sbcl --fancy --with-sb-fasteval --without-sb-eval --with-sb-unicode --with-largefile'
- INSTALL_ROOT="/app/tmp/sbcl" HOME="/app/tmp/home/" sh install.sh
sources:
- type: archive
url: https://downloads.sourceforge.net/project/sbcl/sbcl/2.0.8/sbcl-2.0.8-source.tar.bz2
sha256: 208d46f7b94d256d036f0efc9734e6b34a85c51bb03c3eb8bf39b7a3efe699f7
- name: yadfa-deps
buildsystem: simple
build-commands:
- mkdir -p /app/tmp/home/common-lisp
- cp -R asdf /app/tmp/home/common-lisp/
- SBCL_HOME="/app/tmp/sbcl/lib/sbcl" PATH="$PATH:/app/tmp/sbcl/bin" HOME="/app/tmp/home/" sbcl --quit --load "quicklisp.lisp" --eval "(quicklisp-quickstart:install)"
- mkdir -p /app/tmp/home/quicklisp/local-projects
- cp -R declt McCLIM sly illogical-pathnames iterate flexi-streams marshal /app/tmp/home/quicklisp/local-projects
sources:
- type: file
url: https://beta.quicklisp.org/quicklisp.lisp
sha256: 4a7a5c2aebe0716417047854267397e24a44d0cce096127411e9ce9ccfeb2c17
- type: git
url: https://gitlab.common-lisp.net/asdf/asdf.git
tag: 3.3.4.5
dest: asdf
- type: git
url: https://github.com/didierverna/declt.git
dest: declt
- type: git
dest: McCLIM
url: https://github.com/McCLIM/McCLIM.git
- type: git
dest: sly
url: https://github.com/joaotavora/sly.git
- type: git
dest: flexi-streams
url: https://github.com/edicl/flexi-streams.git
- type: git
dest: illogical-pathnames
branch: pouar
url: https://gitlab.com/pouar/illogical-pathnames.git
- type: git
dest: iterate
branch: pouar
url: https://gitlab.com/pouar/iterate.git
- type: git
dest: marshal
branch: pouar
url: https://github.com/pouar/cl-marshal.git
- type: file
path: 0001-Listener-remove-cl-fad-dependency.patch
- type: shell
commands:
- patch -d McCLIM -p1 -i ../0001-Listener-remove-cl-fad-dependency.patch
- name: yadfa-cache
buildsystem: simple
build-commands:
- SBCL_HOME="/app/tmp/sbcl/lib/sbcl" PATH="$PATH:/app/tmp/sbcl/bin" HOME="/app/tmp/home/" sbcl --quit --eval '(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init)))' --eval "(progn (ql:update-client :prompt nil) (ql:update-all-dists :prompt nil) (pushnew :mcclim-ffi-freetype *features*) (ql:quickload '(:swank :mcclim :marshal :iterate :ugly-tiny-infix-macro :closer-mop :trivial-features :clim-listener :mcclim-raster-image :trivial-garbage :macro-level :cl-ansi-text :alexandria :plump-sexp :net.didierverna.declt :sb-aclrepl :serapeum :global-vars :float-features :illogical-pathnames :fiveam :bibtex :cl-date-time-parser :local-time :fmt)))"
- name: yadfa
buildsystem: simple
build-commands:
- ln -s $PWD /app/tmp/home/quicklisp/local-projects/yadfa
- bash -c 'export MAKEFLAGS="-j$(nproc)" SBCL_HOME="/app/tmp/sbcl/lib/sbcl" PATH="/app/tmp/texlive/bin/x86_64-linux:$PATH:/app/tmp/sbcl/bin" HOME="/app/tmp/home/";sbcl --script build.lisp docs ft immutable && ./yadfa test'
- bash -c 'cd flatpak;SBCL_HOME="/app/tmp/sbcl/lib/sbcl" PATH="$PATH:/app/tmp/sbcl/bin" HOME="/app/tmp/home/" sbcl --script create-appstream-metadata.lisp'
- install -dm755 /app/lib/yadfa
- git archive HEAD|tar -xf - -C /app/lib/yadfa/
- install -Dm755 yadfa /app/lib/yadfa/
- rm /app/tmp/home/quicklisp/local-projects/yadfa
- mkdir -p /app/bin /app/share/icons/hicolor/scalable/apps /app/share/applications /app/share/metainfo /app/lib
- make -C docs/reference prefix=/app install-docs install-texi
- install -Dm644 flatpak/net.pouar.yadfa.svg /app/share/icons/hicolor/scalable/apps/net.pouar.yadfa.svg
- install -Dm644 flatpak/net.pouar.yadfa.appdata.xml /app/share/metainfo/net.pouar.yadfa.appdata.xml
- install -Dm644 flatpak/net.pouar.yadfa.appdata.xml.lisp /app/share/metainfo/net.pouar.yadfa.appdata.xml.lisp
- install -Dm755 flatpak/net.pouar.yadfa.desktop /app/share/applications/net.pouar.yadfa.desktop
- install -Ddm755 /app/etc/fonts/conf.d/
- install -Dm644 flatpak/99-mcclim.conf /app/etc/fonts/conf.d/
- ln -s /app/lib/yadfa/yadfa /app/bin/yadfa
- bash -c 'LIB="$(readlink /lib/x86_64-linux-gnu/libfreetype.so)"; ln -s "/lib/x86_64-linux-gnu/${LIB%.[0-9]*.[0-9]*}" /app/lib/libfreetype.so'
- bash -c 'LIB="$(readlink /lib/x86_64-linux-gnu/libfontconfig.so)"; ln -s "/lib/x86_64-linux-gnu/${LIB%.[0-9]*.[0-9]*}" /app/lib/libfontconfig.so'
- bash -c 'LIB="$(readlink /lib/x86_64-linux-gnu/libharfbuzz.so)"; ln -s "/lib/x86_64-linux-gnu/${LIB%.[0-9]*.[0-9]*}" /app/lib/libharfbuzz.so'
sources:
- type: git
branch: master
url: https://gitlab.com/pouar/yadfa.git
post-install:
- rm -rf /app/tmp /app/etc /app/share/runtime /app/share/locale /app/share/man /app/lib/debug /app/lib/yadfa/ci /app/lib/yadfa/flatpak /app/lib/yadfa/chocolatey /app/lib/yadfa/.git
- rm -f /app/lib/yadfa/appveyor-*.lisp .appveyor.yml .gitattributes .gitignore .gitlab-ci.yml .mailmap
| 7,596 | Common Lisp | .l | 150 | 44.466667 | 744 | 0.675396 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 9bee5d8b62760dee0d3056c081c4d4a66cd81288a41217b2fef71c8e08c55017 | 15,766 | [
-1
] |
15,768 | yadfa.flatpakrepo | pouar_yadfa/flatpak/yadfa.flatpakrepo | [Flatpak Repo]
Title=yadfa
Url=https://pouar.gitlab.io/yadfa
Homepage=https://cgit.pouar.net/yadfa.git/about
Comment=Flatpak Repository for Yet Another Diaperfur Adventure
Description=Flatpak Repository for Yet Another Diaperfur Adventure
Icon=https://glcdn.githack.com/pouar/yadfa/raw/cf8d24251adf766808bd85f1eadeebfe6effee0c/flatpak/net.pouar.yadfa.svg
GPGKey=mDMEXkF9oRYJKwYBBAHaRw8BAQdAvWfcTf4nKUwxTdhs3VJs1re2oMTDx/6NNUHVCrQ5EB20vlBvdWFyIChGbGF0cGFrIE5pZ2h0bHkgQ0kvQ0QuIFRoaXMgbWVhbnMgbm90aGluZyBzaW5jZSB0aGUgc2lnbmluZyBpcyBhdXRvbWF0ZWQsIGJ1dCBhcHBhcmVudGx5IHRoZSBmbGF0cGFrIGRldnMgdGhvdWdodCByZXF1aXJpbmcgaXQgZm9yIGF1dG9tYXRlZCBidWlsZHMgd2FzIGEgZ29vZCBpZGVhLikgPHBvdWFyQHBvdWFyLm5ldD6IkAQTFggAOBYhBGd+4Um1r9flpKXiRsZbK6Fox/3EBQJeQX2hAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEMZbK6Fox/3ENpYA/2KmY7GNJ1N8cymFVNd9aP1NDE8eHulh2cAeMllD3VnNAP98wjjJdsYGheay4edApHsinoUiG26M8SZ53O6aeaOIDA==
| 887 | Common Lisp | .l | 8 | 109.875 | 531 | 0.935154 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | ca3b81102935c40537f8957be06e42683bfd7c46724d54289cfbddc272a94397 | 15,768 | [
-1
] |
15,772 | yadfa.flatpakref | pouar_yadfa/flatpak/yadfa.flatpakref | [Flatpak Ref]
Name=net.pouar.yadfa
Branch=master
Title=Yadfa
Url=https://pouar.gitlab.io/yadfa
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
Comment=Yet Another Diaperfur Adventure
Description=An experimental text based adventure you play by typing in Lisp code in a REPL
IsRuntime=false
Icon=https://glcdn.githack.com/pouar/yadfa/raw/cf8d24251adf766808bd85f1eadeebfe6effee0c/flatpak/net.pouar.yadfa.svg
GPGKey=mDMEXkF9oRYJKwYBBAHaRw8BAQdAvWfcTf4nKUwxTdhs3VJs1re2oMTDx/6NNUHVCrQ5EB20vlBvdWFyIChGbGF0cGFrIE5pZ2h0bHkgQ0kvQ0QuIFRoaXMgbWVhbnMgbm90aGluZyBzaW5jZSB0aGUgc2lnbmluZyBpcyBhdXRvbWF0ZWQsIGJ1dCBhcHBhcmVudGx5IHRoZSBmbGF0cGFrIGRldnMgdGhvdWdodCByZXF1aXJpbmcgaXQgZm9yIGF1dG9tYXRlZCBidWlsZHMgd2FzIGEgZ29vZCBpZGVhLikgPHBvdWFyQHBvdWFyLm5ldD6IkAQTFggAOBYhBGd+4Um1r9flpKXiRsZbK6Fox/3EBQJeQX2hAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEMZbK6Fox/3ENpYA/2KmY7GNJ1N8cymFVNd9aP1NDE8eHulh2cAeMllD3VnNAP98wjjJdsYGheay4edApHsinoUiG26M8SZ53O6aeaOIDA==
| 950 | Common Lisp | .l | 11 | 85.363636 | 531 | 0.928647 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | b429739277cccf483fcbaa7b07aba9d8b347d8591494a20edb4bbf9756497bbc | 15,772 | [
-1
] |
15,773 | clear-old-versions.sh | pouar_yadfa/ci/clear-old-versions.sh | #!/bin/sh
if [ "$APPVEYOR_REPO_BRANCH" = "master" ];then
for i in $(curl -s -L -u "pouar:$bintrayapikey" https://api.bintray.com/packages/pouar/yadfa-chocolatey/yadfa|jq -r .versions[1:][]);do
curl -s -X DELETE -L -u "pouar:$bintrayapikey" "https://api.bintray.com/packages/pouar/yadfa-chocolatey/yadfa/versions/$i"
done
fi
| 340 | Common Lisp | .l | 6 | 53 | 139 | 0.685629 | pouar/yadfa | 5 | 1 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 352e6536b15e84a2e57f58b73d638fa17d0b44aba98fe7583f76c1486c5711a4 | 15,773 | [
-1
] |
15,810 | package.lisp | ahungry_defjs/package.lisp | ;; defjs - Common Lisp REPL fun in Javascript
;; Copyright (C) 2014 Matthew Carter
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;; package.lisp
(defpackage #:defjs
(:use #:cl
#:bordeaux-threads
#:parenscript
#:clws
#:hunchentoot
#:cl-who
#:glyphs)
(:export
#:main
#:defjs
#:dojs
#:loader
#:get-loader
#:page-js
#:start-websocket-server
#:*js*))
| 1,029 | Common Lisp | .lisp | 33 | 27.818182 | 72 | 0.696177 | ahungry/defjs | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5a6f3d950220697b93f02518fff80ad6b6c7d84849f16830374cfe16439510d4 | 15,810 | [
-1
] |
15,811 | defjs.lisp | ahungry_defjs/defjs.lisp | ;; defjs - Common Lisp REPL fun in Javascript
;; Copyright (C) 2014 Matthew Carter
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;; defjs.lisp
(in-package #:defjs)
;;; "defjs" goes here. Hacks and glory await!
(defconstant +toot-port+ 39998)
(defparameter *websocket-port* 39999)
(defparameter *clients* (make-hash-table :test 'equal))
(defparameter *websocket-url* "ws://localhost:39999")
(defparameter *toot* nil)
(defparameter *js* (make-hash-table :test 'equal))
(setf *js-string-delimiter* #\")
(setf *ps-print-pretty* t)
(defmacro defjs (name args &rest fn)
"Set up a parenscript block for later rendering"
`(progn
(setf (gethash (string ',name) defjs:*js*)
(ps (defun ,name ,args ,@fn)))
(broadcast "eval" (list
(cons "code" (format nil "window.~a=~a"
(string-downcase (string ',name))
(gethash (string ',name) defjs:*js*)))))))
(defmacro dojs (&rest fn)
`(broadcast "eval" (list
(cons "code" (ps ,@fn)))))
(defun start-websocket-server (&key (port *websocket-port*)
(server-name "localhost"))
"Begin the websocket server in a thread, assuming thread does not exist"
(setf *websocket-port* port)
(setf *websocket-url* (format nil "ws://~a:~a" server-name port))
(unless (member (format nil "DEFJS Websocket Server (port: ~a)" port)
(mapcar #'thread-name
(all-threads)) :test #'string=)
(make-thread (λ α → (run-server port))
:name (format nil "DEFJS Websocket Server (port: ~a)" port))))
(defclass ws-controller (ws-resource)
())
(defmethod resource-client-connected ((res ws-controller) client)
"Save our client in connection pool"
(setf (gethash (client-host client) *clients*) client)
(format t "Got connection from ~s: ~s~%"
(client-host client)
(client-port client))
(write-to-client-text client "{\"event\":\"Welcome\"}")
t)
(defmethod resource-client-disconnected ((resource ws-controller) client)
"TODO Put some message here"
(format t "Client disconnected from resource ~s: ~s~%" resource client)
t)
(defun ws-clients ()
"Get the list of the clients"
(loop for v being the hash-values in *clients*
collect v))
(defmethod resource-received-text ((res ws-controller) client message)
"This should more or less be a drop in replacement for the existing
way things are piped into the general socket listener and spit back
out at the client."
(let* ((json (cl-json:decode-json-from-string message))
(event (format nil "pseudo::~a" (cdr (assoc :event json))))
(data-in (cdr (assoc :data json))))
(funcall (read-from-string event) data-in client)))
(defmethod resource-received-binary ((res ws-controller) client message)
(format t "Client ~s sent binary frame ~s~%" client message)
(write-to-client-binary client message))
(register-global-resource "/defjs-controller/"
(make-instance 'ws-controller)
(origin-prefix
"http://127.0.0.1"
"http://defjs.ahungry.com"
"http://ahungry.com"
"http://lisp.ahungry.com"
"http://pro"
"http://localhost"))
(make-thread (λ α → (run-resource-listener
(find-global-resource "/defjs-controller/")))
:name "Resource listener for /defjs-controller/")
(ƒ emit-broadcast-data-formatter
(and (listp α) (eq :obj (car α))) → (cdr α)
(and (listp α)
(listp (car α))
(eq :obj (car (car α)))) → (mapcar #'cdr α)
(stringp α) → (decode-json-from-string α)
α → α)
(defun broadcast (event data)
"Receive a list of data items and send to all connected clients"
(let ((json-string (cl-json:encode-json-to-string
(list (cons :event event)
(cons :data (emit-broadcast-data-formatter data))))))
(write-to-clients-text (ws-clients) json-string)))
(defun emit (event data client)
"Send data out to just one individual client"
(let ((json-string (cl-json:encode-json-to-string
(list (cons :event event)
(cons :data (emit-broadcast-data-formatter data))))))
(when client
(write-to-client-text client json-string))
json-string))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defmacro+ps c (&rest data)
`(chain console (log ,@data))))
(defun page-js ()
(ps
;;(defvar *socket-url* (lisp *node-socket-url*))
(defvar *defjs-websocket-url* (+ (lisp *websocket-url*) "/defjs-controller/"))
(defvar defjs-socket-clws)
(defvar *defjs-sock-responses* [])
(defun defjs-sock-on (event fn)
"Bind a function to the sock-responses"
(setf (aref *defjs-sock-responses* event) fn))
(defun defjs-sock-emit (event data)
"Safely send data into the websocket, relink if fail"
(if (and defjs-socket-clws
(eq (@ defjs-socket-clws ready-state) 1))
(progn
(let ((json (chain -j-s-o-n (stringify
(create "event" event
"data" data)))))
(c event json)
(chain defjs-socket-clws (send json))))
(progn
(defjs-socket-start)
(set-timeout (λλ α → (defjs-sock-emit event data)) 1000))))
(defun defjs-socket-start ()
;;(setf socket (chain io (connect *socket-url*)))
(setf defjs-socket-clws (new (-Web-Socket *defjs-websocket-url*)))
;; Response mappings on open
(setf (@ defjs-socket-clws onopen)
(lambda (event)
(setf (@ defjs-socket-clws onmessage)
(λλ α → (progn
(let* ((data (chain -j-s-o-n (parse (@ α data))))
(event (aref *defjs-sock-responses* (@ data event))))
(when event (chain event (call nil (@ data data))))))))))
;; Essentially a Firefox fix for not gracefully closing sockets
(setf (@ window onbeforeunload)
(λλ α → (progn (setf (@ defjs-socket-clws onclose)
(lambda () nil))
(chain defjs-socket-clws (close))))))
(defjs-sock-on "eval"
(λλ α → (progn
(c "Got something from socket")
(c α)
(c (eval (@ α code))))))
(set-timeout (λλ α → (defjs-socket-start)) 1000)
nil))
(defmacro loader ()
`(maphash (lambda (k v)
(declare (ignore k))
(str v)) defjs:*js*))
(defun get-loader ()
"Pull out the cached JS content"
(with-html-output-to-string (s)
(:script (loader))))
(defun page-index ()
"Render the index page"
(with-html-output-to-string (s)
(:html
(:head
(:title "defjs")
(:script :type "text/javascript" :src "/defjs.js")
(:script (loader)))
(:body
(:h1 "Welcome to defjs")
(:p "To get started, in SLIME try out some fun things like:")
(:pre "(defjs:defjs hello-name (name) (alert (+ \"Hello \" name)))")
(:pre "(defjs:dojs (hello-name \"Matt\"))")
(:p "At that point, you should see some results pop up here in the browser. To
find out how to integrate with your own page, "
(:a :href "https://github.com/ahungry/defjs/" "read the full usage guide on Github"))
(:p :style "font-size:8px;" "© http://ahungry.com 2014 Licensed with GPLv3")))))
(defun main ()
"Start webserver, websocket server"
(unless *toot*
;; Start the web server
(setf *toot* (make-instance 'hunchentoot:easy-acceptor
:port +toot-port+))
;;:message-log-destination nil
;;:access-log-destination nil))
(setf (hunchentoot:acceptor-document-root *toot*) #P"www/")
(hunchentoot:start *toot*))
(hunchentoot:define-easy-handler (uri-home :uri "/") ()
(setf (hunchentoot:content-type*) "text/html")
(page-index))
(hunchentoot:define-easy-handler (uri-js :uri "/defjs.js") ()
(setf (hunchentoot:content-type*) "text/javascript")
(page-js))
nil)
| 9,053 | Common Lisp | .lisp | 200 | 36.13 | 95 | 0.595869 | ahungry/defjs | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 338d092a8a9fc0ec555b666e7589bbce7f7b524aba821e5ab5cab29fed8ea5a5 | 15,811 | [
-1
] |
15,812 | defjs.asd | ahungry_defjs/defjs.asd | ;; defjs - Common Lisp REPL fun in Javascript
;; Copyright (C) 2014 Matthew Carter
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;; defjs.asd
(asdf:defsystem #:defjs
:serial t
:description "Common Lisp REPL fun in Javascript"
:author "Matthew Carter <[email protected]>"
:license "GPLv3"
:depends-on (#:bordeaux-threads
#:parenscript
#:clws
#:hunchentoot
#:cl-who
#:cl-json
#:glyphs)
:components ((:file "package")
(:file "defjs")))
| 1,153 | Common Lisp | .asd | 30 | 33.466667 | 72 | 0.677074 | ahungry/defjs | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 42122883f6ac05203f09fe4e26b99899a58acefcf955ef8719ee2c0c308b3af3 | 15,812 | [
-1
] |
15,830 | render.lisp | jsmpereira_common-city/render.lisp | ;;; -*- Mode: Lisp -*-
(in-package :common-city)
(defparameter *screen-width* 1024)
(defparameter *screen-height* 768)
(defparameter *map-width* (* 54 *tile-size*))
(defparameter *map-height* (* 45 *tile-size*))
(defparameter *menu-width* (- *screen-width* *map-width*))
(defparameter *bg-color* (sdl:color :r 136 :g 136 :b 136))
(defparameter *build-color* sdl:*blue*)
(defparameter *map-cursor* :residential)
(defparameter *menu-surface* nil)
(defparameter *map-surface* nil)
(defparameter *text-surface* nil)
(defclass surface ()
((x :initarg :x :accessor x)
(y :initarg :y :accessor y)
(surface :initarg :surface :accessor surface)
(color :initarg :color :accessor color)
(width :initarg :width :accessor width)
(height :initarg :height :accessor height))
(:default-initargs
:color *bg-color*))
(defmethod initialize-instance :after ((surface surface) &key)
(with-slots (width height surface) surface
(setf surface (sdl:create-surface width height))))
(defmethod draw ((surface surface))
(with-slots (x y surface width height color) surface
(sdl:draw-surface-at-* surface x y)
(sdl:fill-surface color :surface surface)
(sdl:draw-rectangle-* 0 0 width height :color sdl:*black* :surface surface)
(sdl:draw-rectangle-* 1 1 width height :color sdl:*white* :surface surface)))
(defun hit-test (button mx my)
(with-slots (x y size sprite-sheet) button
(let ((x (+ x *map-width*))
(height (/ (sdl:height sprite-sheet) size)))
(and (> mx x) (< mx (+ x (sdl:width sprite-sheet))) (> my y) (< my (+ y height))))))
(defun play-sound (asset)
(let ((sound (sdl-mixer:load-sample (getf *audio-assets* asset))))
(sdl-mixer:play-sample sound)))
(defun render-step ()
(loop for k being the hash-keys in *entities* using (hash-value v)
do (draw v)))
(defun menu ()
(maphash #'(lambda (k v)
(draw v)
(unless (eql *map-cursor* (tile-type v))
(setf (sprite-cell v) 0))
(when (and (hit-test v (sdl:mouse-x) (sdl:mouse-y)) (sdl:mouse-left-p))
(setf *map-cursor* (tile-type v))
(setf (sprite-cell v) 1))) *buttons*))
(defun setup-surfaces ()
(setf *map-surface* (make-instance 'surface :x 0 :y 0 :width *map-width* :height *map-height*))
(setf *menu-surface* (make-instance 'surface :x *map-width* :y 0 :width *menu-width* :height *screen-height*))
(setf *text-surface* (make-instance 'surface :x 0 :y *map-height* :width *map-width* :height (- *screen-height* *map-height*))))
(defun render ()
(draw *map-surface*)
(draw *menu-surface*)
(draw *text-surface*)
(render-step)
(menu)
(cursor))
(defun handle-keys (key)
(case key
(:sdl-key-q (sdl:push-quit-event))
(:sdl-key-x (reset))
(:sdl-key-d (setf *map-cursor* :dozer))
(:sdl-key-h (setf *map-cursor* :residential))
(:sdl-key-c (setf *map-cursor* :commercial))
(:sdl-key-n (setf *map-cursor* :nuclear))
(:sdl-key-o (setf *map-cursor* :coal))
(:sdl-key-s (setf *map-cursor* :seaport))
(:sdl-key-u (setf *map-cursor* :stadium))
(:sdl-key-a (setf *map-cursor* :airport))
(:sdl-key-r (setf *map-cursor* :road))
(:sdl-key-t (setf *map-cursor* :rail))
(:sdl-key-w (setf *map-cursor* :wire))
(:sdl-key-g (setf *map-cursor* :garden))
(:sdl-key-i (setf *map-cursor* :industrial))
(:sdl-key-f (setf *map-cursor* :fire-department))
(:sdl-key-p (setf *map-cursor* :police-department)))
(setf (sprite-cell (gethash *map-cursor* *buttons*)) 1))
(defun handle-mouse (x y)
(when (sdl:mouse-left-p)
(case *map-cursor*
(:dozer
(dozer x y)
(play-sound :dozer))
(t
(when (inside-map-p)
(build-tile x y *map-cursor*))))))
(defun inside-map-p ()
"FIXME - duplicate code"
(multiple-value-bind (tile mx my) (snap-to-tile (sdl:mouse-x) (sdl:mouse-y))
(declare (ignore tile))
(let* ((mx (* mx *tile-size*))
(my (* my *tile-size*))
(cursor-size (or (asset-data *map-cursor* 'dimensions) 1))
(dimensions (sdl:cast-to-int (* (sqrt cursor-size) *tile-size*))))
(and (<= (+ mx dimensions) *map-width*) (<= (+ my dimensions) *map-height*)))))
(defun cursor ()
(draw-tooltip (asset-data *map-cursor* 'tooltip :collection *button-assets*)
(asset-data *map-cursor* 'cost :collection *button-assets*))
(multiple-value-bind (tile mx my) (snap-to-tile (sdl:mouse-x) (sdl:mouse-y))
(when tile
(let* ((mx (* mx *tile-size*))
(my (* my *tile-size*))
(cursor-size (asset-data *map-cursor* 'dimensions))
(dimensions (sdl:cast-to-int (* (sqrt cursor-size) *tile-size*))))
(if (and (< mx *map-width*) (< my *map-height*))
(with-slots (x y) tile
(let ((x (* x *tile-size*))
(y (* y *tile-size*)))
(sdl:with-color (col *build-color*)
(sdl:draw-rectangle-* x y dimensions dimensions :surface (surface *map-surface*)))))
(sdl:draw-circle-* (sdl:mouse-x) (sdl:mouse-y) 5 :surface (surface *menu-surface*)))))))
(defun main ()
(sb-int:with-float-traps-masked (:divide-by-zero :invalid :inexact :underflow :overflow)
(sdl:with-init (sdl:sdl-init-video sdl:sdl-init-audio)
(sdl:initialise-default-font)
(sdl:window *screen-width* *screen-height*
:title-caption "Common City"
:icon-caption "Common City"
:double-buffer t)
(setf (sdl:frame-rate) 30)
(sdl-mixer:open-audio)
(sdl:enable-key-repeat nil nil)
(setf sdl-cffi::*image-loaded-p* t) ; hack to load .png
(sdl:init-image :png)
; (sdl:show-cursor nil)
; (sdl:sdl-wm-grab-input :SDL-GRAB-ON)
(setup-surfaces)
(setup-assets)
(reset)
(sdl:with-events ()
(:quit-event ()
(sdl-mixer:close-audio)
(sdl:quit-image)
t)
(:key-down-event (:key key)
(handle-keys key))
(:mouse-motion-event (:state s :x-rel dx :y-rel dy :x x :y y))
(:mouse-button-down-event (:button button :state state :x x :y y))
(:idle ()
(sdl:clear-display *bg-color*)
(handle-mouse (sdl:mouse-x) (sdl:mouse-y))
(let ((connection
(or swank::*emacs-connection* (swank::default-connection))))
(when (and connection (not (eql swank:*communication-style* :spawn)))
(swank::handle-requests connection t)))
(render)
(sdl:update-display))))))
| 6,256 | Common Lisp | .lisp | 151 | 36.960265 | 130 | 0.63617 | jsmpereira/common-city | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | c82e71d4dbcfe6235bb93f3d5c7d63551b07716cc3923f2f8942d125d9073c44 | 15,830 | [
-1
] |
15,831 | assets.lisp | jsmpereira_common-city/assets.lisp | ;;; -*- Mode: Lisp -*-
(in-package #:common-city)
(defparameter *tile-size* 16)
(defparameter *assets-dir*
(merge-pathnames #P"assets/" simcity-config:*base-directory*))
(defparameter *sprite-assets* (make-hash-table :test #'equal))
(defparameter *button-assets* (make-hash-table :test #'equal))
(defparameter *sprite-specs*
`((:residential "residential.png" 9 complex-tile '((0 8)))
(:commercial "commercial.png" 9 complex-tile '((0 8)))
(:nuclear "nuclear.png" 16 complex-tile '(()))
(:coal "coal.png" 16 complex-tile '(()))
(:seaport "seaport.png" 16 complex-tile '(()))
(:stadium "stadium.png" 16 complex-tile '(()))
(:airport "airport.png" 36 complex-tile '(()))
(:road "road.png" 1 sprite-tile '(()))
(:rail "rail.png" 1 sprite-tile '(()))
(:wire "wire.png" 1 sprite-tile '(()))
(:wilderness "wilderness.png" 1 sprite-tile '(()))
(:garden "garden.png" 1 animated-tile '(()))
(:animation-sheet "animation-sheet.png" 1 animated-tile '(()))
(:industrial "industrial.png" 9 complex-tile '(()))
(:fire-department "fire-department.png" 9 complex-tile '(()))
(:police-department "police-department.png" 9 complex-tile '(()))))
(defparameter *button-specs*
`((:dozer "dozer-btn.png" 2 button-tile '() "Bulldoze (D)" 1)
(:road "road-btn.png" 2 button-tile '() "Road (R)" 10)
(:rail "rail-btn.png" 2 button-tile '() "Rail (T)" 20)
(:wire "wire-btn.png" 2 button-tile '() "Power Lines (W)" 5)
(:garden "garden-btn.png" 2 button-tile '() "Park (G)" 10)
(:residential "residential-btn.png" 2 button-tile '() "Residential (H)" 100)
(:commercial "commercial-btn.png" 2 button-tile '() "Commercial (C)" 100)
(:industrial "industrial-btn.png" 2 button-tile '() "Industrial (I)" 100)
(:police-department "police-department-btn.png" 2 button-tile '() "Police Department (P)" 500)
(:fire-department "fire-department-btn.png" 2 button-tile '() "Fire Department (F)" 500)
(:nuclear "nuclear-btn.png" 2 button-tile '(()) "Nuclear Plant (N)" 5000)
(:coal "coal-btn.png" 2 button-tile '(()) "Coal Plant (O)" 3000)
(:seaport "seaport-btn.png" 2 button-tile '(()) "Seaport (S)" 3000)
(:stadium "stadium-btn.png" 2 button-tile '(()) "Stadium (U)" 5000)
(:airport "airport-btn.png" 2 button-tile '(()) "Airport (A)" 10000)))
(defclass asset ()
((surface :initarg :surface :accessor surface)
(width :initarg :width :accessor width)
(height :initarg :height :accessor height)
(name :initarg :name :accessor name)
(path :initarg :path :accessor path)))
(defmethod initialize-instance :after ((asset asset) &key)
(with-slots (path) asset
(setf path (merge-pathnames path *assets-dir*))))
(defgeneric add-asset (asset)
(:documentation "Adds the given asset to the appropriate collection."))
(defclass sprite-asset (asset)
((dimensions :initarg :dimensions :accessor dimensions)
(tile-class :initarg :tile-class :accessor tile-class)
(mappings :initarg :mappings :accessor mappings)))
(defun tile-size (sprite-asset)
(with-slots (height dimensions tile-class) sprite-asset
(let ((dim (/ height dimensions)))
(if (eql tile-class 'button-tile)
dim
(round (min dim (* dimensions *tile-size*)))))))
(defmethod initialize-instance :after ((sprite-asset sprite-asset) &key)
(with-slots (path height width surface dimensions) sprite-asset
(let ((sprite-sheet (sdl-image:load-image path)))
(setf height (sdl:height sprite-sheet))
(setf width (sdl:width sprite-sheet))
(let* ((tile-size (tile-size sprite-asset))
(sprite-cells (loop for y from 0 below height by tile-size
append (loop for x from 0 below width by width
collect (list x y width tile-size)))))
(setf (sdl:cells sprite-sheet) sprite-cells))
(setf surface sprite-sheet))))
(defmethod add-asset ((sprite-asset sprite-asset))
(setf (gethash (name sprite-asset) *sprite-assets*) sprite-asset))
(defclass button-asset (sprite-asset)
((tooltip :initarg :tooltip :accessor tooltip)
(cost :initarg :cost :accessor cost)))
(defmethod add-asset ((button-asset button-asset))
(setf (gethash (name button-asset) *button-assets*) button-asset))
(defun draw-tooltip (tooltip cost)
(sdl:draw-string-solid-* (format nil "~A: $~A" tooltip cost) 10 10 :surface (surface *text-surface*)))
(defun asset-data (asset-key accessor &key (collection *sprite-assets*))
"Return asset data."
(let ((asset-instance (gethash asset-key collection)))
(if asset-instance
(funcall accessor asset-instance)
1)))
(defun initargs-list (asset-spec class)
(closer-mop:finalize-inheritance (find-class class))
(let ((arg-list (mapcan #'closer-mop:slot-definition-initargs
(closer-mop:class-slots (find-class class)))))
(loop for i in (rest (rest (rest arg-list)))
for j in asset-spec
appending `(,i ,j))))
(defun init-assets (collection class)
(dolist (asset-spec collection)
(add-asset (apply #'make-instance class (initargs-list asset-spec class)))))
(defun setup-assets ()
(init-assets *sprite-specs* 'sprite-asset)
(init-assets *button-specs* 'button-asset))
(defparameter *road-mapping*
'(#b1000 3
#b0001 3
#b1001 3
#b1010 4
#b0011 5
#b0011 5
#b0101 6
#b1100 7
#b1110 8
#b1011 9
#b0111 10
#b1101 11
#b1111 12))
(defparameter *audio-assets*
`(:dozer ,(merge-pathnames "rumble.wav" *assets-dir*)
:bop ,(merge-pathnames "bop.wav" *assets-dir*)))
| 5,486 | Common Lisp | .lisp | 117 | 42.880342 | 105 | 0.673462 | jsmpereira/common-city | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 61941954397663aae866001f40cfa7d7d945cb08f1cb5ec50fe3d3f1f4a02f40 | 15,831 | [
-1
] |
15,832 | common-city.asd | jsmpereira_common-city/common-city.asd | (defpackage #:simcity-config (:export #:*base-directory*))
(defparameter simcity-config:*base-directory*
(make-pathname :name nil :type nil :defaults *load-truename*))
(asdf:defsystem #:common-city
:serial t
:description "(Very early) Beginnings of a Simcity clone. Gamedev Sundays."
:author "Jose Santos Martins Pereira <[email protected]>"
:license "Specify license here"
:depends-on (#:lispbuilder-sdl
#:lispbuilder-sdl-image
#:lispbuilder-sdl-mixer
#:lispbuilder-sdl-ttf
#:closer-mop)
:components ((:file "package")
(:file "assets")
(:file "common-city")
(:file "render")))
| 661 | Common Lisp | .asd | 17 | 33.176471 | 77 | 0.669782 | jsmpereira/common-city | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | e3b028a217dee85a090436f477ee6671ec68f22c8d8d63944e46b3556ed05936 | 15,832 | [
-1
] |
15,836 | residential.png | jsmpereira_common-city/assets/residential.png | âPNG
IHDR ê CÎπ pHYs öú iTXtComment Created with GIMPd.e ÎIDAThfiÌôaÇ0FŸ)8gö«X<ÜúiÁÿ5á8ÅÅ+*‚k≤Ñ4‰Öµ€ó∂T"“Kêb3Ò©Qº≥EÄZî ÄõU§◊D0•:@ 8ñÖ¥Áé4 ∞≠˝ÇøP≠ Ôz‡ùÌø˙q~–û∫ŸórjU«b!ù`4…ZÄ◊S”ÔÏ√∑ …∆`M˘ÛÅsÚÅ4ìÿ”~≥0≤$E[XõÅl^Oc«¿;;Èü?â√∫mŒø”€XT≠D ˙Ç ¿˚n£†©òÓ ∞=¯Ÿø}Ù NÆÂÃTADEó IENDÆB`Ç | 354 | Common Lisp | .l | 3 | 117 | 346 | 0.497159 | jsmpereira/common-city | 5 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 160dcbce63eae62c9561148b4d117ad36dd89a7a448ba41fcd9bfb5942093cdf | 15,836 | [
-1
] |
15,851 | document-nudruz.lisp | gogins_csound-extended-nudruz/document-nudruz.lisp | ;;; This file is intended to automatically generate reference documentation
;;; for the nudruz system from declarations and docstrings. It must be run in
;;; the nudruz directory. I have tried a number of tools as documented herein.
;;;
;;; Nothing really works so far. The problems seem to be caused first by
;;; nudruz being a system but not a package, i.e. defining all symbols in the
;;; :cm package, and second by not exporting any of those symbols.
(require :asdf)
(require :cm2)
(require :nudruz)
; helambdap seems to be more flexible than the others, is crashing out on
; missing stuff but may provide help with stubbing it out or avoiding it.
; The navigation stuff is not created properly.
;
; This program does not document Common Music itself. There may be a problem
; with the on-the-fly creation of Lisp objects from Scheme code.
(require :helambdap)
; It seems to be necessary to exclude files that are excluded from nudruz.asd.
(helambdap:document
; This should be the system or the directory where this program is executed.
(asdf:find-system :nudruz)
;#P"~/csound-extended/nudruz/"
:subsystems '(:cm2)
:only-documented nil
:destination #P"~/csound-extended/nudruz/docs/"
:exclude-directories '(#P"./sources/data/"
#P"~/csound-extended/nudruz/examples/"
#P"~/csound-extended/nudruz/tmp/"
#P"~/csound-extended/nudruz/docs/")
:exclude-files '("~/csound-extended/nudruz/sources/scratch.lisp"
#P"~/csound-extended/nudruz/sources/cmn.lisp"
#P"~/csound-extended/nudruz/sources/cs-demo.lisp"
#P"~/csound-extended/nudruz/sources/csnd.lisp"
#P"~/csound-extended/nudruz/sources/dk-screamtest.lisp"
#P"~/csound-extended/nudruz/sources/midi2cs.lisp"
#P"~/csound-extended/nudruz/sources/midi2csound.lisp"
#P"~/csound-extended/nudruz/sources/modes-todo.lisp"
#P"~/csound-extended/nudruz/sources/package.lisp"
#P"~/csound-extended/nudruz/sources/withclocc.lisp")
:clear-documentation-db :before
:documentation-title "nudruz extends cm")
(print "Finished.")
(quit)
; staple "works" but the index page has no contents.
(ql:quickload :staple)
(staple:generate :nudruz)
(print "Finished.")
(quit)
; coo "works" but only for systems, not for packages, thus my issues cripple
; it.
(require :coo)
;(coo::document-system :cm2 :base-path #P"~/csound-extended/nudruz/docs")
(coo::document-system :nudruz :packages '(:cm) :base-path #P"~/csound-extended/nudruz/docs")
(print("Finished.")
(quit)
; helambdap seems to be more flexible than the others, is crashing out on
; missing stuff but may provide help with stubbing it out or avoiding it.
; The navigation stuff is not created properly.
;
; This program does not document Common Music itself. There may be a problem
; with the on-the-fly creation of Lisp objects from Scheme code.
(require :helambdap)
; It seems to be necessary to exclude files that are excluded from nudruz.asd.
(helambdap:document
; This should be the system or the directory where this program is executed.
(asdf:find-system :cm2) ; Doesn't work because .scm files are not .lisp
;#P"~/csound-extended/nudruz/"
:everything '1
:destination #P"~/csound-extended/nudruz/docs/"
:exclude-directories '(#P"./sources/data/"
#P"~/csound-extended/nudruz/examples/"
#P"~/csound-extended/nudruz/tmp/"
#P"~/csound-extended/nudruz/docs/")
:exclude-files '("~/csound-extended/nudruz/sources/scratch.lisp"
#P"~/csound-extended/nudruz/sources/cmn.lisp"
#P"~/csound-extended/nudruz/sources/cs-demo.lisp"
#P"~/csound-extended/nudruz/sources/csnd.lisp"
#P"~/csound-extended/nudruz/sources/dk-screamtest.lisp"
#P"~/csound-extended/nudruz/sources/midi2cs.lisp"
#P"~/csound-extended/nudruz/sources/midi2csound.lisp"
#P"~/csound-extended/nudruz/sources/modes-todo.lisp"
#P"~/csound-extended/nudruz/sources/package.lisp"
#P"~/csound-extended/nudruz/sources/withclocc.lisp")
:clear-documentation-db :before
:documentation-title "nudruz extends cm")
(print "Finished.")
(quit)
; tinaa doesn't work at all.
;(require :tinaa)
;(document-system 'package "cm" "docs")
; codex requires that one declare every symbol to be documented in manual.scr,
; no good.
(require :codex)
(codex:document :nudruz :manifest-path #P"~/csound-extended/nudruz/manifest.lisp")
| 4,447 | Common Lisp | .lisp | 94 | 43.074468 | 92 | 0.722363 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | b87f191be8583817fb886856c800b612f1400f3f26d9323a563894b1d4c6dd8b | 15,851 | [
-1
] |
15,852 | rhythm.lisp | gogins_csound-extended-nudruz/sources/rhythm.lisp | (in-package :cm)
;; CYC-RHYTHMS -- combines measures and subdivisions cyclically
(defun cyc-rhythms (mlens subdivs)
(let* ((subdivcyc (new cycle of subdivs))
(mlencyc (new cycle of mlens)))
(loop until (and (eop? subdivcyc)
(eop? mlencyc))
for this-subdiv = (next subdivcyc)
for this-mlen = (next mlencyc)
append (loop repeat this-subdiv
collect (float (/ this-mlen this-subdiv))))))
;; (cyc-rhythms '(2 3 1.5) '(1 2))
;; = (2.0 1.5 1.5 1.5 1.0 1.0 3.0 0.75 0.75)
;; COMBINE-ATKS -- 'fuses' attacks within a rhythm
;; 'combiner' = number of attacks to combine (cycle)
(defun combine-atks (rhythms atklist)
(let ((rcyc (new cycle of rhythms))
(atkcyc (new cycle of atklist)))
(loop until (and (eop? rcyc) (eop? atkcyc))
collect (apply #'+ (next rcyc (next atkcyc))))))
;; (combine-atks '(1 2) '(1 1 3))
;; = (1 2 4 2 1 5)
;; UPBEATCYC -- returns upbeat cycle
;; between 'minups' and 'maxups' upbeats of 1
;; between 'mindown' and 'maxdown' length of downbeat
(defun upbeatcyc (minups maxups mindown maxdown)
(new cm::random :of `((1 :min ,minups :max ,maxups)
(,(pval (between mindown maxdown)) :max 1))))
(next (upbeatcyc 2 5 10 20) 20)
| 1,211 | Common Lisp | .lisp | 29 | 38.206897 | 63 | 0.652174 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | bce7ec4ef758340691e365149988b24813a8a2a2ac675b3fb4ece1d29796bfc5 | 15,852 | [
-1
] |
15,853 | combinatorics.lisp | gogins_csound-extended-nudruz/sources/combinatorics.lisp | (in-package :cm)
;; COMBINATORICS.LISP -- misc pcset & combinatorics data
(defparameter latinsquare3
'( ( 0 1 2 ) ( 1 2 0 ) ( 2 0 1 ) ))
(defparameter latinsquare4
'( ( 0 1 2 3 ) ( 1 0 3 2 ) ( 2 3 0 1 ) ( 3 2 1 0 )))
(defparameter latinsquare5a
'( ( 0 1 2 3 4 ) ( 1 2 3 4 0 ) ( 2 3 4 0 1 )
( 3 4 0 1 2 ) ( 4 0 1 2 3 ) ))
(defparameter latinsquare5b
'( ( 0 1 2 3 4 ) ( 2 3 4 0 1 ) ( 4 0 1 2 3 )
( 1 2 3 4 0 ) ( 3 4 0 1 2 ) ) )
(defparameter prime-trichords
'((0 4 8) (0 3 7) (0 2 7) (0 3 6) (0 2 6) (0 1 6) (0 2 5) (0 1 5) (0 2 4)
(0 1 4) (0 1 3) (0 1 2)))
;; partitions
(defparameter parts6.3
'( ( 2 2 2 ) ( 3 2 1 ) ( 4 1 1 ) ))
(defparameter parts6.4
'( ( 2 2 1 1 ) ( 3 1 1 1 ) ))
(defparameter parts7.3
'( ( 3 2 2 ) ( 3 3 1 ) ( 4 2 1 ) ( 5 1 1 ) ))
(defparameter parts7.4
'( ( 2 2 2 1 ) ( 3 2 1 1 ) ( 4 1 1 1 ) ))
(defparameter parts8.3
'( ( 3 3 2 ) ( 4 2 2 ) ( 4 3 1 ) ( 5 2 1 ) ( 6 1 1 ) ))
(defparameter parts8.4
'( ( 2 2 2 2 ) ( 3 2 2 1 ) ( 3 3 1 1 ) ( 4 2 1 1 ) ( 5 1 1 1 ) ))
(defparameter parts9.3
'( ( 3 3 3 ) ( 4 3 2 ) ( 4 4 1 ) ( 5 2 2 ) ( 5 3 1 ) ( 6 2 1 )
( 7 1 1 ) ))
(defparameter parts9.4
'( ( 3 2 2 2 ) ( 3 3 2 1 ) ( 4 2 2 1 ) ( 4 3 1 1 ) ( 5 2 1 1 )
( 6 1 1 1 ) ))
(defparameter parts10.3
'( ( 4 3 3 ) ( 4 4 2 ) ( 5 3 2 ) ( 5 4 1 ) ( 6 2 2 ) ( 6 3 1 )
( 7 2 1 ) ( 8 1 1 ) ))
(defparameter parts10.4
'( ( 3 3 2 2 ) ( 3 3 3 1 ) ( 4 2 2 2 ) ( 4 3 2 1 ) ( 4 4 1 1 )
( 5 2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 0 1 0 1
0 1 )
( 1 0 0 0 0 0 0 1 0 1
0 0 )
( 1 0 0 0 0 0 0 1 1 1
0 0 )
( 1 0 0 0 0 0 0 1 1 1
0 1 )
( 1 0 0 0 0 0 0 1 1 1
1 1 )
( 1 0 0 0 0 0 0 1 1 1
1 0 )
( 1 0 0 0 0 0 0 1 1 0
1 0 )
( 1 0 0 0 0 0 0 1 1 0
1 1 )
( 1 0 0 0 0 0 0 1 1 0
0 1 )
( 1 0 0 0 0 0 0 1 1 0
0 0 )
( 1 0 0 0 0 0 0 0 1 0
0 0 )
( 1 0 0 0 0 0 0 0 1 0
0 1 )
( 1 0 0 0 0 0 0 0 1 0
1 1 )
( 1 0 0 0 0 0 0 0 1 0
1 0 )
( 1 0 0 0 0 0 0 0 1 1
1 0 )
( 1 0 0 0 0 0 0 0 1 1
1 1 )
( 1 0 0 0 0 0 0 0 1 1
0 1 )
( 1 0 0 0 0 0 0 0 1 1
0 0 )
( 1 0 0 0 0 0 0 0 0 1
0 0 )
( 1 0 0 0 0 0 0 0 0 1
0 1 )
( 1 0 0 0 0 0 0 0 0 1
1 1 )
( 1 0 0 0 0 0 0 0 0 1
1 0 )
( 1 0 0 0 0 0 0 0 0 0
1 0 )
( 1 0 0 0 0 0 0 0 0 0
1 1 )
( 1 0 0 0 0 0 0 0 0 0
0 1 )
( 1 0 0 0 0 0 0 0 0 0
0 0 ) ))
;; ORDERED PARTITIONS -- 4-12 contained in "data/ordparts.lisp"
;(load "sources/data/ordparts.lisp")
(defun ordered-partitions (n)
(nth n (list nil nil nil nil ordparts4 ordparts5 ordparts6 ordparts7
ordparts8 ordparts9 ordparts10 ordparts11 ordparts12)))
;; UNORDERED PARTITIONS
;; 'n' must be 4 thru 12!!
(defun partitions (n)
(nth n (list nil nil nil nil parts4 parts5 parts6 parts7
parts8 parts9 parts10 parts11 parts12)))
| 266,394 | Common Lisp | .lisp | 13,448 | 15.339976 | 77 | 0.367987 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | b78b717266c6a5a417e4bd157a48142da27eaf58bde27072175f25c69cf1b95b | 15,853 | [
-1
] |
15,854 | fillins.lisp | gogins_csound-extended-nudruz/sources/fillins.lisp | (in-package :cm)
;; This file adds features that were missing for various reasons in Common
;; Music or in Drew Krause's code, or that I have thought worth adding
;; without breaking the framework of Drew's or Common Music's code.
(defun map-subobjects (fn container &key key recurse test type)
"Maps FN to subobjects of CONTAINER, optionally recursively, optionally only
to objects of TYPE. This function is declared in Common Music but not defined
in Vinjar's release of Common Music 2."
(let ((test (if type (lambda (x) (typep x type)) test)))
(if key
(if test
(dolist (o (subobjects container))
(if (and recurse (typep o <container>))
(map-subobjects fn o :key key :recurse recurse
:test test)
(when (funcall test o)
(funcall fn (funcall key o)))))
(dolist (o (subobjects container))
(if (and recurse (typep o <container>))
(map-subobjects fn o :key key :recurse recurse
:test test)
(funcall fn (funcall key o)))))
(if test
(dolist (o (subobjects container))
(if (and recurse (typep o <container>))
(map-subobjects fn o :key key :recurse recurse
:test test)
(when (funcall test o) (funcall fn o))))
(dolist (o (subobjects container))
(if (and recurse (typep o <container>))
(map-subobjects fn o :key key :recurse recurse
:test test)
(funcall fn o)))))
(values)))
(defun map-subcontainers (fn container &key key recurse)
"Maps FN to subcontainers of CONTAINER, optionally recursively, optionally
only to objects of TYPE. This function is declared in Common Music but not
defined in Vinjar's release of Common Music 2."
(if key
(dolist (o (subobjects container))
(when (typep o <container>) (funcall fn (funcall key o)))
(if recurse
(map-subcontainers fn o :key key :recurse recurse)))
(dolist (o (subobjects container))
(when (typep o <container>) (funcall fn o))
(if recurse
(map-subcontainers fn o :key key :recurse recurse))))
(values))
;; (defun gen-poisson-variate (mean &optional (*random-state* *random-state*))
;; "Generate a pseudo-random number from a Poisson distribution
;; with mean M:
;;
;; K - M
;; M %E
;; P(K) = --------
;; K!
;;
;; MEAN = Mean (M) of the distribution, M >= 0
;; STATE = random state to use.
;;
;; The output is an integer.
;; "
;; (declare (type (double-float 0d0) mean))
;; (let ((threshold 30d0))
;; (cond ((< mean threshold)
;; ;; Direct generation
;; (let ((limit (exp (- mean))))
;; (do ((prod (random 1d0))
;; (n 1 (+ n 1)))
;; ((<= prod limit)
;; (- n 1))
;; (declare (fixnum n)
;; (type (double-float 0d0) prod))
;; (setf prod (* prod (random 1d0))))))
;; (t
;; ;; Indirect generation
;; (let* ((alpha #.(coerce 7/8 'double-float)) ; Suggested value
;; (order (floor (* alpha mean)))
;; (x (gen-gamma-variate (dfloat order))))
;; (declare (fixnum order))
;; (if (< x mean)
;; (+ order (gen-poisson-variate (- mean x)))
;; (gen-binomial-variate (1- order)
;; (/ mean x))))))))
;;
(declaim (ftype (function (double-float) integer) gen-poisson-variate))
(defun gen-poisson-variate (mean &optional (*random-state* *random-state*))
"The poisson distribution has the form
p(n) = (mu^n / n!) exp(-mu)
for n = 0, 1, 2, ... . The method used here is the one from Knuth."
(declare (type double-float mu))
(let ((k 0))
(declare (type integer k))
(loop
for m integer = (truncate (* mu (/ 7d0 8d0)))
for X double-float = (random-gamma-int m)
while (> mu 10)
do (if (>= X mu)
(return-from
gen-poisson-variate
(+ k (truncate
(random-binomial (/ mu X) (- m 1)))))
(progn
(incf k m)
(decf mu X))))
(let ((prod 1d0)
(emu (exp (- mu))))
(declare (type double-float prod emu))
(loop
do (progn
(setf prod (* prod (random-uniform)))
(incf k))
while (> prod emu)))
(1- k)))
(defgeneric duration-seconds (sequence)
(:documentation "Returns the duration of the sequence in seconds."))
(defmethod duration-seconds ((sequence seq))
(reduce #'max (mapcar #'(lambda (e) (+ (object-time e)(midi-duration e)))
(subobjects sequence :class 'midi))))
| 4,648 | Common Lisp | .lisp | 119 | 32.890756 | 78 | 0.577393 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | d5c573ceced1e8d2ca7be52565823b0b9055263ee213601babcbabd4c7952303 | 15,854 | [
-1
] |
15,855 | package.lisp | gogins_csound-extended-nudruz/sources/package.lisp | ; This empty file is a workaround for some sort of hiccup that occurs as
; nudruz loads.
| 90 | Common Lisp | .lisp | 2 | 43.5 | 73 | 0.772727 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 6ebc57fbd7714df91613a81a1f380b1b7466565e885e4ab62b69519b9ad50f92 | 15,855 | [
-1
] |
15,856 | crawford.lisp | gogins_csound-extended-nudruz/sources/crawford.lisp | (in-package :cm)
; inspired by J"The Music of Ruth Crawford Seeger"
; (load "nudruz.lisp")
; (load "rewrite.lisp")
; (load "data/besthex.lisp")
;; APPLYING UP/DOWN CONTOURS
;; UDWN -- note-to-note utility for 'make-updown'
(defun udwn (startpit endpit udval &optional (modlen 12))
(let* ((m-startpit (mod startpit modlen))
(m-endpit (mod endpit modlen))
(modfloor (floor (/ startpit modlen)))
(grtrflag
(> m-startpit m-endpit)))
(case udval
(1
(+ m-endpit (* modlen
(+ (if grtrflag 1 0) modfloor))))
(-1
(+ m-endpit (* modlen
(+ (if grtrflag 0 -1) modfloor))))
(t startpit))))
;; MAKE-UPDOWN -- applying +1/-1 contour to 'alist' from first pit
(defun make-updown (alist udvals &optional (modlen 12))
(if (eql 2 (length alist))
(list (car alist) (udwn (car alist) (cadr alist) (car udvals) modlen))
(cons (car alist)
(make-updown
(cons (udwn (car alist) (cadr alist) (car udvals) modlen)
(cddr alist))
(cdr udvals)
modlen))))
;; TAKE-UPDOWN - same as 'directions'
(defun take-updown (melody)
(directions melody))
;; UPDOWN-OPPOSITE -- opposite signs
(defun updown-opposite (udvec)
(mapcar (lambda (x) (* -1 x)) udvec))
;; UPDOWN-RANDOM -- random contour
(defun updown-random (len)
(listsub '(-1 1) '(0 1)
(random-codeword len)))
;; UPDOWN-CONVERSIONS -- list of updown p,i,r,ri
(defun updown-conversions (udvec)
(list udvec
(updown-opposite udvec)
(reverse udvec)
(reverse (updown-opposite udvec))))
;; MAKE-UPDOWN-RANDOM -- apply random updown
(defun make-updown-random (alist &optional (modlen 12))
(make-updown alist
(updown-random (- (length alist) 1))
modlen))
;; FLIP-CONTOUR -- change up/down directions
(defun flip-contour (melody)
(make-updown melody
(updown-opposite (take-updown melody))))
; UPDOWN-FROMTO -- stepwise up/down contour change (incl first & last)
(defun updown-fromto (ud-start ud-end)
(let* ((start01
(listsub '(0 1) '(-1 1) ud-start))
(end01
(listsub '(0 1) '(-1 1) ud-end)))
(mapcar
(lambda (x) (chooser x '(-1 1)))
(fromto-stepper start01 end01))))
;; (all-updowns len) ?
;; neumes = three or four pitches
;; "neumatic transformations" (p. 34)
;; CRAW-INTS
;; each interval is replaced by its complement or compound
(defun craw-ints (neume &optional (modlen 12))
(let* ((neumelint (melint neume))
(neumintlen (length neumelint)))
(mapcar (lambda (x) (melint->line (car neume) x))
(loop for victim to (- neumintlen 1) append
(loop for trindx in '(1 -1) collect
(loop for n to (- neumintlen 1) collect
(if (eql n victim)
(+ (nth n neumelint)
(* trindx modlen))
(nth n neumelint))))))))
;; CRAW-MELCONVERSIONS
(defun craw-melconversions (mymel)
(let* ((mymint (melint mymel))
(mymintit (transp mymint -1 #'*)))
(mapcar
(lambda (x)
(melint->line (car mymel) x))
(list mymint
mymintit
(reverse mymint)
(reverse mymintit)))))
;; CRAW-CONV -- random melconversion
(defun craw-conv (amel)
(pickl (craw-melconversions amel)))
;; CRAW-MULT -- all intervals multiplied by a constant
(defun craw-mult (amel mfactor)
(let* ((amint (melint amel)))
(melint->line (car amel) (transp amint mfactor #'*))))
;; CRAW-ADD -- all intervals expanded/contracted by a constant
(defun craw-add (amel mfactor)
(let* ((amint (melint amel)))
(melint->line (car amel)
(map 'list #'*
(take-updown amel)
(transp (mapcar #'abs amint) mfactor)))))
;; CRAW-PE -- 'partial expansion' (all collected)
;; one interval expands by a semitone
(defun craw-pe (amel)
(let* ((mint (melint amel))
(pevec
(mapcar (lambda (x)
(cond ((plusp x) (+ x 1))
((minusp x) (- x 1))
(t x)))
mint))
(mlen (- (length mint) 1)))
(mapcar
(lambda (x) (melint->line (car amel) x))
(reverse
(set-difference
(loop for m to mlen collect
(loop for n to mlen collect
(if (= m n) (nth n pevec) (nth n mint))))
(list mint)
:test #'seq-eql)))))
;; CRAW-PC -- 'partial expansion' (all collected)
;; one interval contracts by a semitone
(defun craw-pc (amel)
(let* ((mint (melint amel))
(pevec
(mapcar (lambda (x)
(cond ((plusp x) (- x 1))
((minusp x) (+ x 1))
(t x)))
mint))
(mlen (- (length mint) 1)))
(mapcar
(lambda (x) (melint->line (car amel) x))
(reverse
(set-difference
(loop for m to mlen collect
(loop for n to mlen collect
(if (= m n) (nth n pevec) (nth n mint))))
(list mint)
:test #'seq-eql)))))
;; ALL-CRAW -- all transformations
;; useful for 'generic-path' & 'generic-branch'
(defun all-craw (amel &optional (modlen 12))
(remove-duplicates
(append (craw-ints amel)
(craw-melconversions amel)
(loop for n from 1 to 7 collect
(craw-mult amel n))
(loop for n from -11 to 11 collect
(craw-add amel n))
(craw-pe amel))
:test #'seq-eql))
;; ALL-CRAW-PE-PC -- all contractions + expansions
(defun all-craw-pe-pc (amel)
(remove-duplicates
(append (craw-pe amel) (craw-pc amel))
:test #'seq-eql))
;;
;; verse rhythms -- inspired by Crawford
(defun make-verse (len)
(mapcar
(lambda (x) (ferney '(1) x (pickl (cons x (ones&twos x)))))
(randvec len 3 3)))
; verse variations
;; VERSE-SWAPS -- adjacent bars swapped (all possible)
(defun verse-swaps (averse)
(chooser
(allswaps (indices (length averse)))
averse))
;; VERSE-DROPS -- single verse dropped (all possible)
(defun verse-drops (averse)
(let ((verseidx (indices (length averse))))
(mapcar
(lambda (x) (chooser x averse))
(mapcar
(lambda (x)
(safesort
(set-difference verseidx (list x))))
verseidx))))
; SWAPDROP-CHAIN -- recursive random swaps & drops
(defun swapdrop-chain (a-verse len)
(no-nils
(recurz
(lambda (x)
(pickl (append (verse-swaps x)
(verse-drops x))))
a-verse
len)))
| 6,027 | Common Lisp | .lisp | 194 | 26.829897 | 76 | 0.632196 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 2982e3bbaf7938754f3e1263f7233e7cc9d6e2002ce34a6b04b39e7cc0ab2326 | 15,856 | [
-1
] |
15,857 | modes.lisp | gogins_csound-extended-nudruz/sources/modes.lisp | (in-package :cm)
;; examples of working with modes
; (note 51 :in oct) = E5
; (defun oct-1 (transpose oct 'cs)) == same mode up a half-step
; (keynum (note 51 :in oct))
; (loop for i from 1 to 7 collect (keynum (note i :in oct)))
(defun mode-octave (modename)
(slot-value modename 'octave))
(defun mode-size (modename)
(length (slot-value modename 'steps)))
(defun mode-lowest (modename)
(keynum (first (slot-value modename 'lowest))))
(defun mode-steps (modename)
(slot-value modename 'steps))
;; TRANSP-MODE -- make a new mode as a transposition of another one (safest method)
(defun transp-mode (amode tlevel)
(new mode :degrees (transp (append (mode-steps amode) (list (mode-octave amode))) tlevel)))
;; some basic mod12 modes
(defparameter pentatonic (new mode steps '(2 2 3 2 3))) ; 5 members
(defparameter pelog (new mode steps '(1 2 4 1 4))) ; 5 members
(defparameter wholetone (new mode steps '(2 2 2 2 2 2))) ; 6 members
(defparameter wt-0 wholetone)
(defparameter wt-1 (transp-mode wholetone 1))
(defparameter mlt5 (new mode steps '(1 4 1 1 4 1))) ; 6 members
(defparameter symmetric6 (new mode steps '(1 3 1 3 1 3))) ; 6 members
(defparameter ionian (new mode steps '(2 2 1 2 2 2 1))) ; 7 members
(defparameter hminor (new mode steps '(2 1 2 2 1 3 1)))
(defparameter octatonic (new mode steps '(1 2 1 2 1 2 1 2))) ; 8 members
(defparameter mlt4 (new mode steps '(1 1 3 1 1 1 3 1))) ; 8 members
(defparameter mlt6 (new mode steps '(2 2 1 1 2 2 1 1))) ; 8 members
(defparameter mlt3 (new mode steps '(2 1 1 2 1 1 2 1 1))) ; 9 members
(defparameter mlt7 (new mode steps '(1 1 1 2 1 1 1 1 2 1))) ; 10 members
(defparameter chromatic (new mode steps '(1 1 1 1 1 1 1 1 1 1 1 1))) ; 12 members
(defparameter goodmode (new mode steps '(1 1 3 1 1 2 3))) ; 7 members
(defparameter chahargah (new mode steps '(1 3 1 2 1 3 1))) ; 7 members
;; some cooler (not mod 12) modes
(defparameter stravmode (new mode steps '(2 1 2))) ; also "Shur"
(defparameter hyperlydian (new mode steps '(2 2 2 1)))
(defparameter hyperphrygian (new mode steps '(1 2 2))) ; also "Segah"
(defparameter shushtar (new mode steps '(1 2 1 3)))
(defparameter bayati (new mode steps '(2 2 1 2 1))) ; also "Bayati Shiraz"
(defparameter humayun (new mode steps '(1 3 1 2 2)))
;; PLAY-MODE -- a function to convert to keynums
; (play-mode (transp (randmel 20 5) 20) hyperlydian) =
; (37 39 42 39 37 35 41 35 37 42 35 39 41 42 41 37 39 41 37 35)
(defun play-mode (x modename &optional (basenum 0))
(cond
((numberp x)
(keynum (note (+ x basenum) :in modename)))
((listp x)
(loop for y in x collect (play-mode y modename basenum)))
(t 'r)))
;; MODENUMS -- reverse of 'play-mode': returns # in mode for pit or pits
(defun modenums (input modename)
(cond
((numberp input) (keynum input :to modename))
((listp input) (mapcar (lambda (x) (modenums x modename)) input))
(t 'r)))
;; PLAYMODE - a process
(defun playmode (a-list mode basepit durs)
(process
for i in a-list
for thisdur in durs
output (new midi :time (now)
:keynum (note (+ i basepit) :in mode)
:duration (float thisdur))
wait (float thisdur)))
;; MODE-MOTIVE -- places a contour motive into a mode at starting pitch
;; example: (mode-motive 40 '(0 -1 -3) octatonic) = (60 58 55)
(defun mode-motive (startingpit motive mode)
(loop for i in motive
collect (keynum (note (+ startingpit i) :in mode))))
;; SOME-MODE -- collects mode members from 'bottom' to 'top' (above basepit)
(defun some-mode (a-mode basepit bottom top)
(loop for i from bottom to top
collect (+ basepit (keynum (note i :in a-mode)))))
;; MODE-CHORD -- converts mode to chord
(defun mode->chord (a-mode)
(loop for x in
(some-mode a-mode 0 0 12)
if (< x 12) collect x))
;; CW->MODE -- interprets codeword as a set of modal pitches
;; example: (cw->mode '(1 3 0 0 2 1 1 2) ionian 10) =
;; (22 48 41 31 33 46)
(defun cw->mode (codeword a-mode basepit)
(loop for i from 0 to (- (length codeword) 1)
if (not (eq 0 (nth i codeword)))
collect (+ basepit (* 12 (nth i codeword))
(keynum (note i :in a-mode)))))
;; CW->CHORD -- interprets codeword as mod-transposed(!) members of a chord
;; example: (cw->chord '(1 0 2 3 1 2) '(1 3 4 6 9 10) 0 12) =
;; (13 28 42 21 34)
(defun cw->chord (codeword a-chord basepit octavesize)
(loop for i from 0 to (- (length codeword) 1)
if (not (eq 0 (nth i codeword)))
collect (+ basepit (* octavesize (nth i codeword))
(nth i a-chord))))
;; RANDOM-CHORD -- generates pc-list with 'chd-length' members
(defun random-chord (chd-length)
(let ((rand12 (new heap of '(0 1 2 3 4 5 6 7 8 9 10 11))))
(transp-to 0 (safesort
(loop for i from 1 to chd-length collect (next rand12))))))
;; RANDOM-MODE -- makes a random mode with mode-length members
(defun random-mode (mode-length)
(transpose (new mode steps
(melint (append (random-chord mode-length) (list 12))))
(random 12)))
;; CHORD-COMPLEMENT -- all pc's mod 12 outside of a chord
(defun chord-complement (a-chord)
(set-difference '(0 1 2 3 4 5 6 7 8 9 10 11) a-chord))
;; TINTAB -- nearest 'modal' counterline to a melody
;; (tintab '(50 51 52 53 54 55 56 57 58) stravmode) =
;; (50 50 52 53 53 55 55 57 58)
(defun tintab (input modename)
(cond ((eql input 'r) 'r)
((numberp input)
(keynum (note (keynum input :to modename)
:in modename)))
((listp input) (loop for x in input collect
(tintab x modename)))))
;; fun with chords
; (prime-form '(60 20 3)) = (0 3 7)
; (octave-number 70) = 4
; (pitch-class 40) = 4
;; PLAYING MODES WITH CODES
;
;(load "data/codes.lisp")
;
;(define (dochords2)
; (let ((codeheap (new heap of code-7p3)))
; (process repeat 200
; do (doeach (k (cw->mode (next codeheap) (random-mode 7) 40))
; (output (new midi :keynum k :time (now))))
; wait .1)))
;
;(events (dochords2) "that.midi")
;; PLAYING MODES WITH CHORDS
;(load "data/chords.lisp")
;(define (dochords3)
; (let ((codeheap (new heap of code-7p3)))
; (process repeat 200
; do (doeach (k (cw->mode (next codeheap) (random-mode 7) 40))
; (output (new midi :keynum k :time (now))))
; wait .1)))
;(events (dochords3) "that.midi")
;;; added June 2005
;; MAKE-TTMODE -- random twelve-tone row in "size" # of octaves
(defun make-ttmode (size)
(let* ((hp (make-poly (heapvec 11 11 1) (list (/ 12 size))))
(modepits (loop for x to (- (length hp) 1) append
(transp (safesort (nth x hp)) (* x 12))))
(topoctave (list (* 12 size))))
(new mode :degrees (append (list 0) modepits topoctave))))
;; added Feb 2012
;; FIELD-MOD12P -- test for all mod12 pits included in (registral) field
(defun field-mod12p (field)
(list-eql (indices 12)
(safesort (remove-duplicates
(mod12 field)))))
; RANGE-IN-MODE -- gives all mode-pits between [true keynums] 'minpit' and 'maxpit'
(defun range-in-mode (minpit maxpit a-mode)
(no-nils
(loop for n from minpit to maxpit collect (keynum n :in? a-mode))))
; MODE-MOD12P -- mod12 test for mode from 'truepit-min' to 'truepit-max'
(defun mode-mod12p (minpit maxpit a-mode)
(field-mod12p (range-in-mode minpit maxpit a-mode)))
;; MOD12-COLLECT -- collects 'inlist' into sublists by mod12
;; returns (list 'r) if mod is not in list
(defun mod12-collect (inlist)
(mapcar (lambda (x) (if (eql x nil) (list 'r) x))
(loop for modnum in (indices 12) collect
(filter (lambda (x) (eql (mod12 x) modnum)) inlist))))
;; PLACE-BY-MOD12
(defun place-by-mod12 (alist fieldrange)
(let ((mod12-fields (mod12-collect fieldrange)))
(loop for x in alist collect
(if (numberp x) (pickl (nth (mod12 x) mod12-fields)) (place-by-mod12 x fieldrange)))))
| 7,868 | Common Lisp | .lisp | 177 | 41.084746 | 92 | 0.6546 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | afca75cdf2b773636624199c437efe756fcba794a0376a0a71e41f630c4c70c9 | 15,857 | [
-1
] |
15,858 | spears.lisp | gogins_csound-extended-nudruz/sources/spears.lisp | (in-package :cm)
;; from "ampsums" files
;; SPEAR->SLOTS -- interface with imported SPEAR files
;; gives "raw" melodies (rpted notes)
(defun spear->slots (svec)
(loop for part in svec collect
(let* ((frqs (first part))
(slots (second part))
(last-slot (car (last slots))))
(loop for n to last-slot collect
(if (member n slots)
(round
(keynum (nth (position n slots) frqs) :hz 't)) 'r)))))
;; SPEARMELS -- gives 'tied' melodies
(defun spearmels (svec)
(let ((spslots (spear->slots svec)))
(loop for x in spslots collect
(list (norpt x) (tievec x)))))
;; PLAYSPEARS -- plays all melodies in an imported spears
(defun playspears (svec &optional (basedur .25))
(let ((smel (spearmels svec)))
(loop for x in smel collect
(splay (first x)
(sum-across basedur (second x))))))
;; from "amps" files
(defun blips->slots (avec)
(let* ((keyslots
(sort
(remove-duplicates
(loop for blip in avec collect
(list (round (keynum (first blip) :hz 't)) (second blip)))
:test #'list-eql)
(lambda (x y) (< (second x) (second y)))))
(slotlen (second (car (last keyslots))))
(outvec (loop repeat slotlen collect (list 'r))))
(loop for ks in keyslots do
(push (first ks) (nth (- (second ks) 1) outvec))
finally (return outvec))))
| 1,493 | Common Lisp | .lisp | 38 | 30.710526 | 76 | 0.563925 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 52386583a52c0d74966852105d5221f0e292499f452b8d1c77e546ec4f9b443b | 15,858 | [
-1
] |
15,859 | vendor.lisp | gogins_csound-extended-nudruz/sources/vendor.lisp | (in-package :cm)
;; Functions imported from depencency projects not in QuickLisp
;;--------------------------------------------------
;; FROM rsm.mod
(defun %get-powers (k n)
"Get the list of the factor <k> that appears in <n>."
(loop
:with nn = n
:with facts = nil
:while (= (mod nn k) 0) :do
(setf nn (/ nn k))
(push k facts)
:finally (return facts)))
(defun %get-powers-of-2-3 (n)
"Get the list of the primes 2 and 3 that occur in <n>."
(let ((2-facts (%get-powers 2 n))
(3-facts (%get-powers 3 n)))
(nconc 2-facts 3-facts)))
(defun factors (n &key (no-dups t))
"Computes and returns a list of the primes factors of <n>. If <no-dups> is
true, then no multiple entries of a factor are returned.
Example: (rsm.mod:factors 100)
(2 5)
Example: (rsm.mod:factors 100 :no-dups nil)
(2 2 5 5)"
(let ((2-3-facts (%get-powers-of-2-3 n)))
(let ((other-facts
(loop
:with nn = (/ n (apply #'cl:* 2-3-facts))
:with m = (isqrt nn)
:with k = 5
:with factors = nil
:with skip fixnum = 2
:while (<= k m) :do
(if (= (mod nn k) 0)
(progn
(setf nn
(do ((n1 nn (/ n1 k)))
((> (mod n1 k) 0) n1)
(push k factors)))
(setf m (isqrt nn)))
(progn
(incf k skip)
(if (= skip 2)
(setf skip 4)
(setf skip 2))))
:finally (return (nreverse
(if (> nn 1)
(cons nn factors)
factors))))))
(if no-dups
(delete-duplicates
(nconc 2-3-facts other-facts))
(nconc 2-3-facts other-facts)))))
;;--------------------------------------------------
;; FROM cllib/simple
(defmacro with-collect ((&rest collectors) &body forms)
"Evaluate forms, collecting objects into lists.
Within the FORMS, you can use local macros listed among collectors,
they are returned as multiple values.
E.g., (with-collect (c1 c2) (dotimes (i 10) (if (oddp i) (c1 i) (c2 i))))
==> (1 3 5 7 9); (0 2 4 6 8) [2 values]
In CLISP, push/nreverse is about 1.25 times as fast as pushing into the
tail, so this macro uses push/nreverse on CLISP and push into the tail
on other lisps (which is 1.5-2 times as fast as push/nreverse there)."
#+clisp
(let ((ret (mapcar (lambda (cc) (gensym (format nil "~s-RET-" cc)))
collectors)))
`(let (,@ret)
(declare (list ,@ret))
(macrolet ,(mapcar (lambda (co re) `(,co (form) `(push ,form ,',re)))
collectors ret)
,@forms
(values ,@(mapcar (lambda (re) `(sys::list-nreverse ,re)) ret)))))
#-clisp
(let ((ret (mapcar (lambda (cc) (gensym (format nil "~s-RET-" cc)))
collectors))
(tail (mapcar (lambda (cc) (gensym (format nil "~s-TAIL-" cc)))
collectors))
(tmp (mapcar (lambda (cc) (gensym (format nil "~s-TMP-" cc)))
collectors)))
`(let (,@ret ,@tail)
(declare (list ,@ret ,@tail))
(macrolet ,(mapcar (lambda (co re ta tm)
`(,co (form)
`(let ((,',tm (list ,form)))
(if ,',re (setf (cdr ,',ta) (setf ,',ta ,',tm))
(setf ,',re (setf ,',ta ,',tm))))))
collectors ret tail tmp)
,@forms
(values ,@ret)))))
;;--------------------------------------------------
;; FROM cllib/math.lisp
(defun subsets (set)
"return a list of all subsets of the given set (represented as a list)"
(let ((first (first set)) (rest (rest set)))
(if rest
(let ((others (subsets rest)))
(nconc others
(mapcar (lambda (subset)
(cons first subset))
others)))
(list nil (list first)))))
(defun make-vector-indexed (len)
"Return a simple vector #(0 1 ... (1-len))."
(let ((vv (make-array len)))
(dotimes (ii len vv)
(setf (aref vv ii) ii))))
(defun vector-shuffle (vec)
"Generate a random permutation of the vector in place.
If the argument is a number, return a new random vector of this length.
Uses the Fisher/Yates algorithm, see
Knuth, TAOCP vol 2 Algorithm 3.4.2P, p.145
R.A. Fisher & F. Yates, Statistical Tables, London 1938, Example 12
R. Durstenfeld, CACM 7 (1964), 420.
This is more or less the same as
(permutation vec (random (! (length vec))))
except that the factorial is likely to be far too large for `random'."
(etypecase vec
(vector (loop :for ii :downfrom (1- (length vec)) :to 1
:for jj = (random (1+ ii))
:unless (= jj ii)
:do (rotatef (aref vec ii) (aref vec jj)))
vec)
(number (vector-shuffle (make-vector-indexed vec)))))
(defun permutation
(vec nth &optional (len (1- (length vec))) (fact (alexandria:factorial len)))
"Generate the NTH permutation of the vector VEC in place.
The algorithm is similar to the standard Fisher/Yates one, but instead
of random numbers [a_n-1,...,a_1] it represents a number in [0;n!] as
x = a_n-1*(n-1)! + ... + a_1
The original vector is returned when NTH = (1- (! (length vec)))."
(loop :for ff = fact :then (/ ff ii)
:for ii :downfrom len :to 1 :with jj
:do (setf (values jj nth) (floor nth ff))
:unless (= jj ii)
:do (rotatef (aref vec ii) (aref vec jj)))
vec)
(defmacro with-permutations-shuffle ((var vec &optional ret-form) &body body)
"Gererate the successive shufflings of vector VEC using `permutation'.
VEC is not modified, VAR storage is allocated only once,
not n! times, and reused.
The return value is RET-FORM, if given, or the number of
permutations generated (i.e., n!).
The original vector is the last one returned."
(alexandria:with-gensyms (vv len len1 fact ii jj tot)
`(let* ((,vv ,vec) (,len (length ,vv)) (,len1 (1- ,len)) (,fact (alexandria:factorial ,len1))
(,var (copy-seq ,vv)) (,tot (* ,len ,fact)))
(dotimes (,ii ,tot ,(or ret-form tot))
(dotimes (,jj ,len) (setf (aref ,var ,jj) (aref ,vv ,jj)))
(permutation ,var ,ii ,len1 ,fact)
,@body))))
(defun check-permutations-end (name found length)
(let ((fact (alexandria:factorial length)))
(unless (= found fact)
(error "~s: generated ~:d permutation~:p, not ~d!=~:d, as expected"
name found length fact))))
(defmacro with-permutations-swap ((var vec &optional ret-form) &body body)
"Bind VAR to each permutation of vector VEC in turn, then execute the BODY.
Thus, BODY is evaluated (! (length vec)) times.
VEC is not modified; VAR storage is allocated only once,
not n! times, and reused.
The return value is RET-FORM, if given, or the number of
permutations generated (i.e., n!).
The permutations are generated by transposing adjacent elements,
according to the CACM algorithm 115 [H.F.Trotter, Comm ACM 5 (Aug 1962) 434].
The original vector is the last one returned."
(alexandria:with-gensyms (nn pp dd kk qq ii done top)
`(let* ((,var (copy-seq ,vec)) (,ii 0) (,nn (length ,var))
(,top (- ,nn 2)) (,kk 0) (,qq 0) (,done nil)
(,pp (make-array (1- ,nn) :element-type 'fixnum
:initial-element -1))
(,dd (make-array (1- ,nn) :element-type 'fixnum
:initial-element 1)))
(declare (type (array fixnum (*)) ,pp ,dd) (fixnum ,kk ,qq))
(loop
(tagbody
(setq ,kk 0 ,top (- ,nn 2))
:index
(setf ,qq (+ (aref ,pp ,top) (aref ,dd ,top))
(aref ,pp ,top) ,qq)
(when (= ,qq (1+ ,top))
(setf (aref ,dd ,top) -1)
(go :loop))
(when (/= -1 ,qq) (go :swap))
(setf (aref ,dd ,top) 1)
(incf ,kk)
:loop
(when (> ,top 0)
(decf ,top)
(go :index))
(setq ,qq 0 ,done t)
:swap
(incf ,qq ,kk) (rotatef (aref ,var ,qq) (aref ,var (1+ ,qq))))
;;(format t "~4d * ~s [k ~d] [n ~d] [p ~s] [d ~s] [q ~d] [done ~s]~%"
;; ,ii ,var ,kk ,top ,pp ,dd ,qq ,done)
(incf ,ii)
,@body
(when ,done
(check-permutations-end 'with-permutations-swap ,ii ,nn)
(return ,(or ret-form ii)))))))
(defmacro with-permutations-lex ((var len &optional ret-form) &body body)
"Bind VAR to each permutation of vector [0:LEN-1] in turn,
then execute the BODY - i.e, BODY is evaluated (! len) times.
VAR storage is allocated only once, not n! times, and reused.
The return value is RET-FORM, if given, or the number of
permutations generated (i.e., n!).
The permutations are generated in the lexicographic order,
according to the CACM algorithm 202 [M.K.Shen, Comm ACL 6 (Sept 1963) 517]."
(alexandria:with-gensyms (ll nn ww ii)
`(let* ((,ll ,len) (,var (make-vector-indexed ,ll)) (,nn 0))
(declare (fixnum ,ll ,nn))
(loop
(unless (zerop ,nn)
(let ((,ww (1- ,ll)))
(declare (fixnum ,ww))
(do () ((or (zerop ,ww) (< (aref ,var (1- ,ww)) (aref ,var ,ww))))
(decf ,ww))
(when (zerop ,ww)
(check-permutations-end 'with-permutations-lex ,nn ,ll)
(return ,(or ret-form nn)))
(let ((,ii (position (aref ,var (1- ,ww)) ,var
:from-end t :test #'<)))
(rotatef (aref ,var (1- ,ww)) (aref ,var ,ii)))
(dotimes (,ii (ash (- ,ll ,ww) -1))
(rotatef (aref ,var (- ,ll ,ii 1)) (aref ,var (+ ,ww ,ii))))))
(incf ,nn)
,@body))))
(defun permutations-list (vec &key (method :lex))
"Return the list of all the permutations of the vector VEC.
The order in which the permutations are listed is either
lexicographic (when :METHOD is :LEX, which is the default),
in which case `with-permutations-lex' is used;
shuffling (when :METHOD is :SHUFFLE)
in which case `with-permutations-shuffle' is used;
transposing adjacent elements (when :METHOD is :SWAP),
in which case `with-permutations-swap' is used.
:SWAP is more than twice as fast as :LEX
and more that 10 times as fast as :SHUFFLE"
(declare (ignorable method))
(with-collect (coll)
(ecase method
(:lex (with-permutations-lex (vv (length vec))
(let ((tv (copy-seq vec)))
(dotimes (ii (length vec))
(setf (aref tv ii) (aref vec (aref vv ii))))
(coll tv))))
(:shuffle (with-permutations-shuffle (vv vec) (coll (copy-seq vv))))
(:swap (with-permutations-swap (vv vec) (coll (copy-seq vv))))))) | 10,948 | Common Lisp | .lisp | 249 | 35.208835 | 97 | 0.549148 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 2785fe418a4ab532e53dbbb40297cd24332c7ee5d3a7e372f6d0f6c1c667c5ca | 15,859 | [
-1
] |
15,860 | debruijn.lisp | gogins_csound-extended-nudruz/sources/debruijn.lisp | (in-package :cm)
; De Bruijn sequences
; like Eulerian paths, contain all subwords
; K = 2, N = 4; length 16
(defparameter debrn2n4
'(0 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1))
; K = 2, N = 5; length 32
(defparameter debrn2n5
'(0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0
1 1 1 0 1 0 1 1 0 1 1 1 1 1))
; K = 2, N = 6; length 64
(defparameter debrn2n6
'(0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1
0 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 1 0 1
0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1))
; K = 2, N = 7; length 128
(defparameter debrn2n7
'(0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 1 1 1
0 0 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 1 1 1
0 0 1 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 1 1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024, 11:27:22 AM (Europe/Amsterdam) | 7c9fcade2eecf6634fb1f1cd605bc13618db83d42e24f20f77d14d5f4eb17c97 | 15,860 | [
-1
] |
15,861 | nondet.lisp | gogins_csound-extended-nudruz/sources/nondet.lisp | ;;(in-package :cm)
;;(use-package :screamer)
;; load nondeterminism stuff ;;;; not (use-package 'screamer)
(in-package :screamer-user)
(defun list-eql (list1 list2)
(and (subsetp list1 list2)
(subsetp list2 list1)
(= (length list1) (length list2))))
;; N-OF-LIST -- utility for wiggle-to2
(defun n-of-list (n l)
(if (= n 0) '()
(cons (a-member-of l) (n-of-list (- n 1) l))))
;; N-OF-LISTV -- similar utility
(defun n-of-listv (n l)
(if (= n 0) '()
(cons (a-member-ofv l) (n-of-list (- n 1) l))))
;; WIGTO -- using only specified intervals in path from 'startnum' to 'endnum'
;; with any length for 'allowed-ints' list
;; J. Siskind's solution
(defun wigto (startnum endnum maxlen allowed-ints)
(remove-duplicates
(all-values
(let ((multvars (n-of-list (screamer::an-integer-between 0 maxlen) allowed-ints)))
(unless (= (reduce #'+ multvars) (- endnum startnum)) (fail))
multvars))
:test #'list-eql))
;; EQLSUM -- finds all combos of 'componentnums' that sum to 'targetnum'
(defun eqlsum (targetnum componentnums)
(remove-duplicates
(all-values
(let* ((maxlen (ceiling (/ targetnum (reduce #'min componentnums))))
(multvars (n-of-list (screamer::an-integer-between 0 maxlen) componentnums)))
(unless (= (reduce #'+ multvars) targetnum) (fail))
multvars))
:test #'list-eql))
;; EBT -- list of random 'neighbor' triads to triad
;; with largest leap of 'span' and same sum
;; example: (ebt '(3 5 6) 1) = ((2 5 7) (3 4 7))
;; used by 'embell-triad' wrapper in nudruz.lisp
(defun ebt (triad &optional (span 3))
(remove-duplicates
(all-values
(let* ((triadsum (apply #'+ triad))
(sortd (sort triad #'<))
(a (screamer::an-integer-between (max 0 (- (first sortd) span))
(+ (first sortd) span)))
(b (screamer::an-integer-between (- (second sortd) span)
(+ (second sortd) span)))
(c (screamer::an-integer-between (- (third sortd) span)
(+ (third sortd) span))))
(assert! (= (+ a b c) triadsum))
(assert! (not (or (= a b) (= a c) (= b c))))
(assert! (not (list-eql (list a b c) sortd)))
(list a b c))) :test #'list-eql))
;; NEAR-EBT -- list of random 'neighbor' triads to triad
;; with largest leap of 'span' and sum within 'sumspan' range of orig. sum
;; example: (ebt '(3 5 6) 1) = ((2 5 7) (3 4 7))
;; used by 'embell-triad' wrapper in nudruz.lisp
(defun near-ebt (triad &optional (sumspan 5) (span 3))
(remove-duplicates
(all-values
(let* ((triadsum (apply #'+ triad))
(sortd (sort triad #'<))
(a (screamer::an-integer-between (max 0 (- (first sortd) span))
(+ (first sortd) span)))
(b (screamer::an-integer-between (- (second sortd) span)
(+ (second sortd) span)))
(c (screamer::an-integer-between (- (third sortd) span)
(+ (third sortd) span))))
(assert! (< (abs (- (+ a b c) triadsum)) sumspan))
(assert! (not (or (= a b) (= a c) (= b c))))
(assert! (not (list-eql (list a b c) sortd)))
(list a b c))) :test #'list-eql))
;; ALL-BTWN -- all numbers between & incl. two nums,
;; allows for ascending/descending
(defun all-btwn (num1 num2)
(if (> num2 num1)
(all-values
(screamer::an-integer-between num1 num2))
(reverse
(all-values
(screamer::an-integer-between num2 num1)))))
;; CONTOUR-CONSTRAINTS-ND
;; utility to establish constraints for "non-to-clists"
(defun contour-constraints-nd (antn cvec)
(eval
(cons 'andv
(loop for n to (- (length antn) 1) collect
(funcall (case (nth n antn)
(1 '<v)
(0 '=v)
(-1 '>v))
(nth n cvec)
(nth (+ n 1) cvec))))))
;; NTN-TO-CLISTS
;; returns all contour vectors within binsize
;; that comply with ntn (note-to-note) list
;; (ntn-to-clists '(-1 1) 3) = ((1 0 1) (2 0 1) (1 0 2) (2 0 2) (2 1 2))
(defun ntn-to-clists (antn binsize)
(all-values
(let* ((alen (+ (length antn) 1))
(cvec (n-of-listv alen (all-btwn 0 (- binsize 1)))))
(assert! (contour-constraints-nd antn cvec))
(solution cvec
(reorder #'domain-size
#'(lambda (x) (declare (ignore x)) nil)
#'<
#'divide-and-conquer-force)))))
;; stacked canon stuff
;; first species stacked canon
(defun intv (x y)
(- y x))
(defun abs-intv (x y &optional (modlen 12))
(mod (abs (- y x)) modlen))
(defun consn-p (x y &optional (consnlist '(3 4 7 8 9 12)))
(or (eql x 'r)
(eql y 'r)
(member (abs-intv x y) consnlist)))
;; CANTEST -- useful deterministic test for nondet canons
;; tlevel = comes transposition level
;; skip = # places skipped
(defun cantest (inlist tlevel &optional (skip 1) (consvec '(3 4 7 8 9 12)))
(not (set-difference
(mapcar #'intv (nthcdr skip inlist)
(mapcar (lambda (x) (+ x (* skip tlevel)))
inlist))
consvec)))
;; SCAN-CONSTRAINT-ND -- checks for melodies that pass stacked canon test
(defun scan-constraint-nd (invec tlevel vcs &optional (consvec '(3 4 7 8 9 12)))
(eval
(cons 'andv
(loop for n from 1 to (- vcs 1) collect
(funcallv #'cantest invec tlevel n consvec)))))
;; SCANONS-ND -- finds all permissible melodies for stacked canons
;; mlen = length of melody
;; tlevel = canon interval
;; vcs = total number of voices in the canon
;; consvec = mod12 consonances
(defun scanons-nd (mlen tlevel vcs &optional (consvec '(3 4 7 8 9 12)))
(all-values
(let ((cvec (n-of-list mlen '(0 1 2 3 4 5 6 7 8 9 10 11))))
(assert! (scan-constraint-nd cvec tlevel vcs consvec))
(solution cvec
(reorder #'domain-size
#'(lambda (x) (declare (ignore x)) nil)
#'<
#'linear-force)))))
;; TZPATHFACTORS -- computes paths to any transposition
;; returns all vectors (lr# ud# diag#)
(defun tzpathfactors (x y tlevel &optional (modlen 12))
(all-values
(let ((n (screamer::an-integer-between
(* -1 (floor (/ modlen (* 2 x))))
(floor (/ modlen (* 2 x)))))
(m (screamer::an-integer-between
(* -1 (floor (/ modlen (* 2 y))))
(floor (/ modlen (* 2 y)))))
(p (screamer::an-integer-between -6 6)))
(unless (= tlevel (mod
(+ (* n x) (* m y) (* p (+ x y)))
modlen))
(fail))
(list n m p))))
;;
; BESTMATCH
;; NONMATCH -- 'pairlist' in from 'nudruz/non-matches'
;; 'vars1' & 'vars2' from 'bestmatch'
(defun nonmatch (pairlist vars1 vars2)
(eval
(cons 'andv
(mapcar
(lambda (x) (notv (equalv (nth (first x) vars1)
(nth (second x) vars2))))
pairlist))))
;; BESTMATCH
(defun bestmatch (len1 len2 pairlist)
(all-values
(let* ((maxlen (+ len1 len2))
(mel1places
(n-of-list len1 (loop for n to (- maxlen 1) collect n)))
(mel2places
(n-of-list len2 (loop for n to (- maxlen 1) collect n))))
(assert!
(eval
(cons '<v mel1places)))
(assert!
(eval
(cons '<v mel2places)))
(assert!
(eql 0 (apply #'min (append mel1places mel2places))))
(assert!
(eql (length (remove-duplicates (append mel1places mel2places)))
(+ 1 (apply #'max (append mel1places mel2places)))))
(assert!
(nonmatch pairlist mel1places mel2places)))
(list mel1places mel2places)))
;; call with "(screamer-user::wiggle-to2 45 48 8 '(2 -1))" etc.
| 8,036 | Common Lisp | .lisp | 197 | 32.365482 | 88 | 0.552881 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 7372a117f5f0396c3f0156febc1a5670a5940d5686f7b4ed057732df1b49af16 | 15,861 | [
-1
] |
15,862 | pplanes.lisp | gogins_csound-extended-nudruz/sources/pplanes.lisp | (in-package :cm)
;; pplanes.lisp -- projective planes (all vectors share only one element)
; gap> D := PGPointFlatBlockDesign(221);; D.blocks; BlockNumbers(D);
; size 7
(defparameter pplane3
'( ( 1 2 3 ) ( 1 4 5 ) ( 1 6 7 ) ( 2 4 6 ) ( 2 5 7 )
( 3 4 7 ) ( 3 5 6 ) ))
; gap> D := PGPointFlatBlockDesign(231);; D.blocks; BlockNumbers(D);
; size 13
(defparameter pplane4
'( ( 1 2 3 4 ) ( 1 5 6 7 ) ( 1 8 9 10 ) ( 1 11 12 13 )
( 2 5 8 11 ) ( 2 6 9 12 ) ( 2 7 10 13 ) ( 3 5 9 13 )
( 3 6 10 11 ) ( 3 7 8 12 ) ( 4 5 10 12 ) ( 4 6 8 13 )
( 4 7 9 11 ) ))
; gap> D := PGPointFlatBlockDesign(241);; D.blocks; BlockNumbers(D);
; size 21
(defparameter pplane5
'( ( 1 2 3 4 5 ) ( 1 6 7 8 9 ) ( 1 10 11 12 13 )
( 1 14 15 16 17 ) ( 1 18 19 20 21 ) ( 2 6 10 14 18 )
( 2 7 11 15 19 ) ( 2 8 12 16 20 ) ( 2 9 13 17 21 )
( 3 6 11 16 21 ) ( 3 7 10 17 20 ) ( 3 8 13 14 19 )
( 3 9 12 15 18 ) ( 4 6 12 17 19 ) ( 4 7 13 16 18 )
( 4 8 10 15 21 ) ( 4 9 11 14 20 ) ( 5 6 13 15 20 )
( 5 7 12 14 21 ) ( 5 8 11 17 18 ) ( 5 9 10 16 19 ) ))
; gap> D := PGPointFlatBlockDesign(251);; D.blocks; BlockNumbers(D);
; size 31
(defparameter pplane6
'( ( 1 2 3 4 5 6 ) ( 1 7 8 9 10 11 ) ( 1 12 13 14 15 16 )
( 1 17 18 19 20 21 ) ( 1 22 23 24 25 26 )
( 1 27 28 29 30 31 ) ( 2 7 12 17 22 27 )
( 2 8 13 18 23 28 ) ( 2 9 14 19 24 29 )
( 2 10 15 20 25 30 ) ( 2 11 16 21 26 31 )
( 3 7 13 19 25 31 ) ( 3 8 14 21 22 30 )
( 3 9 16 20 23 27 ) ( 3 10 12 18 26 29 )
( 3 11 15 17 24 28 ) ( 4 7 14 20 26 28 )
( 4 8 16 17 25 29 ) ( 4 9 15 18 22 31 )
( 4 10 13 21 24 27 ) ( 4 11 12 19 23 30 )
( 5 7 15 21 23 29 ) ( 5 8 12 20 24 31 )
( 5 9 13 17 26 30 ) ( 5 10 16 19 22 28 )
( 5 11 14 18 25 27 ) ( 6 7 16 18 24 30 )
( 6 8 15 19 26 27 ) ( 6 9 12 21 25 28 )
( 6 10 14 17 23 31 ) ( 6 11 13 20 22 29 ) ))
; gap> D := PGPointFlatBlockDesign(271);; D.blocks; BlockNumbers(D);
; size 57
(defparameter pplane8
'( ( 1 2 3 4 5 6 7 8 ) ( 1 9 10 11 12 13 14 15 )
( 1 16 17 18 19 20 21 22 ) ( 1 23 24 25 26 27 28 29 )
( 1 30 31 32 33 34 35 36 ) ( 1 37 38 39 40 41 42 43 )
( 1 44 45 46 47 48 49 50 ) ( 1 51 52 53 54 55 56 57 )
( 2 9 16 23 30 37 44 51 ) ( 2 10 17 24 31 38 45 52 )
( 2 11 18 25 32 39 46 53 ) ( 2 12 19 26 33 40 47 54 )
( 2 13 20 27 34 41 48 55 ) ( 2 14 21 28 35 42 49 56 )
( 2 15 22 29 36 43 50 57 ) ( 3 9 17 25 33 41 49 57 )
( 3 10 19 28 32 37 50 55 ) ( 3 11 21 27 36 40 44 52 )
( 3 12 18 29 35 38 48 51 ) ( 3 13 16 26 31 43 46 56 )
( 3 14 22 23 34 39 45 54 ) ( 3 15 20 24 30 42 47 53 )
( 4 9 18 26 34 42 50 52 ) ( 4 10 21 25 30 43 48 54 )
( 4 11 20 29 33 37 45 56 ) ( 4 12 22 28 31 41 44 53 )
( 4 13 19 24 36 39 49 51 ) ( 4 14 16 27 32 38 47 57 )
( 4 15 17 23 35 40 46 55 ) ( 5 9 19 27 35 43 45 53 )
( 5 10 18 23 36 41 47 56 ) ( 5 11 22 26 30 38 49 55 )
( 5 12 21 24 34 37 46 57 ) ( 5 13 17 29 32 42 44 54 )
( 5 14 20 25 31 40 50 51 ) ( 5 15 16 28 33 39 48 52 )
( 6 9 20 28 36 38 46 54 ) ( 6 10 16 29 34 40 49 53 )
( 6 11 19 23 31 42 48 57 ) ( 6 12 17 27 30 39 50 56 )
( 6 13 22 25 35 37 47 52 ) ( 6 14 18 24 33 43 44 55 )
( 6 15 21 26 32 41 45 51 ) ( 7 9 21 29 31 39 47 55 )
( 7 10 22 27 33 42 46 51 ) ( 7 11 16 24 35 41 50 54 )
( 7 12 20 23 32 43 49 52 ) ( 7 13 18 28 30 40 45 57 )
( 7 14 17 26 36 37 48 53 ) ( 7 15 19 25 34 38 44 56 )
( 8 9 22 24 32 40 48 56 ) ( 8 10 20 26 35 39 44 57 )
( 8 11 17 28 34 43 47 51 ) ( 8 12 16 25 36 42 45 55 )
( 8 13 21 23 33 38 50 53 ) ( 8 14 19 29 30 41 46 52 )
( 8 15 18 27 31 37 49 54 ) ))
; gap> D := PGPointFlatBlockDesign(281);; D.blocks; BlockNumbers(D);
; size 73
(defparameter pplane9
'( ( 1 2 3 4 5 6 7 8 9 ) ( 1 10 11 12 13 14 15 16 17 )
( 1 18 19 20 21 22 23 24 25 ) ( 1 26 27 28 29 30 31 32 33 )
( 1 34 35 36 37 38 39 40 41 )
( 1 42 43 44 45 46 47 48 49 ) ( 1 50 51 52 53 54 55 56 57 )
( 1 58 59 60 61 62 63 64 65 )
( 1 66 67 68 69 70 71 72 73 ) ( 2 10 18 26 34 42 50 58 66 )
( 2 11 19 27 35 43 51 59 67 )
( 2 12 20 28 36 44 52 60 68 ) ( 2 13 21 29 37 45 53 61 69 )
( 2 14 22 30 38 46 54 62 70 )
( 2 15 23 31 39 47 55 63 71 ) ( 2 16 24 32 40 48 56 64 72 )
( 2 17 25 33 41 49 57 65 73 )
( 3 10 19 28 37 46 55 64 73 ) ( 3 11 18 30 41 44 56 63 69 )
( 3 12 22 26 39 43 53 65 72 )
( 3 13 25 31 34 48 52 62 67 ) ( 3 14 20 27 40 42 57 61 71 )
( 3 15 24 29 36 49 50 59 70 )
( 3 16 23 33 38 45 51 58 68 ) ( 3 17 21 32 35 47 54 60 66 )
( 4 10 20 29 38 47 56 65 67 )
( 4 11 22 33 36 48 55 61 66 ) ( 4 12 18 31 35 45 57 64 70 )
( 4 13 23 26 40 44 54 59 73 )
( 4 14 19 32 34 49 53 63 68 ) ( 4 15 21 28 41 42 51 62 72 )
( 4 16 25 30 37 43 50 60 71 )
( 4 17 24 27 39 46 52 58 69 ) ( 5 10 21 30 39 48 57 59 68 )
( 5 11 25 28 40 47 53 58 70 )
( 5 12 23 27 37 49 56 62 66 ) ( 5 13 18 32 36 46 51 65 71 )
( 5 14 24 26 41 45 55 60 67 )
( 5 15 20 33 34 43 54 64 69 ) ( 5 16 22 29 35 42 52 63 73 )
( 5 17 19 31 38 44 50 61 72 )
( 6 10 22 31 40 49 51 60 69 ) ( 6 11 20 32 39 45 50 62 73 )
( 6 12 19 29 41 48 54 58 71 )
( 6 13 24 28 38 43 57 63 66 ) ( 6 14 18 33 37 47 52 59 72 )
( 6 15 25 26 35 46 56 61 68 )
( 6 16 21 27 34 44 55 65 70 ) ( 6 17 23 30 36 42 53 64 67 )
( 7 10 23 32 41 43 52 61 70 )
( 7 11 24 31 37 42 54 65 68 ) ( 7 12 21 33 40 46 50 63 67 )
( 7 13 20 30 35 49 55 58 72 )
( 7 14 25 29 39 44 51 64 66 ) ( 7 15 18 27 38 48 53 60 73 )
( 7 16 19 26 36 47 57 62 69 )
( 7 17 22 28 34 45 56 59 71 ) ( 8 10 24 33 35 44 53 62 71 )
( 8 11 23 29 34 46 57 60 72 )
( 8 12 25 32 38 42 55 59 69 ) ( 8 13 22 27 41 47 50 64 68 )
( 8 14 21 31 36 43 56 58 73 )
( 8 15 19 30 40 45 52 65 66 ) ( 8 16 18 28 39 49 54 61 67 )
( 8 17 20 26 37 48 51 63 70 )
( 9 10 25 27 36 45 54 63 72 ) ( 9 11 21 26 38 49 52 64 71 )
( 9 12 24 30 34 47 51 61 73 )
( 9 13 19 33 39 42 56 60 70 ) ( 9 14 23 28 35 48 50 65 69 )
( 9 15 22 32 37 44 57 58 67 )
( 9 16 20 31 41 46 53 59 66 )
( 9 17 18 29 40 43 55 62 68 ) ))
; gap> D := PGPointFlatBlockDesign(291);; D.blocks; BlockNumbers(D);
; size 91
(defparameter pplane10
'( ( 1 2 3 4 5 6 7 8 9 10 ) ( 1 11 12 13 14 15 16 17 18 19 )
( 1 20 21 22 23 24 25 26 27 28 )
( 1 29 30 31 32 33 34 35 36 37 )
( 1 38 39 40 41 42 43 44 45 46 )
( 1 47 48 49 50 51 52 53 54 55 )
( 1 56 57 58 59 60 61 62 63 64 )
( 1 65 66 67 68 69 70 71 72 73 )
( 1 74 75 76 77 78 79 80 81 82 )
( 1 83 84 85 86 87 88 89 90 91 )
( 2 11 20 29 38 47 56 65 74 83 )
( 2 12 21 30 39 48 57 66 75 84 )
( 2 13 22 31 40 49 58 67 76 85 )
( 2 14 23 32 41 50 59 68 77 86 )
( 2 15 24 33 42 51 60 69 78 87 )
( 2 16 25 34 43 52 61 70 79 88 )
( 2 17 26 35 44 53 62 71 80 89 )
( 2 18 27 36 45 54 63 72 81 90 )
( 2 19 28 37 46 55 64 73 82 91 )
( 3 11 21 31 41 51 61 71 81 91 )
( 3 12 22 29 42 55 63 70 80 86 )
( 3 13 20 30 46 50 62 72 79 87 )
( 3 14 24 37 44 52 57 65 76 90 )
( 3 15 28 32 43 54 58 66 74 89 )
( 3 16 27 35 39 49 64 69 77 83 )
( 3 17 25 36 38 48 60 68 82 85 )
( 3 18 26 34 40 47 59 73 78 84 )
( 3 19 23 33 45 53 56 67 75 88 )
( 4 11 22 30 44 54 64 68 78 88 )
( 4 12 20 31 43 53 59 69 82 90 )
( 4 13 21 29 45 52 60 73 77 89 )
( 4 14 28 33 38 49 63 71 79 84 )
( 4 15 23 37 39 47 62 70 81 85 )
( 4 16 26 36 42 50 56 66 76 91 )
( 4 17 27 34 41 55 58 65 75 87 )
( 4 18 25 35 46 51 57 67 74 86 )
( 4 19 24 32 40 48 61 72 80 83 )
( 5 11 23 35 42 52 58 72 82 84 )
( 5 12 24 34 46 54 56 71 77 85 )
( 5 13 28 36 41 53 57 70 78 83 )
( 5 14 26 29 43 48 64 67 81 87 )
( 5 15 25 30 45 49 59 65 80 91 )
( 5 16 21 33 40 55 62 68 74 90 )
( 5 17 20 32 39 51 63 73 76 88 )
( 5 18 22 37 38 50 61 69 75 89 )
( 5 19 27 31 44 47 60 66 79 86 )
( 6 11 24 36 43 49 62 73 75 86 )
( 6 12 28 35 45 47 61 68 76 87 )
( 6 13 23 34 44 48 63 69 74 91 )
( 6 14 25 31 39 55 56 72 78 89 )
( 6 15 27 29 40 50 57 71 82 88 )
( 6 16 22 32 46 53 60 65 81 84 )
( 6 17 21 37 42 54 59 67 79 83 )
( 6 18 20 33 41 52 64 66 80 85 )
( 6 19 26 30 38 51 58 70 77 90 )
( 7 11 25 37 40 53 63 66 77 87 )
( 7 12 27 32 38 52 62 67 78 91 )
( 7 13 26 33 39 54 61 65 82 86 )
( 7 14 21 36 46 47 58 69 80 88 )
( 7 15 22 35 41 48 56 73 79 90 )
( 7 16 28 29 44 51 59 72 75 85 )
( 7 17 24 31 45 50 64 70 74 84 )
( 7 18 23 30 43 55 60 71 76 83 )
( 7 19 20 34 42 49 57 68 81 89 )
( 8 11 26 32 45 55 57 69 79 85 )
( 8 12 25 33 44 50 58 73 81 83 )
( 8 13 27 37 43 51 56 68 80 84 )
( 8 14 20 35 40 54 60 70 75 91 )
( 8 15 21 34 38 53 64 72 76 86 )
( 8 16 24 30 41 47 63 67 82 89 )
( 8 17 23 29 46 49 61 66 78 90 )
( 8 18 28 31 42 48 62 65 77 88 )
( 8 19 22 36 39 52 59 71 74 87 )
( 9 11 27 33 46 48 59 70 76 89 )
( 9 12 26 37 41 49 60 72 74 88 )
( 9 13 25 32 42 47 64 71 75 90 )
( 9 14 22 34 45 51 62 66 82 83 )
( 9 15 20 36 44 55 61 67 77 84 )
( 9 16 23 31 38 54 57 73 80 87 )
( 9 17 28 30 40 52 56 69 81 86 )
( 9 18 24 29 39 53 58 68 79 91 )
( 9 19 21 35 43 50 63 65 78 85 )
( 10 11 28 34 39 50 60 67 80 90 )
( 10 12 23 36 40 51 64 65 79 89 )
( 10 13 24 35 38 55 59 66 81 88 )
( 10 14 27 30 42 53 61 73 74 85 )
( 10 15 26 31 46 52 63 68 75 83 )
( 10 16 20 37 45 48 58 71 78 86 )
( 10 17 22 33 43 47 57 72 77 91 )
( 10 18 21 32 44 49 56 70 82 87 )
( 10 19 25 29 41 54 62 69 76 84 ) ))
; gap> D := PGPointFlatBlockDesign(2111);; D.blocks; BlockNumbers(D);
; size 133
(defparameter pplane12
'( ( 1 2 3 4 5 6 7 8 9 10 11 12 )
( 1 13 14 15 16 17 18 19 20 21 22 23 )
( 1 24 25 26 27 28 29 30 31 32 33 34 )
( 1 35 36 37 38 39 40 41 42 43 44 45 )
( 1 46 47 48 49 50 51 52 53 54 55 56 )
( 1 57 58 59 60 61 62 63 64 65 66 67 )
( 1 68 69 70 71 72 73 74 75 76 77 78 )
( 1 79 80 81 82 83 84 85 86 87 88 89 )
( 1 90 91 92 93 94 95 96 97 98 99 100 )
( 1 101 102 103 104 105 106 107 108 109 110 111 )
( 1 112 113 114 115 116 117 118 119 120 121 122 )
( 1 123 124 125 126 127 128 129 130 131 132 133 )
( 2 13 24 35 46 57 68 79 90 101 112 123 )
( 2 14 25 36 47 58 69 80 91 102 113 124 )
( 2 15 26 37 48 59 70 81 92 103 114 125 )
( 2 16 27 38 49 60 71 82 93 104 115 126 )
( 2 17 28 39 50 61 72 83 94 105 116 127 )
( 2 18 29 40 51 62 73 84 95 106 117 128 )
( 2 19 30 41 52 63 74 85 96 107 118 129 )
( 2 20 31 42 53 64 75 86 97 108 119 130 )
( 2 21 32 43 54 65 76 87 98 109 120 131 )
( 2 22 33 44 55 66 77 88 99 110 121 132 )
( 2 23 34 45 56 67 78 89 100 111 122 133 )
( 3 13 25 37 49 61 73 85 97 109 121 133 )
( 3 14 26 44 51 64 78 79 96 105 115 131 )
( 3 15 33 38 56 63 76 80 90 108 117 127 )
( 3 16 29 45 50 58 75 88 92 101 120 129 )
( 3 17 31 41 47 62 70 87 100 104 112 132 )
( 3 18 34 43 53 59 74 82 99 102 116 123 )
( 3 19 24 36 55 65 71 86 94 111 114 128 )
( 3 20 30 35 48 67 77 83 98 106 113 126 )
( 3 21 28 42 46 60 69 89 95 110 118 125 )
( 3 22 27 40 54 57 72 81 91 107 122 130 )
( 3 23 32 39 52 66 68 84 93 103 119 124 )
( 4 13 26 38 50 62 74 86 98 110 122 124 )
( 4 14 33 40 53 67 68 85 94 104 120 125 )
( 4 15 27 45 52 65 69 79 97 106 116 132 )
( 4 16 34 39 47 64 77 81 90 109 118 128 )
( 4 17 30 36 51 59 76 89 93 101 121 130 )
( 4 18 32 42 48 63 71 88 91 105 112 133 )
( 4 19 25 44 54 60 75 83 100 103 117 123 )
( 4 20 24 37 56 66 72 87 95 102 115 129 )
( 4 21 31 35 49 58 78 84 99 107 114 127 )
( 4 22 29 43 46 61 70 80 96 111 119 126 )
( 4 23 28 41 55 57 73 82 92 108 113 131 )
( 5 13 27 39 51 63 75 87 99 111 113 125 )
( 5 14 29 42 56 57 74 83 93 109 114 132 )
( 5 15 34 41 54 58 68 86 95 105 121 126 )
( 5 16 28 36 53 66 70 79 98 107 117 133 )
( 5 17 25 40 48 65 78 82 90 110 119 129 )
( 5 18 31 37 52 60 77 80 94 101 122 131 )
( 5 19 33 43 49 64 72 89 92 106 112 124 )
( 5 20 26 45 55 61 76 84 91 104 118 123 )
( 5 21 24 38 47 67 73 88 96 103 116 130 )
( 5 22 32 35 50 59 69 85 100 108 115 128 )
( 5 23 30 44 46 62 71 81 97 102 120 127 )
( 6 13 28 40 52 64 76 88 100 102 114 126 )
( 6 14 31 45 46 63 72 82 98 103 121 128 )
( 6 15 30 43 47 57 75 84 94 110 115 133 )
( 6 16 25 42 55 59 68 87 96 106 122 127 )
( 6 17 29 37 54 67 71 79 99 108 118 124 )
( 6 18 26 41 49 66 69 83 90 111 120 130 )
( 6 19 32 38 53 61 78 81 95 101 113 132 )
( 6 20 34 44 50 65 73 80 93 107 112 125 )
( 6 21 27 36 56 62 77 85 92 105 119 123 )
( 6 22 24 39 48 58 74 89 97 104 117 131 )
( 6 23 33 35 51 60 70 86 91 109 116 129 )
( 7 13 29 41 53 65 77 89 91 103 115 127 )
( 7 14 34 35 52 61 71 87 92 110 117 130 )
( 7 15 32 36 46 64 73 83 99 104 122 129 )
( 7 16 31 44 48 57 76 85 95 111 116 124 )
( 7 17 26 43 56 60 68 88 97 107 113 128 )
( 7 18 30 38 55 58 72 79 100 109 119 125 )
( 7 19 27 42 50 67 70 84 90 102 121 131 )
( 7 20 33 39 54 62 69 82 96 101 114 133 )
( 7 21 25 45 51 66 74 81 94 108 112 126 )
( 7 22 28 37 47 63 78 86 93 106 120 123 )
( 7 23 24 40 49 59 75 80 98 105 118 132 )
( 8 13 30 42 54 66 78 80 92 104 116 128 )
( 8 14 24 41 50 60 76 81 99 106 119 133 )
( 8 15 25 35 53 62 72 88 93 111 118 131 )
( 8 16 33 37 46 65 74 84 100 105 113 130 )
( 8 17 32 45 49 57 77 86 96 102 117 125 )
( 8 18 27 44 47 61 68 89 98 108 114 129 )
( 8 19 31 39 56 59 73 79 91 110 120 126 )
( 8 20 28 43 51 58 71 85 90 103 122 132 )
( 8 21 34 40 55 63 70 83 97 101 115 124 )
( 8 22 26 36 52 67 75 82 95 109 112 127 )
( 8 23 29 38 48 64 69 87 94 107 121 123 )
( 9 13 31 43 55 67 69 81 93 105 117 129 )
( 9 14 30 39 49 65 70 88 95 108 122 123 )
( 9 15 24 42 51 61 77 82 100 107 120 124 )
( 9 16 26 35 54 63 73 89 94 102 119 132 )
( 9 17 34 38 46 66 75 85 91 106 114 131 )
( 9 18 33 36 50 57 78 87 97 103 118 126 )
( 9 19 28 45 48 62 68 80 99 109 115 130 )
( 9 20 32 40 47 60 74 79 92 111 121 127 )
( 9 21 29 44 52 59 72 86 90 104 113 133 )
( 9 22 25 41 56 64 71 84 98 101 116 125 )
( 9 23 27 37 53 58 76 83 96 110 112 128 )
( 10 13 32 44 56 58 70 82 94 106 118 130 )
( 10 14 28 38 54 59 77 84 97 111 112 129 )
( 10 15 31 40 50 66 71 89 96 109 113 123 )
( 10 16 24 43 52 62 78 83 91 108 121 125 )
( 10 17 27 35 55 64 74 80 95 103 120 133 )
( 10 18 25 39 46 67 76 86 92 107 115 132 )
( 10 19 34 37 51 57 69 88 98 104 119 127 )
( 10 20 29 36 49 63 68 81 100 110 116 131 )
( 10 21 33 41 48 61 75 79 93 102 122 128 )
( 10 22 30 45 53 60 73 87 90 105 114 124 )
( 10 23 26 42 47 65 72 85 99 101 117 126 )
( 11 13 33 45 47 59 71 83 95 107 119 131 )
( 11 14 27 43 48 66 73 86 100 101 118 127 )
( 11 15 29 39 55 60 78 85 98 102 112 130 )
( 11 16 32 41 51 67 72 80 97 110 114 123 )
( 11 17 24 44 53 63 69 84 92 109 122 126 )
( 11 18 28 35 56 65 75 81 96 104 121 124 )
( 11 19 26 40 46 58 77 87 93 108 116 133 )
( 11 20 25 38 52 57 70 89 99 105 120 128 )
( 11 21 30 37 50 64 68 82 91 111 117 132 )
( 11 22 34 42 49 62 76 79 94 103 113 129 )
( 11 23 31 36 54 61 74 88 90 106 115 125 )
( 12 13 34 36 48 60 72 84 96 108 120 132 )
( 12 14 32 37 55 62 75 89 90 107 116 126 )
( 12 15 28 44 49 67 74 87 91 101 119 128 )
( 12 16 30 40 56 61 69 86 99 103 112 131 )
( 12 17 33 42 52 58 73 81 98 111 115 123 )
( 12 18 24 45 54 64 70 85 93 110 113 127 )
( 12 19 29 35 47 66 76 82 97 105 122 125 )
( 12 20 27 41 46 59 78 88 94 109 117 124 )
( 12 21 26 39 53 57 71 80 100 106 121 129 )
( 12 22 31 38 51 65 68 83 92 102 118 133 )
( 12 23 25 43 50 63 77 79 95 104 114 130 ) ))
;; AFFINE PLANES
;; any two distinct points are joined by exactly one line
;; any point not in a line is contained in only one other non-intersecting line
; 9 elements
; 12 vectors
(defparameter aplane3
'((1 2 3) (1 4 5) (1 6 7) (1 8 9) (2 4 6) (2 5 8) (2 7 9) (3 4 9)
(3 5 7) (3 6 8) (4 7 8) (5 6 9)))
; 16 elements
; 20 vectors
(defparameter aplane4
'((1 2 3 4) (1 5 6 7) (1 8 9 10) (1 11 12 13) (1 14 15 16) (2 5 11 14)
(2 6 8 12) (2 7 9 15) (2 10 13 16) (3 5 8 16) (3 6 13 15) (3 7 10 11)
(3 9 12 14) (4 5 9 13) (4 6 10 14) (4 7 12 16) (4 8 11 15) (5 10 12 15)
(6 9 11 16) (7 8 13 14)))
;; 25 elements
;; 30 vectors
(defparameter aplane5
'((1 2 3 4 5) (1 6 7 8 9) (1 10 11 12 13) (1 14 15 16 17) (1 18 19 20 21)
(1 22 23 24 25) (2 6 10 14 22) (2 7 15 18 23) (2 8 11 16 19) (2 9 12 20 24)
(2 13 17 21 25) (3 6 16 20 25) (3 7 11 17 24) (3 8 13 18 22) (3 9 10 15 21)
(3 12 14 19 23) (4 6 11 21 23) (4 7 13 14 20) (4 8 12 15 25) (4 9 17 19 22)
(4 10 16 18 24) (5 6 12 17 18) (5 7 10 19 25) (5 8 14 21 24) (5 9 13 16 23)
(5 11 15 20 22) (6 13 15 19 24) (7 12 16 21 22) (8 10 17 20 23)
(9 11 14 18 25)))
;; ... finding affine planes ...
;(loop for x in pplane4 collect
; (set-difference x (car (last pplane4))))
;(make-poly
; (scf (transp (indices 25) 1)
; (flatten
;'((1 2 3 4 5) (1 7 8 9 10) (1 12 14 15 16) (1 17 18 19 21) (1 23 24 25 26)
; (1 27 28 30 31) (2 7 12 17 27) (2 8 18 23 28) (2 9 14 19 24) (2 10 15 25 30)
; (2 16 21 26 31) (3 7 19 25 31) (3 8 14 21 30) (3 9 16 23 27) (3 10 12 18 26)
; (3 15 17 24 28) (4 7 14 26 28) (4 8 16 17 25) (4 9 15 18 31) (4 10 21 24 27)
; (4 12 19 23 30) (5 7 15 21 23) (5 8 12 24 31) (5 9 17 26 30) (5 10 16 19 28)
; (5 14 18 25 27) (7 16 18 24 30) (8 15 19 26 27) (9 12 21 25 28)
; (10 14 17 23 31))))
; 5)
| 17,366 | Common Lisp | .lisp | 394 | 40.27665 | 79 | 0.561283 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 466cd6ae60c493e7a1784bc4bbb775db19d7c4da7bac90b8489a1f08d73c17fb | 15,862 | [
-1
] |
15,863 | serialism.lisp | gogins_csound-extended-nudruz/sources/serialism.lisp | (in-package :cm)
;; 'mallalieu.lisp' = mallalieu (selfsim) & other rows
;; fun with mallalieu rows
(defparameter mallalieu '(0 1 4 2 9 5 11 3 8 10 7 6))
(defparameter mallalieu-5 '(0 5 8 10 9 1 7 3 4 2 11 6))
(defparameter mallalieu-7 '(0 7 4 2 3 11 5 9 8 10 1 6))
(defparameter mallalieu-11 '(0 11 8 10 3 7 1 9 4 2 5 6))
;; MALLAL-DOUBLER -- doubles row at 'startpitz' at rate 'ifactorz'
;; startpitz,ifactorz can be lists (must be eql length) or single vals
;; returns either merged slots (default) or sdur vecs
;; includes 'mrow' in answer (merged, or first of sdur vecs)
(defun mallal-doubler (mrow startpitz ifactorz &optional (sd-flag nil))
(let* ((startpits (if (listp startpitz) startpitz (list startpitz)))
(ifactors (if (listp ifactorz) ifactorz (list ifactorz)))
(longest-ifac (apply #'max ifactors))
(mplacez
(loop for ifactor in ifactors collect
(loop for n in (transp (transp (indices 12) ifactor #'*) (- ifactor 1))
collect (mod n 13))))
(mpitz
(loop for mplaces in mplacez collect
(mapcar (lambda (x) (nth x mrow)) mplaces)))
(rowvecz
(loop for ifactor in ifactors collect
(copylist mrow ifactor)))
(nuslotz
(map 'list
(lambda (startpit mpits rowvec)
(transp-to startpit (extract-list mpits rowvec)))
startpits
mpitz
rowvecz))
(as-slots
(merge-slots (append rowvecz nuslotz)))
(as-sd
(cons
(list (copylist mrow longest-ifac) (copylist (list 1) (* (length mrow) longest-ifac)))
(mapcar #'slots->durs nuslotz))))
(if sd-flag as-sd as-slots)))
;; MALLAL-INTDOUBLER -- doubles row at 'dblintz' at rate 'ifactorz'
;; dblintz,ifactorz can be lists (must be eql length) or single vals
;; returns either merged slots (default) or sdur vecs
;; includes 'mrow' in answer (merged, or first of sdur vecs)
(defun mallal-intdoubler (mrow dblintz ifactorz &optional (sd-flag nil))
(let* ((dblints (if (listp dblintz) dblintz (list dblintz)))
(ifactors (if (listp ifactorz) ifactorz (list ifactorz)))
(longest-ifac (apply #'max ifactors))
(mplacez
(loop for ifactor in ifactors collect
(loop for n in (transp (transp (indices 12) ifactor #'*) (- ifactor 1))
collect (mod n 13))))
(mpitz
(loop for mplaces in mplacez collect
(mapcar (lambda (x) (nth x mrow)) mplaces)))
(rowvecz
(loop for ifactor in ifactors collect
(copylist mrow ifactor)))
(nuslotz
(map 'list
(lambda (dblint mpits rowvec)
(transp (extract-list mpits rowvec) dblint))
dblints
mpitz
rowvecz))
(as-slots
(merge-slots (append rowvecz nuslotz)))
(as-sd
(cons
(list (copylist mrow longest-ifac) (copylist (list 1) (* (length mrow) longest-ifac)))
(mapcar #'slots->durs nuslotz))))
(if sd-flag as-sd as-slots)))
;; OTHER ROWS
;; Lutoslawski etc
;; COMPLETIONP -- check to see if rows have aggregate completion (any mod)
(defun completionp (inlist &optional (modlen 12))
(mapcar (lambda (x) (list-eql (indices modlen) x))
(mod12 (make-poly inlist modlen 'fit))))
(defparameter lutos1
(butlast (mod12 (melint->line 0 (copylist '(6 11) 12)))))
(defparameter lutos2
(butlast (mod12 (melint->line 0 (copylist '(2 5 2 7) 3)))))
;; limited interval rows -- from minion
(defparameter row-6e
(first
(make-poly
(mod12 (melint->line 0
(copylist (interlock (list 6) (list 11) 1 1) 30)))
12)))
(defparameter fullrow-6e
(flatten
(subseq
(make-poly
(mod12 (melint->line 0
(copylist (interlock (list 6) (list 11) 1 1) 30)))
12)
0 2)))
(defparameter row-23
'(0 2 4 1 3 5 7 10 8 6 9 11))
(defparameter row-25
'(0 2 4 6 1 3 8 10 5 7 9 11))
;; '(2 2 5) melint
;; complete/full as is
(defparameter row-225-trich
'(0 2 4 9 11 1 6 8 10 3 5 7))
(defparameter row-252-trich
(butlast (mod12 (melint->line 0 (copylist '(2 5 2) 4)))))
(defparameter row-522-trich
(butlast (mod12 (melint->line 0 (copylist '(5 2 2) 4)))))
(defparameter row-34
'(0 4 1 10 2 11 8 5 9 6 3 7))
(defparameter row-34-tetra
'(0 3 6 9 1 4 7 10 2 5 8 11))
(defparameter row-3t-tetra
'(0 3 6 9 7 10 1 4 2 5 8 11))
;; complete/full by itself
(defparameter row-35
'(0 3 6 1 4 7 10 5 8 11 2 9))
;; '(4 4 5) melints
(defparameter row-45-trich
'(0 4 8 1 5 9 2 6 10 3 7 11))
(defparameter fullrow-45-trich
(flatten
(subseq
(make-poly
(mod12 (melint->line 0
(copylist '(4 4 5) 50)))
12 'fit)
0 3)))
;; carter symmetrical-inversion row 1
(defparameter carter1 (mod12 (melint->line 0 '(2 7 4 3 1 6 11 9 8 5 10))))
| 4,605 | Common Lisp | .lisp | 130 | 31.415385 | 90 | 0.659775 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | e709e33f2aa0f137f696f2be35356656be6727578aaaa944e983d7b1d990e4c9 | 15,863 | [
-1
] |
15,864 | dk-screamtest.lisp | gogins_csound-extended-nudruz/sources/dk-screamtest.lisp | (in-package :cm)
; (load (translate-logical-pathname "clocc:src;cllib;base"))
; (load (translate-logical-pathname "clocc:src;cllib;matrix"))
; (load (translate-logical-pathname "clocc:src;cllib;gnuplot"))
; (load (translate-logical-pathname "clocc:src;cllib;octave"))
; (load (translate-logical-pathname "clocc:src;cllib;iter"))
; (load (translate-logical-pathname "clocc:src;cllib;stat"))
;;(use-package :screamer)
;; FLATTEN -- removes all nesting in list
;; "thank you Paul Graham!"
(defun flatten (x)
(labels ((rec (x acc)
(cond ((null x) acc)
((atom x) (cons x acc))
(t (rec (car x) (rec (cdr x) acc))))))
(rec x nil)))
;; WIGGLE-UTIL: utility for wiggle-to
(defun wiggle-util (wigpair)
(flatten
(loop for x from 0 to (- (length (first wigpair)) 1)
collect (loop repeat (nth x (second wigpair))
collect (nth x (first wigpair))))))
;;; LIST-EQL: utility for wiggle-to
(defun list-eql (list1 list2)
(and (subsetp list1 list2)
(subsetp list2 list1)
(= (length list1) (length list2))))
(defun wiggle-to2 (startnum endnum maxlen allowed-ints)
(remove-duplicates
(all-values
(let* ((len (screamer::an-integer-between 0 maxlen))
(intslen (length allowed-ints))
(multvars (make-array intslen)))
(dotimes (j intslen) (setf (aref multvars j) (screamer::an-integer-between 0 len)))
(assert! (< (apply-nondeterministic #'+ (coerce multvars 'list))
(+ maxlen 1)))
(assert! (= (- endnum startnum)
(apply-nondeterministic #'+
(map 'list #'* allowed-ints (coerce multvars 'list)))))
(wiggle-util (list allowed-ints (coerce multvars 'list)))))
:test #'list-eql))
; (wiggle-to2 45 48 8 '(-1 2)) = ((-1 2 2) (-1 -1 -1 2 2 2))
; (wiggle-to2 45 48 8 '(2 -1)) = ((2 2 2 -1 -1 -1))
(wiggle-to2 45 48 8 '(-1 2))
(wiggle-to2 45 48 8 '(2 -1))
| 1,979 | Common Lisp | .lisp | 45 | 37.288889 | 91 | 0.60343 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | f36e1ffbeaef4eaa2cc895d81edf0f1598d2a1785bfab3994c38134707cd3918 | 15,864 | [
-1
] |
15,865 | tps.lisp | gogins_csound-extended-nudruz/sources/tps.lisp | (in-package :cm)
;; TONAL PITCH SPACE
; MKG (load "/home/drew/Lisp/cm-2.4.0/Druzaks/nudruz.lisp")
;; four levels (with all belonging to lower levels as well)
;; 'tonic' = 1 member
;; 'triad' = 2 more members: "basechd"
;; 'scale' = 4 more members (vary?)
;; 'chromatic space' = 5 (remaining) members
;; ---> build from modes?!?
;; note that :scale slot defaults to the chromatic scale
(defclass person ()
((name :accessor person-name
:initform 'bill
:initarg :name)
(age :accessor person-age
:initform 10
:initarg :age)))
(defclass tps ()
((tonic :accessor tps-tonic
:initform 0
:initarg :tonic)
(triad :accessor tps-triad
:initform '(0 4 7)
:initarg :triad)
(scale :initform '(2 5 9 11))))
(defun mytps () (make-instance 'tps))
(defun myspace () (make-instance 'tps))
; MKG not defined, not used. (tps-scale (myspace))
(defun mymode () (new mode :tonic 'd :steps '(c d e fs g a bf)))
(loop for x to 10 collect (note x :in mymode))
(defparameter thatmode (make-instance 'mode :tonic 'f))
(defparameter mymode (new mode :tonic 'd))
(defparameter mytps (new tpspace :tonic 'd :basechd '(d f a)))
; (slot-value mymode 'scale) = #<tuning "chromatic-scale">
; (slot-value mymode 'octave) = 12
(slot-value mymode 'keynum-offset) = steps above C for tonic
;Mode slots:
; STEPS = (110592)
; LOWEST = (D-1 2 0 2 D NIL)
; SCALE = #<tuning "chromatic-scale">
; OCTAVE = 12
; DIVISIONS = 1
; INTO = (0 NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)
; KEYNUM-OFFSET = 2
; NAME = NIL
(defclass tpspace ()
((tptonic
(
| 1,636 | Common Lisp | .lisp | 48 | 32.020833 | 69 | 0.644997 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 918320bd2ee68515f6bf23fb1657422610978fff93bdf5826bf1eec02ef10636 | 15,865 | [
-1
] |
15,866 | selfsim.lisp | gogins_csound-extended-nudruz/sources/selfsim.lisp | (in-package :cm)
;; SELFSIM.LISP
;; making self-similar canons with cyclops.lisp and scf (nudruz.lisp)
;; Drew Krause, 2004
;; [email protected]
;; www.wordecho.org
;(load "cyclops.lisp")
;; S-SIM -- defines a (motoric) midi selfsim stream
;; January 2006: ties used by default
;; [setting non-nil 'no-ties' will return repeated notes instead]
(defun s-sim (melody pits rate tlevel rpts
&optional (basedur 1) (no-ties nil))
(if no-ties
(splay (copylist (scf (transpose pits tlevel) melody) rpts)
(* basedur rate))
(let ((blist (scf (transpose pits tlevel) melody)))
(splay (copylist (norpt blist) rpts)
(copylist (transp (tievec blist) (* basedur rate) #'*)
rpts)))))
;; SELFSIM -- constructs a set of midi selfsim streams
(defun selfsim (melody pits rates transpvec
&optional (basedur 1) (no-ties nil))
(let ((rptlen (reduce #'lcm rates)))
(loop for n to (- (length rates) 1) collect
(s-sim melody pits (nth n rates) (nth n transpvec)
(/ rptlen (nth n rates)) basedur no-ties))))
;; example
;(events (selfsim cyclops3p5x14 '(60 62 63 65) '(1 3 5) '(0 -7 -14) .25)
; "newselfsim.midi")
;; S-SIM->SLOTS -- defines a (slotted) selfsim stream
;; ... like s-sim, but makes slot vector
(defun s-sim->slots (melody pits rate transp rpts)
(let ((durs (loop repeat (length melody) collect rate))
(scfmel (scf pits melody)))
(flatten (loop repeat rpts collect
(durs->slots
(flatten
(mapcar (lambda (x) (+ x transp)) scfmel))
(flatten durs))))))
;; SELFSIMVEC -- constructs slotted selfsim pitch list
(defun selfsimvec (melody pits rates transpvec)
(let ((rptlen (reduce #'lcm rates)))
(merge-slots (loop for n to (- (length rates) 1) collect
(s-sim->slots melody pits (nth n rates) (nth n transpvec)
(/ rptlen (nth n rates)))))))
;; SSIM-ATKLEN -- computes length of ssim vector, from mel & rates
(defun ssim-atklen (mel rates)
(* (length mel)
(apply #'lcm rates)))
;; SSIM-TOTALEN -- computes total length of ssim in minutes
(defun ssim-totalen (mel rates &optional (basedur .25))
(round
(/ (ssim-atklen mel rates)
(* (/ 1 basedur) 60))))
;; SSIM? -- testing self-similarity
;; rests allowed through [June 2010]
(defun ssim? (mel rate)
(let ((lenmel (length mel)))
(seq-eql-with-rests mel
(butlast (loop for n to (* rate lenmel) by rate collect
(nth (mod n lenmel) mel))))))
;; SSIM-SPEEDS -- returns all rates of self-replication (up to length)
(defun ssim-speeds (mel)
(no-nils
(loop for n from 2 to (- (length mel) 1) collect
(if (ssim? mel n) n))))
;; TIES? -- does a melody contain ties?
(defun ties? (mel)
(member 't
(map 'list #'eql mel (cdr mel))))
; row-adjacencies
;; Jan 2012: autosimilar melodies (Amiot)
;; ratio = augmentation
;; period = length of melody
;; ratio & period must be coprime
(defun coprime? (num1 num2)
(not (intersection (prime-factors num1) (prime-factors num2))))
(defun merge-one-element (elem partial-results)
(unless (do* ((e partial-results (cdr e))
(a (car e) (car e)))
((null e) nil)
(when (intersection elem a)
(setf (car e) (union a elem))
(return partial-results)))
(push elem partial-results))
partial-results)
(defun disjoint-sets (sets &key (test #'eql))
(let ((disj-sets-hash (make-hash-table :test test)))
(labels ((get-set (elem)
;; get the set/partition that the element belongs to
;; creating a new one if necessary
(let ((partition (gethash elem disj-sets-hash)))
(or partition (setf (gethash elem disj-sets-hash)
(cons (cons elem nil) nil)))))
(merge-set (from-set to-set)
;; migrate all members of from-set to to-set
;; and update their (get-set ...) pointer to the new set also.
(unless (eq from-set to-set)
(dolist (each-elem (car from-set))
(setf (gethash each-elem disj-sets-hash) to-set))
(setf (car to-set) (union (car from-set) (car to-set))))))
(dolist (set sets)
(let ((fs (get-set (first set))))
(dolist (elem (rest set))
(merge-set (get-set elem) fs))))
(loop for x being the hash-values of disj-sets-hash
collecting x into partitions
finally (return (mapcar #'car (remove-duplicates partitions)))))))
;; AUTOSIM-PRIMITIVE
;; gives indx structure from ratio & period
(defun autosim-primitive (ratio period)
(if (coprime? ratio period)
(let* ((placelists
(mapcar #'safesort
(disjoint-sets
(sort
(mapcar #'safesort
(remove-duplicates
(mapcar
(lambda (x)
(remove-duplicates
(list x (mod (* x ratio) period))))
(indices period))
:test #'list-eql))
(lambda (a b) (< (car a) (car b))))))))
(flatten
(merge-slots
(map 'list
(lambda (n plc)
(tpoints (copylist (list n) (length plc)) plc period))
(indices (length placelists))
placelists))))))
;; RPTS->DURS -- gives pits & repeat vector
(defun rpts->durs (inputvec)
(list (norpt inputvec)
(take-poly (gather-pits #'eql inputvec))))
;; MELDURS->RPTS
(defun meldurs->rpts (meldurs)
(repeater (first meldurs) (second meldurs)))
;; CANNED-FRAGS
;; all selfsim canons (slotted list) based on frags of len
(defun canned-frags (pits durs fraglen &optional (transpdown 7) (removedupes? 't) (flat? t))
(let* ((infrags
(make-poly (durs->slots pits (hits->ints durs)) fraglen))
(hyfrags (if removedupes? (remove-duplicates infrags :test #'seq-eql) infrags))
(hyspeeds (mapcar #'ssim-speeds hyfrags))
(rawoutput
(map 'list
(lambda (frag speed)
(if speed
(let ((thislcm (reduce #'lcm speed)))
(merge-slots
(cons
(copylist frag thislcm)
(loop for spidx from 0 to (- (length speed) 1) collect
(copylist
(menses (transp frag (* (* -1 transpdown) (+ 1 spidx))) (nth spidx speed))
(/ thislcm (nth spidx speed)))))))))
hyfrags
hyspeeds)))
(if flat? (flatter rawoutput) (no-nils rawoutput))))
| 6,459 | Common Lisp | .lisp | 161 | 33.055901 | 92 | 0.604303 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | f07b6f3bb766ca863c4d7e9d5379bb98f02ed9ff96b3ade796681c93b4d8ddca | 15,866 | [
-1
] |
15,867 | motive.lisp | gogins_csound-extended-nudruz/sources/motive.lisp | (in-package :cm)
;; MOTIVE.LISP -- using codes to create "motive" structure
;; motive = (list codeword durs)
;; e.g. ((1 0 0 1) (.25 .25 .25 .25)) = (note rest rest note)
;; utility to play motives
;; MOTIVEPLAY -- takes pits and motive (list code durs)
(defun motiveplay (pits mtiv)
(splay (code->slots (first mtiv) pits) (second mtiv)))
;; QUANTIZE-MOTIVE -- quantized motive
(defun quantize-motive (mtiv &optional (divs '(2 3 4 5 6 8)))
(let* ((qlevs (multquant divs))
(qdurs (quantdurs (second mtiv) qlevs 'give-poly))
(nudurs (first qdurs))
(pvec (second qdurs)))
(list
(make-poly (first mtiv) pvec)
nudurs)))
;; COMBINE-MOTIVES -- [quantized] set of appended motives
(defun combine-motives (mtivs &optional (noquant 'nil) (divs '(2 3 4 5 6 8)))
(let ((cmtives
(list
(loop for m in mtivs append (first m))
(loop for m in mtivs append (second m)))))
(if noquant
cmtives
(quantize-motive cmtives divs))))
;; INVERSE-MOTIVE -- atx become rests, etc.
(defun inverse-motive (mpair)
(list (inverse-codeword (first mpair)) (second mpair)))
;; MULTAUG-MOTIVE -- multiplicative augmentation
(defun multaug-motive (mpair mfact)
(list (first mpair) (transp (second mpair) mfact #'*)))
;; ADDAUG-MOTIVE -- additive augmentation [adding (afact)*(fast-tact) to every dur]
;; (addaug-motive '((1 1) (.25 .75)) 2)
;; = ((1 1) (0.75 1.25)) ;; added 2 of the fast-tact [.25] to each member
(defun addaug-motive (mpair afact)
(list (first mpair)
(transp
(transp (hits->ints (second mpair)) afact)
(fast-tact (second mpair)) #'*)))
;; ADDAUGS -- lots of augmented motives
(defun addaugs (mtiv &optional (numfacts 6))
(loop for a in (indices (+ 1 numfacts)) collect
(addaug-motive mtiv a)))
;; ADDDUR-MOTIVE -- adding same 'literal' duration to each dur
(defun adddur-motive (mpair adur)
(list (first mpair) (transp (second mpair) adur)))
;; MOTIVE-DENSITY -- avg # atks per beat in a motive
(defun motive-density (mpair)
(/ (count 1 (first mpair))
(apply #'+ (second mpair))))
;; SUBMOTIVES -- drops atx from motive; returns list of all applicable mpairs
(defun submotives (mpair &optional (single-len nil))
(let* ((atx (positions 1 (first mpair)))
(nuplaces
(if single-len (subsets-len atx single-len)
(loop for n from 1 to (- (count 1 (first mpair)) 1)
append (subsets-len atx n)))))
(loop for p in nuplaces collect
(list (loop for n to (- (length (first mpair)) 1)
collect (if (member n p) 1 0))
(second mpair)))))
;; SUBCODES -- all derived codes less than original weight (or of specified weight)
(defun subcodes (a-code &optional (single-len nil))
(first (transpose-matx
(submotives (list a-code (copylist (list .5) 12)) single-len))))
;; BASECHANGE-MOTIVE -- change fundamental 'fast-tact'; returns list of motives
;; sim. to Boulez "simple transformation"
(defun basechange-motive (mpair)
(let* ((durs (second mpair))
(bdur (floats->rats (fast-tact durs)))
(hints (hits->ints durs))
(nubases (set-difference '(1/2 1/3 1/4 1/5 2/3 3/4 2/5 3/5 4/5)
(list bdur))))
(mapcar
(lambda (x)
(list (first mpair)
(transp hints x #'*)))
nubases)))
; SIMPLIFIED-MOTIVE -- returns motive
;; removes initial rest & ties thru subsequent rests
(defun simplified-motive (mpair)
(let* ((code (first mpair))
(durs (second mpair))
(truncode (member 1 code))
(truncdurs (subseq durs (position 1 code)))
(ties (second (slots->durs (code->slots truncode (makecyc (list 1)))))))
(list (copylist '(1) (length ties))
(sum-across truncdurs ties))))
;; DURS->MOTIVE -- from durlist to motive (no rests)
(defun durs->motive (durs)
(list (copylist '(1) (length durs))
durs))
;; MOTIVE->DURS -- returns duration [from simplified version]
(defun motive->durs (mtiv)
(second (simplified-motive mtiv)))
;; DEMULTIPLIED-MOTIVE
;; from Boulez -- recursively applied rhythm [returns single motive]
(defun demultiplied-motive (mpair)
(let* ((sm (simplified-motive mpair))
(hits (first sm))
(durs (second sm))
(precombos
(loop for n to (- (length hits) 1) collect
(list (first mpair)
(transp (transp (second mpair)
(/ 1 (apply #'+ (second mpair))) #'*)
(nth n durs) #'*))))
(outcodes (loop for p in precombos append (first p)))
(outdurs (loop for p in precombos append (second p))))
(list outcodes outdurs)))
;; MULTIPLIED-MOTIVE -- 'expanded' motive
(defun multiplied-motive (mpair)
(let* ((sm (simplified-motive mpair))
(hits (first sm))
(durs (second sm))
(ft (fast-tact durs))
(hints (hits->ints durs))
(minhint (apply #'min hints))
(base0hints (transp hints (* -1 minhint))))
(if (eql 2 (length (first sm)))
(list hits durs)
(list (copylist hits (length hits))
(loop for n to (- (length hits) 1) append
(transp
(transp base0hints (nth n hints))
ft #'*))))))
;; NONRET-MOTIVE? -- checks for nonretrogradability
(defun nonret-motive? (mpair)
(and (seq-eql (first mpair) (reverse (first mpair)))
(seq-eql (second mpair) (reverse (second mpair)))))
;; SPAWNED-MOTIVE
;; always returns 2 motives -- existing pairs are used to find proportions
(defun spawned-motive (mpair)
(let* ((code (first mpair))
(durs (second mpair))
(firstdur (first durs))
(seconddur (second durs))
(lastdur (car (last durs)))
(secondlastdur (car (last (butlast durs))))
(spfact1 (floats->rats (/ firstdur lastdur)))
(spfact2 (/ 1 spfact1)))
(list
(list code (cons (* spfact1 secondlastdur) (butlast durs)))
(list code (append (cdr durs) (list (* spfact2 seconddur))))))) | 5,638 | Common Lisp | .lisp | 145 | 35.544828 | 83 | 0.667458 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5da8b32286d560c398a164a37c8e32b39d1862e291b87782a2a03b8f5afe13f5 | 15,867 | [
-1
] |
15,868 | graphs.lisp | gogins_csound-extended-nudruz/sources/graphs.lisp | (in-package :cm)
;; GRAPHS.LISP
;; some CM graphs from group theory
;; Drew Krause, 2004
;; [email protected]
;; www.wordecho.org
;; D4-GRAPH: dihedral group (4) -- size 4
(defparameter d4-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(2 3)))
(b :id 2 :to ,(new weighting of '(1 4)))
(c :id 3 :to ,(new weighting of '(1 4)))
(d :id 4 :to ,(new weighting of '(2 3))))))
;; TRANS8C-GRAPH: transitive group (8) id 3 -- size 8
(defparameter trans8c-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(3 5 8)))
(b :id 2 :to ,(new weighting of '(3 6 8)))
(c :id 3 :to ,(new weighting of '(1 2 7)))
(d :id 4 :to ,(new weighting of '(5 6 8)))
(e :id 5 :to ,(new weighting of '(1 4 7)))
(f :id 6 :to ,(new weighting of '(2 4 7)))
(g :id 7 :to ,(new weighting of '(3 5 6)))
(h :id 8 :to ,(new weighting of '(1 2 4))))))
;; TRANS6A-GRAPH: transitive group (6) id 1 -- size 6
;; "kinda cyclic"
(defparameter trans6a-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(2 6)))
(b :id 2 :to ,(new weighting of '(1 3)))
(c :id 3 :to ,(new weighting of '(2 4)))
(d :id 4 :to ,(new weighting of '(3 5)))
(e :id 5 :to ,(new weighting of '(4 6)))
(f :id 6 :to ,(new weighting of '(1 5))))))
;; TRANS6B-GRAPH: transitive group (6) id 2 -- size 6
;; "no steps"
(defparameter trans6b-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(3 4 5)))
(b :id 2 :to ,(new weighting of '(4 5 6)))
(c :id 3 :to ,(new weighting of '(1 5 6)))
(d :id 4 :to ,(new weighting of '(1 2 6)))
(e :id 5 :to ,(new weighting of '(1 2 3)))
(f :id 6 :to ,(new weighting of '(2 3 4))))))
;; TRANS6C-GRAPH: transitive group (6) id 3 --- size 12
(defparameter trans6c-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(4 7 11)))
(b :id 2 :to ,(new weighting of '(3 8 12)))
(c :id 3 :to ,(new weighting of '(2 5 10)))
(d :id 4 :to ,(new weighting of '(1 6 9)))
(e :id 5 :to ,(new weighting of '(3 7 11)))
(f :id 6 :to ,(new weighting of '(4 8 12)))
(g :id 7 :to ,(new weighting of '(1 5 9)))
(h :id 8 :to ,(new weighting of '(2 6 10)))
(i :id 9 :to ,(new weighting of '(4 7 12)))
(j :id 10 :to ,(new weighting of '(3 8 11)))
(k :id 11 :to ,(new weighting of '(1 5 10)))
(l :id 12 :to ,(new weighting of '(2 6 9))))))
;; SMALL12A-GRAPH: small group (12) id 1 --- size 12
(defparameter small12a-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(2 3 4 5 8)))
(b :id 2 :to ,(new weighting of '(1 3 5 6 10)))
(c :id 3 :to ,(new weighting of '(1 2 5 7 11)))
(d :id 4 :to ,(new weighting of '(1 6 7 8 9)))
(e :id 5 :to ,(new weighting of '(1 2 3 9 12)))
(f :id 6 :to ,(new weighting of '(2 4 7 9 10)))
(g :id 7 :to ,(new weighting of '(3 4 6 9 11)))
(h :id 8 :to ,(new weighting of '(1 4 10 11 12)))
(i :id 9 :to ,(new weighting of '(4 5 6 7 12)))
(j :id 10 :to ,(new weighting of '(2 6 8 11 12)))
(k :id 11 :to ,(new weighting of '(3 7 8 10 12)))
(l :id 12 :to ,(new weighting of '(5 8 9 10 11))))))
;; SMALL12B-GRAPH: small group (12) id 2 --- size 12
(defparameter small12b-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(2 3 4 6 7)))
(b :id 2 :to ,(new weighting of '(1 4 5 6 9)))
(c :id 3 :to ,(new weighting of '(1 5 7 8 10)))
(d :id 4 :to ,(new weighting of '(1 2 6 8 11)))
(e :id 5 :to ,(new weighting of '(2 3 8 9 10)))
(f :id 6 :to ,(new weighting of '(1 2 4 10 12)))
(g :id 7 :to ,(new weighting of '(1 3 9 11 12)))
(h :id 8 :to ,(new weighting of '(3 4 5 10 11)))
(i :id 9 :to ,(new weighting of '(2 5 7 11 12)))
(j :id 10 :to ,(new weighting of '(3 5 6 8 12)))
(k :id 11 :to ,(new weighting of '(4 7 8 9 12)))
(l :id 12 :to ,(new weighting of '(6 7 9 10 11))))))
;; ALT4-GRAPH: alternating group (4) --- size 12
(defparameter alt4-graph (new graph :of
`((a :id 1 :to ,(new weighting of '(2 3 5 7)))
(b :id 2 :to ,(new weighting of '(1 3 9 10)))
(c :id 3 :to ,(new weighting of '(1 2 4 11)))
(d :id 4 :to ,(new weighting of '(3 5 6 11)))
(e :id 5 :to ,(new weighting of '(1 4 6 7)))
(f :id 6 :to ,(new weighting of '(4 5 8 0)))
(g :id 7 :to ,(new weighting of '(1 5 8 9)))
(h :id 8 :to ,(new weighting of '(6 7 9 0)))
(i :id 9 :to ,(new weighting of '(2 7 8 10)))
(j :id 10 :to ,(new weighting of '(2 9 11 0)))
(k :id 11 :to ,(new weighting of '(3 4 10 0)))
(l :id 0 :to ,(new weighting of '(6 8 10 11))))))
;; NONREPEATING-GRAPH
;; graph with no loops; takes a list
(defmacro nonrepeating-graph (vals)
`(new weighting of
(loop for x in ,vals collect
(list x :max 1))))
;; NEIGHBOR-NODELIST
;; utility for 'neighbor-graph'
(defun neighbor-nodelist (mylist &optional (leapfactor 3))
(let* ((listlen (length mylist)))
(loop for n to (- listlen 1) collect
(let ((v (nth n mylist)))
`(,v :id ,v :to
,(new weighting :of
(mapcar (lambda (x)
(list (nth x mylist) :weight
(if (eql n x) 0
(max 0
(- leapfactor
(abs (- x n)))))))
(indices listlen))))))))
;; NEIGHBOR-GRAPH
;; graph that favors neighbors over 'leaps'
;; leapfactor determines width of allowed leaps (generally)
(defmacro neighbor-graph (alist &optional (leapfactor 3))
`(new graph of (neighbor-nodelist ,alist ,leapfactor)))
;; TAXI-NODELIST
;; utility for 'taxi-graph'
(defun taxi-nodelist (sroot)
(let* ((listlen (* sroot sroot))
(masterlist
(match2lists (indices sroot) (indices sroot)))
(place+steps
(loop for m in masterlist collect
(mapcar (lambda (x) (position x masterlist :test #'seq-eql))
(cons m
(set-difference
(filter
(lambda (x) (or (eql (first m) (first x))
(eql (second m) (second x))))
masterlist)
(list m)))))))
(loop for x in place+steps collect
`(,(car x) :id ,(car x) :to
,(new weighting :of (cdr x))))))
;; TAXI-GRAPH
;; vertical & horizontal moves within a square
;; [moves only 'vertically' & 'horizontally']
;; eg '(1 0) --> (1 3) or (2 0), but not (2 2)
;; takes square root ie, length of side; # chords
;; returns indices (integers)
;; can be used for bzmult-simple chord matrices
(defmacro taxi-graph (sroot)
`(new graph of (taxi-nodelist ,sroot)))
;; BZ-MATX -- complete matrix of bzmult-simple
;; takes list of chords
(defun bz-matx (chds)
(loop for chd in chds append
(mapcar
(lambda (x) (bzmult-simple chd x))
chds)))
;; BZ-TAXIPATH
;; generates taxi-graph path of 'chds' of length 'len'
(defun bz-taxipath (chds len)
(chooser
(next (taxi-graph (length chds)) len)
(bz-matx chds)))
| 6,707 | Common Lisp | .lisp | 163 | 36.90184 | 62 | 0.57585 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 8d37847df068518ffed70d357a44fbf9749db143cb44bbc051b290c4f6578418 | 15,868 | [
-1
] |
15,869 | phrasing.lisp | gogins_csound-extended-nudruz/sources/phrasing.lisp | (in-package :cm)
;(load "sources/rewrite.lisp")
;;;
;;; Temperly-inspired phrasing (hierarchies)
;;;
;; FRASETREE -- general recursive function (makes midi)
;; pitvec = base melody
;; list-of-levels = figures from slow to fastest [list of lists]
;; basedur = duration of slowest line
;; e.g. (frasetree (indices 12 40)
;; (list (transp '(3 2 0) 12) (transp '(0 2 4 6) 24)) 3)
(defun frasetree (pitvec list-of-levels basedur)
(let ((pitlen (length pitvec)))
(process for x in pitvec
output (multievent 'midi :keynum
:keynum x
:time (now)
:duration basedur)
when list-of-levels
sprout (frasetree
(flatten (transp (car list-of-levels) x))
(cdr list-of-levels)
(/ basedur (length (car list-of-levels))))
wait basedur)))
;; FRASETREE-PITS
;; general recursive function (builds pitch-slot vector)
;; pitvec = base melody
;; list-of-levels = figures from slow to fastest [list of lists]
;; e.g. (frasetree-pits (randvec 26 8 20)
; (list (transp (randvec 5) 14)
; (transp (randvec 4) 23)))))
(defun frasetree-pits (pitvec list-of-levels)
(let ((pitlen (length pitvec))
(bigdur (apply #'* (mapcar #'length list-of-levels))))
(merge-slots
(list (menses pitvec bigdur)
(loop for x in pitvec
when list-of-levels
append (frasetree-pits
(transp (car list-of-levels) x)
(cdr list-of-levels)))))))
| 1,707 | Common Lisp | .lisp | 41 | 31.853659 | 68 | 0.543742 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 7969543f4e93b4c187e643d035f19ebb505c2289fb7fc8b6d15d24766a25d85c | 15,869 | [
-1
] |
15,870 | a-star.lisp | gogins_csound-extended-nudruz/sources/a-star.lisp | ;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-
; (in-package :User)
(in-package :cm)
;;;==========================================================================
;;;==========================================================================
;;;==========================================================================
;;; 11/90 Marty Hall [Many missing optimizations -- MRH '94]
;;; Defines a generic version of the A* search routines.
;;; It is generic in the sense that it should work for any application domain where
;;; you have separately defined
;;; A) The Start position
;;; B) The Goal position (or NIL if you define an appropriate Goal-Function)
;;; C) A Goal-Function that tests if a position is a goal. This defaults to
;;; testing if the position is EQUAL to the Goal position.
;;; D) A Child-Generator-Function that, given a position, generates all the
;;; positions that can be reached in one step.
;;; E) An H-Function that gives an estimate of the distance to the goal.
;;; This implementation assumes that the H-Function is also a legitimate
;;; distance function -- ie for moves of one step it correctly measures the
;;; distance. Note the requirement that the H-Function be
;;; non-overestimating, otherwise A* might find a non-optimal solution.
;
;;; Note that the application-domain routines that use A* do NOT need to know anything
;;; about how nodes are represented or even how A* works at all.
;
;;; Eg, assume that you have a function 'Generate-Child-Words' that, given a
;;; string such as "love" finds all legal English words one letter different
;;; (lone, live, dove, etc). Also assume that you have a function called
;;; 'Word-Difference' that, for two words of the same length, tells how many
;;; letters fail to match exactly (eg 2 for "love" and "dive", 1 for "love" and "dove").
;;; Now (A* "love" "hate"
;;; :Child-Generator-Function 'Generate-Child-Words
;;; :H-Function 'Word-Difference)
;
;;; will use A* to find a word ladder between "love" and "hate". Using the
;;; Symbolics dictionary, it gives (love cove cave have hate).
;;;==========================================================================
;;;==========================================================================
;;;==========================================================================
;;;==========================================================================
(defvar *Open*)
(defvar *Closed*)
;;;==========================================================================
;;; Top-Level A* routine. Marty Hall.
(defun A* (Start Goal &key (Goal-Function #'equal)
(Child-Generator-Function #'Generate-Children)
(H-Function #'Heuristic-Estimate)
)
(let ((Current-Node))
(setq *Open* (list (Make-Initial-Node Start)))
(setq *Closed* '() )
(loop
(if
(endp *Open*)
(return (Failure)) )
(setq Current-Node (First-Open-Node))
(push Current-Node *Closed*)
(when
(Goal? Goal-Function Current-Node Goal)
(return (Show-Solution Current-Node)))
(Add-Children-to-Open Current-Node
Child-Generator-Function
H-Function
Goal)
(Sort-Open-List)
)
))
;;;==========================================================================
(defun Make-Initial-Node (Entry)
(list (list Entry nil) '(0 nil))
)
;;;==========================================================================
(defun Make-Node (Entry G-Value Parent H-Function Goal)
(list (list Entry Parent)
(list (+ (funcall H-Function Parent Entry) G-Value)
(funcall H-Function Entry Goal)) )
)
;;;==========================================================================
(defun Goal? (Test Node Goal-Entry)
(funcall Test (Entry Node) Goal-Entry)
)
;;;==========================================================================
(defun Failure ()
; (format t "~%No solution exists!~%")
(values)
)
;;;==========================================================================
;;; Takes the first node (ie one with the best f value) off the OPEN list, and then
;;; removes all other nodes that get to that same position (entry) by a different route.
;;; Marty Hall
(defun First-Open-Node ()
(let ((Node (pop *Open*)))
(setq *Open* (delete (Entry Node) *Open* :key #'Entry :test #'equal))
Node
))
;;;==========================================================================
(defun Sort-Open-List ()
(setq *Open* (sort *Open* #'Node-Less-Than?))
)
;;;==========================================================================
;;; Should really break ties by choosing the larger G.
(defun Node-Less-Than? (Node1 Node2)
(< (Node-F-Value Node1) (Node-F-Value Node2))
)
;;;==========================================================================
;;; F value is G+H. Marty Hall.
(defun Node-F-Value (Node)
(+ (G-Value Node) (H-Value Node))
)
;;;==========================================================================
;;; A node is represented as a list: ((Current-Entry Parent-Entry) (G-Value H-Value).
;;; Marty Hall
(defun G-Value (Node)
(first (second Node))
)
;;;==========================================================================
;;; A node is represented as a list: ((Current-Entry Parent-Entry) (G-Value H-Value).
;;; Marty Hall
(defun H-Value (Node)
(second (second Node))
)
;;;==========================================================================
;;; A node is represented as a list: ((Current-Entry Parent-Entry) (G-Value H-Value).
;;; Marty Hall
(defun Entry (Node)
(first (first Node))
)
;;;==========================================================================
;;; A node is represented as a list: ((Current-Entry Parent-Entry) (G-Value H-Value)).
;;; Marty Hall
(defun Parent (Node)
(second (first Node))
)
;;;==========================================================================
;;; Generates children of a node, and puts all that are NOT on ClOSED list onto OPEN list.
;;; Marty Hall.
;;; Obviously, a hash table for Closed would be a LOT faster.
(defun Add-Children-to-Open (Node Child-Generator-Function H-Function Goal)
(let ((G (G-Value Node))
(Entry (Entry Node))
(Child-Nodes '()) )
(dolist (Child (funcall Child-Generator-Function Entry))
(unless (member Child *Closed* :key #'Entry :test #'equal)
(push (Make-Node Child G Entry H-Function Goal) Child-Nodes) ) )
(setq *Open* (nconc Child-Nodes *Open*))
))
;;;==========================================================================
;;; Recursive routine to trace back through CLOSED list for entire solution path ending
;;; at Node. Ie finds the parent of Node, its parent, and so on back to the starting
;;; node, for which there is no parent.
;;; Marty Hall.
(defun Show-Solution (Node)
(let ((Entry (Entry Node))
(Parent (Parent Node)) )
(if
Parent
(append (Show-Solution (first (member Parent *Closed* :key 'Entry)))
(list Entry))
(list Entry))
))
;;;==========================================================================
;;; Debugging purposes only.
;;; Marty Hall
(defun Describe-Solution (Node)
(format t "~%Solution node=~S, with a G value of ~D." Node (Value Node))
)
;;;==========================================================================
(defun A*-Nodes-Stored ()
(+ (length *Open*) (length *Closed*))
)
;;;==========================================================================
| 7,505 | Common Lisp | .lisp | 171 | 41.350877 | 90 | 0.499726 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 4afc7782b80d64c27bf145649e10a617a7c74682db68e41e2bfa07edfc00d210 | 15,870 | [
-1
] |
15,871 | rewrite-todo.lisp | gogins_csound-extended-nudruz/sources/rewrite-todo.lisp | (in-package :cm)
(load "rewrite.lisp")
; thue-morse
(defun morse-thue (len)
(loop for x from 0 to (- len 1) collect
(mod (logcount x) 2)))
;; the binary representation of an integer
;; = (write x :base 2)
(car (multiple-value-list
(reduce #'+ (write-to-string 9 :base 2))
(bit 9)
(char-int (write-to-string 9 :base 2))
(char-int (digit-char 7))
(morse-thue 10)
(mod 3 2)
(define samplerules
'((s -> (a b c))
(a -> (a sma b))
(a -> (b c))
(b -> (sma a c))
(b -> (smb c))
(c -> c)
(sma -> sma)
(smb -> smb)))
(defun derive (rules nonterminals init)
(if (intersection nonterminals init)
(derive rules nonterminals (rw-next rules init))
init))
(define myauto
(new rewrite of
'(((1 letter) -> 3)
((1 digit) -> 2)
(2 -> 2)
((3 letter) -> 3)
((3 digit) -> 3)
(3 -> 3)
(1 -> 1))
:initially '(1 letter)))
(derive sample2 '(1 2 3) '(1 letter letter digit letter))
(define abcrw (new rewrite :of '((a :id a)
(b :id b)
(c :id c))
:initially '(a b c)
:rules '(
(a -> c)
(b -> b)
(c -> c)
)))
(next abcrw 20)
(define mytrans (new rewrite of ))
(define abrw
(new rewrite
:of '((a :id a)
(b :id b))
:initially '(a b)
:rules '(
(a -> a b a)
(b -> b b)
)))
(next abrw 10)
(defun abrw-fun (myfirst mysecond len)
(let ((intern-rw (new rewrite
:of `((,myfirst :id a)
(,mysecond :id b))
:initially '(a b)
:rules '(
(a -> a b a)
(b -> b b)
))))
(next intern-rw len)))
(abrw-fun .5 .25 20)
(define abrw2
(new rewrite
:of '((a :to (a b a))
(b :to (b b)))
:initially '(a b)))
(next abrw2 10)
(define dkauto
(new rewrite
:of '((a :id a)
(b :id b))
:initially '(a)
:rules '(
(a -> a b)
(b -> b b)
)))
(define myauto
(new rewrite :of '((n1 :id n1)
(n2 :id n2)
(n3 :id n3)
(a :id a)
(b :id b))
:initially '(n1 b)
:rules '(((n1 a) -> n3)
((n1 b) -> n2)
((n3 a) -> n3)
((n3 b) -> n3))
:for 100))
(next myauto 10)
(define myauto2
(new rewrite :of '((bigS :id bigS)
(bigA :id bigA)
(bigB :id bigB)
(a :id a)
(b :id b)
(c :id c))
:rules '((bigS -> bigA bigB c)
(bigA -> a bigB)
(bigA -> bigB c)
(bigB -> a bigA c)
(bigB -> b c))))
(next myauto2 100)
;;;
(defun rwmangle-gens (smalldur largedur gens)
(let ((intern-rw
(new rewrite
:of `((,smalldur :id 1)
(,largedur :id 2))
:initially '(1)
:rules '((2 -> 1 1 2)
((1 1) -> 2 2)))))
(loop repeat gens collect
(loop until (eop? intern-rw) collect (next intern-rw)))))
(rwmangle-gens .5 2 10)
(
(defun mypat (startnum gens)
(let* ((intern-rw (new rewrite
:of '((+1 :to (+1 -1 +1))
(-1 :to (-1 -1 +1)))))
(intern-range
(new range
:initially 25
:stepping intern-rw)))
(loop repeat gens collect
(loop until (eop? intern-rw) collect (next intern-range)))))
(define steprw (new rewrite :of `(,a ,(+ a )
(define mystep (new range :initially 1 :stepping -1 +3 -3)))
(next mystep 10)
(mypat '(25) 10)
(new range :initially 25
:stepping
(loop until eop? my
;; work with melints!!!
'(1 4 -2 3)
(define newstep
(new rewrite :of '((0 :id a)
(1 :id b)
(-1 :id c))
:initially '(a)
:rules '((a -> a b)
; (b -> b)
; (c -> c)
)))
(next newstep :chunk)
(pickl '(4 6 9))
(melint->line 1 '(0 0 1 -1 0 1 -1 1 -1 0 1 -1 1 -1 1 -1 0 1 -1 1))
(melint->line 40 '(2 2 3))
;;;;;;; RANDOM BOOLEAN NETWORKS -- model on 'life2d'
(rand01array 3 4 .5) | 4,465 | Common Lisp | .lisp | 159 | 19.031447 | 67 | 0.428605 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 4e3a2b301f4eef69a0ad846b066a9f81aaf28a8c4adfbbb0e3957dcef0e22cc9 | 15,871 | [
-1
] |
15,872 | scratch.lisp | gogins_csound-extended-nudruz/sources/scratch.lisp | (in-package :cm)
;; KEEPERS
(events
(splay
(transp
(mapcar (lambda (x) (car (stack-by x 7)))
(flatter
(mapcar (lambda (x) (stravrot x 'n))
(subsequences (randhexrow) 6))))
45)
(makecyc (transp (code->durs (resclassvec 3 5 7)) 2)))
"out.mid" :play 'nil)
;; WORK
(defparameter three 3)
(* 8 3)
(events
(new seq :name 'sevens
:subobjects
(list (new cmn :time 0 :expr '(meter 7 8))
(new cmn :time 0 :expr 'cs-major)
(new cmn :time 0 :note 'c4
:duration (rhythm 'h..)
:data '(pppp))
(new cmn :time 3.5
:note 'df5 :duration (rhythm 'e)
:data '(accent sfz))
(new cmn :time 4 :note 'f4
:duration 2
:data '(mp fermata))))
"sevens.eps")
(in-package :cm)
(in-package :cmn)
(use-package :cmn)
(defun testit (stf len nts)
;; midi channel numbers map to staves.
(let ((nts (new heap :notes nts))
(rhy (new weighting
:of (list 1
(new cycle :of '(1/2 1/2))))))
(process while (< (now) len)
for n = (next nts)
for r = (next rhy)
output (new midi :time (now)
:duration r
:keynum n
:channel stf)
wait r)))
;;; define staff descriptions
(defparameter staffs
'((0 :name "Viola" :clef :alto :meter (4 4))
(2 :name "Flute" :clef :treble :meter (4 4))))
;;; generate an .eps file
(events (list (testit 0 12 '(c3 d ef f g))
(testit 1 12 '(c5 d ef f g)))
"testit.eps"
:staffing staffs
:size 24
:exact true
:title "Hiho!")
;;; another way to set score properties
(io "duet.cmn" :staffing staffs :size 20
:exact true :title "Duet")
;;; generate a .cmn file
(events (list (testit 0 12 '(c3 d ef f g))
(testit 1 12 '(c5 d ef f g)))
"duet.cmn")
(defparameter myline
(process repeat 30
for dur = .25
output (multievent 'midi :keynum
:keynum (round (+ (now) 60))
:time (now)
:duration dur)
wait dur))
(events myline "mtb.midi" :play 'nil)
(note :keynum 63.4)
(defparameter snarepits (copylist '(38) 216))
(defparameter s2 (rwgen sfree3rules '(1) 2))
(defparameter s3 (rwgen sfree3rules '(1) 3))
(defparameter snp (tpoints snarepits s3 3))
(defparameter cymp (tpoints (copylist '(51 R R R R R) 36)
(transp s2 6 #'*) 18))
(defun dkplay3 (pitvec)
(process
for x in pitvec
for dur = .25
when (or (numberp x) (listp x));; needed for rests
output (multievent 'midi :keynum
:keynum x
:channel 9
:time (now)
:duration dur)
wait dur))
(events (list (dkplay3 (scf '(36 40 42) s3))
(dkplay3 cymp)) "dkplay3.midi" :play 'nil)
;; stravrots as verticalities
(events
(let ((rots
(stravrot (heapvec 5) 'nest)))
(loop for n to (- (length rots) 1) collect
(splay (transp (nth n rots) (* 12 (+ 3 n))) 1.5)))
"out.midi" :play 'nil)
(let ((ms
(merge-slots
(stravrot (heapvec 7) 'nest))))
(matchreg-chds
(cons
(list (transp (car ms) 60))
(cdr ms))))
(merge-slots
(stravrot (heapvec 3 12 60) 'nest))
(heapvec 5 12 60)
;; STRAV-EXPAND -- returns rot verticals following pit & line
(defun strav-expand (inpit inline)
(let ((rots (merge-slots (stravrot inline 'nest))))
(transp rots (- inpit (car rots)))))
(events
(splay
(strav-expand 60 (heapvec 4)) 1.6)
"out.midi" :play 'nil)
(strav-expand 60 '(6 3 8))
(first '(3 4 5))
(transp '(4 (5 10) 6) 60)
;;
(defparameter entro (flatten (transp (entropy '(0 1 3 5)) 60)))
(defparameter centro (au-contraire entro 50))
(defun dkplay4 (pits)
(process
for x in pits
for dur = .125
when (or (numberp x) (listp x));; needed for rests
output (multievent 'midi :keynum
:keynum x
:time (now)
:duration dur)
wait dur))
;; !!
(events (list (dkplay4 entro) (dkplay4 centro)) "dkplay4.midi" :play 'nil)
;; !!
(events
(dkplay4
(make-poly
(transp
(flatten (loop for x in (shuffle (permutations (indices 5))) collect
(give-contour-to-mel x '(5 3 6 2 0)))) 40) '(2 1 3 1 1)))
"dkplay4.midi" :play 'nil)
;; !!
(events
(dkplay4
(smoothlist
(make-poly
(transp
(flatten (loop for y in (entropy '(0 1 3 5)) collect
(give-contour-to-mel '(1 2 0 3) y))) 52)
'(2 1 3 1 1))))
"dkplay4b.midi" :play 'nil)
;; frags
(events
(let ((pitlist (smoothlist
(entropy (matchreg (heapvec 4 12) '(36 60 72 84))))))
(frags
pitlist
(transp (loop for x in pitlist collect (length x)) .25 #'*)
(transp (heapvec 20 17) .25 #'*)))
"dw.midi" :play 'nil)
;; arpegg
(events
(splay
(arpegg (heapvec 200 24 60) (heapvec 3 4 2) (heapvec 10 4 3))
.125)
"out.midi" :play 'nil)
;; extraction, au-contraire etc
(defparameter mypits
(norpt (play-mode (flatten (loop for x in (heapvec 20 7) collect
(chd-inversion '(29 31 30 27) x))) stravmode)))
(events
(let* ((mypits (randsteps 70 55))
(xtract5 (extract mypits (lambda (x) (eql 5 (mod x 6)))))
(xtract3 (extract mypits (lambda (x) (eql 3 (mod x 4))))))
(list
(splay mypits .25)
(splay
(doubler
(au-contraire
(sublinepits (slowline mypits '(2 5))) 50) 7)
(transp (sublinedurs (slowline mypits '(2 5))) .25 #'*))
(splay (doubler (sublinepits xtract5) -16)
(transp (sublinedurs xtract5) .25 #'*))
(splay (doubler (sublinepits xtract3) 8)
(transp (sublinedurs xtract3) .25 #'*))
))
"out.midi" :play 'nil)
;; voice-leading etc.
(events
(splay
(bestpath (primefilt (fromto '(61 72 75) '(50 65 75)) '(0 1 3)))
6.0)
"bp.midi" :play 'nil)
;; tonnetz
(events
(let ((tpits (smoothlist (transp (tzrandchain '(5 15 21) 200) 50))))
(splay tpits (durweight tpits .5)))
"out.midi" :play 'nil)
;; entropy
(events
(let ((pits
(smoothlist (entropy (transp '(50 36 57) 12)))))
(splay pits (durweight pits .25))) "out.midi")
(events
(let ((pits
(smoothlist (entropy (transp '(50 36 57 61) 12)))))
(splay pits (durweight pits .25))) "out.midi")
(events
(let ((pits
(smoothlist
(events
(let ((pits
(smoothlist
(matchreg-chds (entropy (transp '(50 36 57 61) 12) 'iflag)))))
(splay pits (durweight pits .25))) "out.midi")
(matchreg-chds (entropy (transp '(50 36 57 61) 12) 'iflag)))))
(splay pits (durweight pits .25))) "out.midi")
;; embell-triad
(events
(let ((pits
(smoothlist (embell-triad (transp '(50 36 57) 12)))))
(splay pits (durweight pits .25))) "out.midi")
;; stack-by
(defparameter sb (stack-by (heapvec 5 12 40) 5))
(events
(splay (transp sb 14) 1.25) "out.midi")
;; GENERAL WORK BELOW
;;;
;; general inflection for a line
(defparameter mylist (randsteps 50 10))
(defparameter mylist '(1 2 3 5 3 4 6))
;;; NEEDS WORK
(defun un-inflect (melody)
(let ((mlint (melint melody)))
(melint->line (car melody)
(loop for x to (- (length mlint) 2) collect
(cond ((and (eql (nth x mlint) 2)
(eql (nth (+ x 1) mlint) -2))
1)
((and (> x 0)
(eql (nth x mlint) -2)
; MKG changed
; (eql (nth (- x 1 mlint) 2)))
(eql (nth (- x 1) mlint) 2))
-1)
(t (nth x mlint)))))))
;;; now for some diff equations
(define-diff diff1
(0 1)
((lambda (x) (* x x))
(lambda (x) (mod x 3)))
(lambda (x) (mod x 12)))
;; a loop
(defparameter diff1vals '(0 1 5 11 6 1 1 2 6 9 4 2 2 3 4 10 5 3))
(define-diff diff2
(0 1 1)
((lambda (x) (* x x))
(lambda (x) (mod x 3))
(lambda (x) (* -1 x)))
(lambda (x) (mod x 12)))
;(diff-vals 'diff2 0 30)
(defparameter diff2vals '(0 9 1 4 1 1 9 3 4 10 10 7))
(define-diff diff3
(1 3 4)
((lambda (x) 0)
(lambda (x) x)
(lambda (x) (* -1 x)))
(lambda (x) (mod x 12)))
(diff-vals 'diff3 0 20)
(defparameter diff3vals '(3 4 1 9 8 11))
(define-diff diff3b
(1 1 4)
((lambda (x) 0)
(lambda (x) (* 3 x))
(lambda (x) (* -1 x)))
(lambda (x) (mod x 12)))
(diff-vals 'diff3b 0 30)
(defparameter diff3bvals '(1 4 11 5 4 7 5 8 7 1 8 11))
(floor (* 12 (sin 2)))
(defparameter d12
(apply-across #'-
(diff-vals 'diff1 0 100)
(diff-vals 'diff2 0 100)))
(defparameter d12b
(apply-across #'min
(diff-vals 'diff1 0 100)
(diff-vals 'diff2 0 100)))
(define-diff diff3c
(1 1 4)
((lambda (x) x)
(lambda (x) (* 3 x))
(lambda (x) (* -1 x)))
(lambda (x) (mod x 12)))
(diff-vals 'diff3c 0 20)
(events (splay
;(transp diff3bvals 50)
(transp (modmult diff3bvals 5 16) 50)
.25) "out.midi")
;;;;; FUN WITH CM-2.7
;; the 'ran' function
;; :type :exponential -> centered around 0; low (dec.) :a = high entropy
(defparameter ranpits
(loop repeat 200 collect
(+ (round (* 10
(ran :type :gaussian))) 60)))
; (0 0 2 2 1 6 12 7 14 13 25 12 21 13 20 12 18 7 5 4)
(defparameter ranpits
(loop repeat 200 collect
(+ (round (* 40
(ran :type :beta :a 2 :b 10))) 40)))
;; a=15 b=3
;; (0 0 0 0 0 0 0 0 0 0 0 4 2 2 18 31 39 45 49 10)
;; a=5 b=3
;; (0 0 0 0 5 2 3 9 7 9 17 23 14 23 31 18 23 7 9 0)
;; a=2 b=10
;; (12 32 46 30 37 18 7 9 7 1 1 0 0 0 0 0 0 0 0 0)
(defparameter ranpits
(loop repeat 200 collect
(+ (round (* .5
(ran :type :cauchy :a 't) 60)))))
;; cauchy = very large domain
;; e.g.
;; (7 44 59 7 12 188 30 5 213 47 2418 82 27 96 205 8 15 1
;; 11 35 116 46 35 27 2519 16 22 215 117 24 11
;; 212 11 2 4 66 0 10 5 36 13 86 79 25 1 80)
;; (histogram ranpits 0 5000 10) = (194 2 0 0 1 1 0 1 0 0)
(defparameter ranpits
(loop repeat 200 collect
(+ 30 (round (* 1
(ran :type :poisson :a 30))))))
;; a=20
;; (0 0 0 2 13 28 44 52 34 22 2 3 0 0 0 0 0 0 0 0)
;; a=30
;; (0 0 0 0 0 0 7 15 22 42 42 33 22 10 3 3 1 0 0 0)
(defparameter ranpits
(loop repeat 200 collect
(+ 30 (round (* 1
(ran :type :gamma :a 30))))))
;; a=30
;; (0 0 0 0 0 0 0 21 33 33 48 35 13 10 4 2 1 0 0 0)
(histogram ranpits 30 90 20)
(defparameter dpickpatt (new random of '(3 4 5)))
(defparameter ranpits
(loop repeat 200 collect
(+ (round (* 5
(ran :type :exponential :a .6))) 50)))
(events
(list
(splay (norpt ranpits) .25)
(let ((sd
(slots->durs
(slowline (norpt ranpits)
(listsub '(2 4 5) '(0 1 2)
(rwgen sfree3rules '(1 2 0) 3))))))
(splay
(transpose (first sd) 15)
(transp (second sd) .25 #'*)
))
(let ((sd2
(slots->durs
(extract ranpits (lambda (x)
(and (eql 0 (mod x 3))
(keynum x :in? stravmode)))))))
(splay
(mapcar (lambda (x)
(if (numberp x)
(list x (+ x (next dpickpatt)))
'r))
(first sd2))
(transp (second sd2) .25 #'*)))
) "ran.midi" :play 'nil)
(defun msd2 ()
(slots->durs
(extract ranpits (lambda (x)
(and (eql 0 (mod x 3))
; MKG: Not sureif mapcar is part of msd2 or not.
(keynum x :in? stravmode)))))
(mapcar (lambda (x) (list x (+ x (next dpickpatt)))) (first msd2)))
;; vln=40
;; vla=41
;; cello=42
;; trem=44
;; pizz=45
(events
(splay
(embell-triad (randvec 3 10 60))
(quantlist (ransegs 17 :sum 20) .25)
)
"out.midi" :play 'nil)
(histogram
(ransegs 17 :type :gaussian :sum 20)
0 10 10)
(splay (durfunc 20 rs '(round (+ 50 (* 20 (sin x))))
rs)
"out.midi" :play 'nil)
(mapcar (lambda (x) (quantize x .25))
(ransegs 20 :min 0 :max 20))
; MKG looks like leftover stuff...
;
;.25))
(quantize 3.4444 .25)
(quantlist (ransegs 20 :min 0 :max 20) .25)
(merge-slots (list (transp ranpits 12)
(transp ranpits 17)))
(doubler ranpits '(12 11))
(tintab ranpits stravmode)
;;;;;; ransegs
(mapcar #'round (ransegs 10 :min 0 :max 100))
; (0 0 5 9 25 27 37 74 78 100)
(ransegs 10 :sum 300)
; (10.133752 5.1309223 49.804874 17.160149 23.859093
; 13.688698 21.912834 62.28282 68.71735 27.30951)
(mapcar #'round (ransegs 10 :min 0 :max 100 :type :gamma :a 15))
; (0 6 25 27 36 37 38 45 56 100)
(mapcar #'round (ransegs 10 :sum 300 :type :poisson :a 50))
; a=50 (92 25 17 8 25 8 17 50 8 50)
(loop for x from 10 to 60 by 10 collect
(mapcar #'round (ransegs 10 :min 0 :max 100 :type :poisson :a x)))
;; [skews away from divisor as :a increases]
; a=10 (0 10 20 30 40 50 70 80 90 100)
; a=20 (0 18 29 35 41 47 71 76 82 100)
; a=30 (0 17 29 42 46 54 58 62 96 100)
; a=40 (0 12 17 29 33 42 46 71 75 100)
; a=50 (0 21 25 46 54 71 79 83 88 100)
; a=60 (0 11 28 33 39 50 56 67 72 100)
(loop for x from 1 to 6 collect
(melint->line 0 (mapcar #'round (explsegs 10 100 x))))
;(0 10 20 30 40 50 60 70 80 90 100)
;(0 7 15 23 32 41 51 62 74 86 99)
;(0 6 12 19 27 36 46 57 70 84 100)
;(0 5 11 18 26 35 45 56 69 84 101)
; (0 4 9 15 22 30 40 51 64 80 99)
; (0 4 9 15 22 30 40 51 65 81 101))
;;; overtones, spectral, etc.
(events
(splay
(list
(mapcar #'round (keynum
(loop for x from 1 to 20 by 2 collect (* 30 (* 2 x)))
:hz #t)))
5.0) "chord.midi" :play 'nil)
;; exponential warping of overtones
(events
(splay
(loop for n from 1 to 10 collect
(remove-duplicates
(let ((myexp (explsegs 10 20 n))) ; or reversed explsegs
(mapcar #'round (keynum
(loop for x from 1 to 10 collect
(* 30 (* (nth (- x 1) myexp) x)))
:hz #t)))))
5.0) "chord.midi" :play 'nil)
;; fm with changing carrier
(events
(splay
(loop for x from 100 to 200 by 5 collect
(mapcar #'round
(fm-spectrum x 1.4 4 :spectrum ':keynum)))
5.0) "chord.midi" :play 'nil)
;; ring modulation with changing carrier
(events
(splay
(loop for x from 300 downto 200 by 5 collect
(mapcar #'round
(rm-spectrum (list x 400) 550 :hz #t :spectrum ':keynum)))
5.0) "chord.midi" :play 'nil)
;;; --> use strength of partials/sidebands to drive # of repetitions etc.
;;; fun with modes
;drunk
(loop repeat 50
for r = 40
then (drunk r 2 :low 30 :high 50)
collect r)
;; humayun mode (smaller than mod12) steps '(1 3 1 2 2) = (0 1 4 5 7)
(events
(splay (play-mode (randsteps 40 200 20 70) humayun)
.125) "mode.midi" :play 'nil)
;; inflect
(events
(splay
(flatten
(mode-inflect
(randsteps 40 200 20 70)
ionian
'(dn 11 10)
'(ln 2 (3 2 3))
'(dn 5 6)))
.125) "mode.midi" :play 'nil)
;; beta distribution, shushtar mode
(events
(splay
(norests
(remove-rpts
(transp (play-mode
(loop repeat 200 collect
(+ (round (* 40
(ran :type :beta :a 2 :b 10))) 40))
shushtar) -10)))
.125) "mode.midi" :play 'nil)
;;; canons?
;; finnissy effect
(events
(let ((mypits (heapvec 100 10 50))
(durs (strums 20 2 6 4 6)))
(list
(splay mypits (ferney '(1) '(4) durs))
(splay (transp mypits 3) (ferney '(1) '(5) durs))
(splay (transp mypits 21) (ferney '(1) '(3) durs))))
"out.midi" '(0 2 7) :play 'nil)
;; converging-diverging
(events
(let ((mypits (heapvec 1000 10 50))
(durs (strums 2 2 6 4 6))
(divlist '(2 3 4 5 6 8))
(sectionlen 20))
(list
(splay
(heapvec 300 4 50)
(sum-across-all (tempo-shape divlist sectionlen) durs))
(splay
(heapvec 300 4 60)
(sum-across-all (tempo-shape (reverse divlist) sectionlen) durs))))
"out.midi" :play 'nil)
;; "chasing" tempi
(events
(let ((mypits (heapvec 1000 10 50))
(durs (strums 2 2 6 4 6))
(divlist '(2 3 4 5 6 8))
(sectionlen 20))
(list
(splay
(heapvec 300 4 50)
(sum-across-all (tempo-shape divlist sectionlen) durs))
(splay
(heapvec 300 4 60)
(sum-across-all (tempo-shape (transp divlist 1) sectionlen) durs))))
"out.midi" :play 'nil)
;; slot stress hierarchy as union of residue classes
;; example: Union of mods 2,3,5 below
; [3=all 3 mods intersect, ....,0=no mods occur]
; (resclassvec 2 3 5) =
; '(3 0 1 1 1 1 2 0 1 1 2 0 2 0 1 2 1 0 2 0 2 1 1 0 2 1 1 1 1 0))
(events
(splay
(make-poly (heapvec 800 40 40) (resclassvec 2 3 11))
.125)
"out.midi" :play 'nil)
(events
(splay
(mel-stress (heapvec 100 10 70) (transpose '(2 0 1 0) 1))
.125)
"out.midi" :play 'nil)
(events
(splay
(merge-slots
(list
(mel-stress (heapvec 100 10 80) (resclassvec 2 3 5 7))
(mel-stress (heapvec 100 10 70) (resclassvec 2 3 5 7))
(mel-stress (heapvec 100 10 30) (resclassvec 2 3 5 7))
(mel-stress (heapvec 100 10 50) (resclassvec 2 3 5 7))))
.125)
"out.midi" :play 'nil)
(events
(list
(splay (pick-stress 100
(transpose '((0 4 7) (2 9) (1 11)) 60) '(3 1 2 1)) .25)
(splay (pick-stress 100
(transpose '((0 4 7) (2 9) (1 11)) 48) '(3 1 2 1)) .25)
(splay (pick-stress 100
(transpose '((0 4 7) (2 9) (4 11)) 72) '(3 1 2 1)) .25))
"out.midi" :play 'nil)
(events
(let ((myvec (make-poly (heapvec 12 12) '(4 4 4))))
(list
(splay (pick-stress 1000 (transpose myvec 60) (resclassvec 2 3 5)) .125)
(splay (pick-stress 1000 (transpose myvec 36) (resclassvec 2 3 5)) .125)
(splay (pick-stress 1000 (transpose myvec 72) (resclassvec 2 3 5)) .125)))
"out.midi" :play 'nil)
(events
(splay
(poly-stress (heapvec 150 50 30) '(3 1 2 1)) .125)
"out.midi" :play 'nil)
;; mt-areas
(events
(splay
(make-poly (play-mode (heapvec 300 30 20) stravmode) (randvec 20 2 1))
(sum-across-all (mt-rhyareas 2 3 (heapvec 20 7 3) 2)
(strums 7 2 3 4 7)))
"out.midi" :play 'nil)
;; contour
(defparameter nt6 (ntn->clists '(-1 0 1) 6))
(events
(let ((hv (safesort (heapvec 6 60 30))))
(splay
(loop for n in (flatten nt6) collect (nth n hv))
(makecyc (transp '(.25 .25 .25 .5) 1 #'*))))
"out.midi" :play 'nil)
;;;;;;; work on 'phrasing'
; (defun frasetree (pitvec list-of-levels basedur) ; returns midi
; (defun frasetree-pits (pitvec list-of-levels) ; returns pit-slot vector
(events
(frasetree (heapvec 30 10 60) '((7 2 5) (10 7)) 2)
"out.midi" :play 'nil)
(events
(let ((mypits
(frasetree-pits (heapvec 30 10 60) '((7 2 5) (10 7)))))
(splay mypits (durweight mypits .25)))
"out.midi" :play 'nil)
;; example mixed phrase lengths
(events
(let* ((phraslens (loop repeat 100 collect (pick 2 3)))
(sloline (randsteps 60 100))
(basedur .25)
(slodurs (transp phraslens basedur #'*))
(fastfigs (loop for n to (- (length phraslens) 1) collect
(transp
(if (eql (nth n phraslens) 2) '(7 2) '(7 5 4))
(nth n sloline)))))
(list
(splay sloline slodurs)
(splay (flatten fastfigs) basedur))) "out.midi" :play 'nil)
;;; --->> BUT I want to generalize to all pattern types
;; READLIST -- simple utility
;; reads first 'readlen' members of 'alist'
;; (readlist 3 '(1 2 3 4 5)) = (1 2 3)
(defmacro readlist (readlen alist
&optional (pattype 'line) (args :name 'whatever))
`(next (new ,pattype :of ,alist ,args) ,readlen))
(readlist 30 '(1 2 32 4))
(readlist-mac 30 (indices 5) heap)
(funcall list '(2 3 4))
;;; checking out new pattern functionality
(defparameter mychord
(new chord :of (new heap
:notes '(c5 d ef f g af bf c6)
:for (new rewrite
:of (listsub '(1 2 3) '(0 1 2) pleasantsrules)))))
;; !
(events
(splay
(next mychord 100)
.25) "out.midi" :play 'nil)
(defparameter cyc1 (new cycle :of '(0 1 10)))
(defparameter cyc2 (new cycle :of '(1 10 0)))
(defparameter plcyc
(new rewrite
:of (listsub '(1 2 3) '(0 1 2) pleasantsrules)))
(next plcyc #t)
(defparameter pat1
(new random :of (list (new cycle :keynums '(a4 b c5 d))
(new heap :keynums '(gs4 as cs5 ds)))))
(defparameter pat2
(new cycle :of `(100 ,(new line :of (indices 21) :for 4) 2887
,(new random :of '(44 55 66 77) :for 2))))
(next pat2 #t)
; mixing patterns using "make-instance"
(defun play-pats (pats trope reps rate)
(process with dur = (* rate 2.5)
repeat reps
for len = (pick 8 12 16)
for pat = (make-instance (next pats)
:keynums trope
:for len)
each k in (next pat #t) as x from 0 by rate
output (new midi :time (+ (now) x)
:keynum k
:duration dur)
wait (* rate len)))
(defparameter pcns
(new random :of '((heap :weight 2) line cycle
(palindrome :elide #t) rotation)))
(events (play-pats pcns '(a4 b c5 d) 12 .1) "test.mid")
(defparameter pat1
(new cycle :of (list (new cycle :of '(50 51 51 53)
:for (new cycle :of '(4 3 2 1 0)))
(new cycle :of '(70 71 72 73)
:for (new cycle of '(0 1 2 3)))
(new cycle of '(100 200) :for 1))))
(next pat1 #t)
(defparameter x (new copier :of (new cycle :of '(a b c) :for 2)
:for 3))
(defparameter pat1
(new random :of (list (new cycle :keynums '(a4 b c5 d))
(new heap :keynums '(gs4 as cs5 ds)))))
(note (next pat1 10))
(defparameter xpat (new cycle :of (indices 10) :for (new heap of (indices 3 5))))
(loop repeat 10 collect
(next xpat #t))
;; RAND-POINTLENS -- generates a length for each member of list
(defun rand-pointlens (alist minlen maxlen)
(loop repeat (length alist)
collect (between minlen (+ 1 maxlen))))
(rand-pointlens '(1 2 3 4) 3 5)
(let ((mylist '(1 2 3 4)
(randvec 10 4 32)
;; READTHRU to apply any pattern type
(defmacro readthru (len pattlist &optional (ptype 'line))
`(next (new ,ptype :of ,pattlist) ,len))
(readthru 10 (indices 4) )
;; trying to do READTHRU on list
(defmacro readthru-list (lens pattlist &optional (ptype 'line))
(let ((patt `(new ,ptype :of ,pattlist
:for (new cycle of ,lens))))
(loop repeat (length lens) collect (next patt #t))))
(readthru-list (randvec 5 5 4) (indices 10 50))
;; same figure starts at each dbl point
(defun fig-descent (alist
;; list continues thru each dbl point
(defun list-descent (
;; pattern returns 'next' at each dbl point
(defun pattern-descent
(defparameter apitlist
'(68 67 62 66 65 60 63 69 61 64 60 66 63 67 68 65 61 69 62 64))
; (slowline apitlist '(2 3))
; (68 R 62 R R 60 R 69 R R 60 R 63 R R 65 R 69 R R)
; (slots->durs (slowline apitlist '(2 3)))
; ((68 62 60 69 60 63 65 69) (2 3 2 3 2 3 2 3))
;; for reference:
;; FRASETREE-PITS
;; general recursive function (builds pitch-slot vector)
;; pitvec = base melody
;; list-of-levels = figures from slow to fastest [list of lists]
;; e.g. (frasetree-pits (randvec 26 8 20)
; (list (transp (randvec 5) 14)
; (transp (randvec 4) 23)))
(defun frasetree-pits (pitvec list-of-levels)
(let ((pitlen (length pitvec))
(bigdur (apply #'* (mapcar #'length list-of-levels))))
(merge-slots
(list (menses pitvec bigdur)
(loop for x in pitvec
when list-of-levels
append (phrasetree-pits
(transp (car list-of-levels) x)
(cdr list-of-levels)))))))
(frasetree-pits (randvec 26 8 20)
(list (transp (randvec 5) 14)
(transp (randvec 4) 23)))
;; diachro-classes
;; 2/3 is a great value!!
(events
(let ((shf2d3 (shuffle (diachrom-filt (subsets-len (indices 12) 4) 2/3))))
(splay (transpose shf2d3 60) .75)) "out.midi" :play 'nil)
(events
(let ((pits
(transpose
(placereg
(flatten
(smoothlist
(shuffle (diachrom-filt (subsets-len (indices 12) 4) 2/3))))
following-5) 12)))
(splay pits (durweight pits .25)))
"out.midi" :play 'nil)
(smoothlist (shuffle (diachrom-filt (subsets-len (indices 12) 4) 2/3)))
(placereg '(4 5 9 11) '(4 1 2 5))
(events
(let ((shf2d3 (shuffle (diachrom-filt
(proper-subsets (indices 12))
2/3))))
(splay (transpose shf2d3 60) .75)) "out.midi" :play 'nil)
;; 2/4 is also good value!
(events
(let ((shf2d3 (shuffle
(diachrom-filt (subsets-len (indices 12) 4) 2/4))))
(splay (transpose shf2d3 60) .75)) "out.midi" :play 'nil)
;; 2/2 has some chromatic "bite"
(events
(let ((shf2d3
(matchreg-chds (cons '(36 60 80)
(shuffle
(diachrom-filt
(subsets-len (indices 12) (indices 3 3)) 2/2))))))
(splay (transpose shf2d3 12) .75)) "out.midi" :play 'nil)
;; match-slots
;; place a subvector where it matches within larger vector
;;;;other
(events
(splay
(loop for chd in
(loop for x from 100 to 200 by 5 collect
(mapcar #'round
(fm-spectrum x 1.4 4 :spectrum ':keynum)))
append
(next
(new chord
:of (new heap
:notes chd
:for (new rewrite
:of (listsub '(1 2 3) '(0 1 2) pleasantsrules))))
100))
.25) "out.midi" :play 'nil)
(fm-spectrum 400 1.4 4 :spectrum ':keynum)
(defparameter fmspvec
(loop for chd in
(loop for x from 100 to 200 by 5 collect
(mapcar #'round
(fm-spectrum x 1.4 4 :spectrum ':keynum)))
append
(next
(new chord
:of (new heap
:notes chd
:for (new rewrite
:of (listsub '(1 2 3) '(0 1 2) pleasantsrules))))
100)))
(events
(splay
(conjunct-fragments (topline (keynum fmspvec))) .25) "out.midi" :play 'nil)
(parse-by-reg (topline (keynum fmspvec)))
(defun choral (alist)
(let ((pbr (parse-by-reg alist)))
(loop for p in pbr collect (slots->durs p))))
(choral (topline (keynum fmspvec)))
(events
(loop for x in (choral (topline (keynum fmspvec))) collect
(splay (first x) (transp (second x) .25 #'*)))
"out.midi" :play 'nil)
;; PARSE-BY-REG -- splitting melody into slotlist by register
;; arbitrary range divisions (octsize)
;; (parse-by-reg '(60 2 30 31 61 62))
; = ((R 2 R R R R) (R R 30 31 R R) (60 R R R 61 62))
(defun parse-by-reg (melody &optional (octsize 12) (base 0))
(let* ((mel-octs
(mapcar (lambda (x) (floor (/ (- x base) octsize))) melody))
(allocts (remove-duplicates (safesort mel-octs))))
(loop for x in allocts collect
(loop for y to (- (length mel-octs) 1) collect
(if (eql (nth y mel-octs) x) (nth y melody) 'r)))))
(parse-by-reg
(make-poly
(randvec 80 50) '(2 3)))
;; new utility for redefined 'parse-by-reg'
;; TAKE-REG -- determines [octave] register of pitch num or list
;; added December 2005
(defun take-reg (input &optional (octsize 12) (base 0))
(typecase input
(symbol 'r)
(number (floor (/ (- input base) octsize)))
(list (mapcar (lambda (x) (take-reg x octsize base))
input))))
;; REDEFINE 'PARSE-BY-REG' TO ACCEPT CHORDS & RESTS:
(defun pbr (melody &optional (octsize 12) (base 0))
(let* ((mel-octs (take-reg melody))
(allocts (remove-duplicates (safesort (flatten mel-octs)))))
(loop for x in allocts collect
(loop for y to (- (length mel-octs) 1) collect
(let ((thismo (nth y mel-octs)))
(flet ((putreg (s) (if (eql thismo s) (nth y melody) 'r)))
(typecase thismo
(symbol 'r)
(number (putreg thismo))
(list (loop for t in thismo collect (putreg t))))))))))
(pbr '(10 20 30 40))
(if (numberp (nth y mel-octs))
(if (eql (nth y mel-octs) x) (nth y melody 'r))
(if (eql (nth y mel-octs) x) (nth y melody) 'r)))))
(symbolp 'r)
(pbr (make-poly (randvec 80 50) '(2 3)))
(defun whatfunc (anum)
(let ((thisval 10))
(flet ((thisf (x) (* x x)))
(+ thisval (thisf anum)))))
(whatfunc 7)
;;; testing recursive rewrite
;; outputs midi
(defun rwrecursion (alist tlevels rwrules)
(let ((rwlen (length (car (last (first rwrules))))))
;; test with 's4freerules'
(defun rwrecursion-midi (tone melody transpvec basedur)
(let ((len (length melody))
(levels (length transpvec))
(rwlen (length (car (last (first rwrules))))))
(process for i in melody
for k = (transpose tone i)
;; play current tone in melody
output (new midi :time (now) :duration dur
:amplitude .5 :keynum k
:channel 0)
when transpvec
;; sprout melody on tone at next level
sprout (rwrecursion (transpose k 12)
melody
(- levels 1)
(/ dur len)
amp)
wait dur)))
(events (sierpinski 'a0 '(0 7 5) 4 3 .5) "sier.midi" :play 'nil)
(defun sierpinski (tone melody levels dur amp)
(let ((len (length melody)))
(process for i in melody
for k = (transpose tone i)
;; play current tone in melody
output (new midi :time (now) :duration dur
:amplitude amp :keynum k
:channel 0)
when (> levels 1)
;; sprout melody on tone at next level
sprout (sierpinski (transpose k 12)
melody
(- levels 1)
(/ dur len)
amp)
wait dur)))
(loop for x in (randvec 10 4) collect
(rwgen sfree4rules (list x) 2))
(defparameter sf4 (new rewrite of :sfree4rules))
(menses '(1) 4)
;; sfree3rules is non-uniform [size=3]
(defparameter rw-sf3
(new rewrite
:of sfree3rules
:initially '(1)))
(loop for x in '(0 10 20 30)
(defun rwrecurs (mel levels rwrules)
(list (transpose mel (nth 0 levels))
(transpose (loop for x in mel
collect (rwgen rwrules x 1))
(nth 1 levels))))
(rwrecurs (indices 4) '(60 70) sfree3rules)
(cdr '(1))
;; CURVES
;; time/pitch equations etc.
(defun mtb (mfact subdv)
(process
for dur = (/ 1 subdv)
until (> (now) 20.0)
output (multievent 'midi :keynum
:keynum (+ (expt (now) mfact) 30)
:time (now)
:duration dur)
wait dur))
(events
(list (mtb 1.1 4) (mtb 1.3 5) (mtb 1.4 7))
"mtb.midi" :play 'nil)
(defun mtb (mfact subdv)
(process
for dur = (/ 1 subdv)
until (> (now) 20.0)
output (multievent 'midi :keynum
:keynum (+ (* 20 (sin (* (now) mfact))) 60)
:time (now)
:duration dur)
wait dur))
(events
(list (mtb 1.1 4) (mtb 1.3 5) (mtb 1.4 7))
"mtb.midi" :play 'nil)
(defun mtb (mfact subdv)
(process
for dur in (transp (ferney '(1) (strums 10 2 5 3 6) '(1 1 1 2))
(/ 1 subdv)
#'*)
until (> (now) 20.0)
output (multievent 'midi :keynum
:keynum (+ (* 20 (sin (* (now) mfact))) 60)
:time (now)
:duration dur)
wait dur))
(events
(list (mtb 1.1 4)
;(mtb 1.3 5)
(mtb 1.4 7))
"mtb.midi" :play 'nil)
(defun mtb (mfact subdv)
(process
for dur = (/ 1 subdv)
until (> (now) 20.0)
output (multievent 'midi :keynum
:keynum (+ (* 20 (sin (* (now) mfact))) 60)
:time (now)
:duration dur)
wait dur))
(events
(list
(mtb 1.1 4)
;(mtb 1.3 5)
;(mtb 1.4 7)
)
"mtb.midi" :play 'nil)
(events
(list
(splay (durfunc 20 .125 '(round (+ 50 (* 20 (sin (/ x 6)))))) .125)
(splay (durfunc 20 .25 '(round (+ 53 (* 20 (sin (+ .3 (/ x 6.1))))))) .25))
"out.midi" :play 'nil)
(sqrt 1.1)
(events
(list
(splay (durfunc 30 1/3 '(round (+ 30 (* 8 (sqrt x))))) 1/3)
(splay (durfunc 30 1/2 '(round (+ 30 (* 8 (sqrt (* 1.1 x)))))) 1/2)
(splay (durfunc 30 1/6 '(round (+ 30 (* 8 (sqrt (* 1.16 x)))))) 1/6)
)
"out.midi" :play 'nil)
(events
(list
(splay
(durfunc 20 '(.5 .75) '(round (+ 50 (* 20 (sin x))))) (makecyc '(.5 .75)))
(splay
(durfunc 20 1/3 '(round (+ 50 (* 17 (sin x))))) 1/3)
)
"out.midi" :play 'nil)
(exp 4.0)
(timefunc (indices 10 30) '(sin x))
(durfunc 4 .5 '(* 20 (sin x)))
;; plotter
(defparameter myplot
(plotter :zoom .5
(loop for x from 0 to 1 by .2
for y = (random 1.0)
collect x collect y)))
(next
(new range :from 10 :pickto 30)
50)
(scale-order '(8 2 11 5 11) :down)
;; spears stuff
(load "spears/partials8hz-as.lisp")
(defparameter pars8slots
(spear->slots partials8hz-as))
(defparameter pars8mels
(spearmels partials8hz-as))
(defparameter qpatt (new random of '(1/6 1/4 1/3)))
;;; !!!
(events
(loop for mel in pars8mels collect
(let ((qd (quantdurs (first mel)
(sum-across '(1/5) (second mel))
(next qpatt))))
(splay (first qd) (second qd))))
"out.midi" :play 'nil)
(events
(playspears partials8hz-as .125)
"out.midi" :play 'nil)
(spear->slots partials8hz-as)
(load "spears/cowboys40hz-as.lisp")
(spear->slots cowboys40hz-as)
(loop for x in
(events (playspears cowboys40hz-as .25) "out.midi" :play 'nil)
(spear->slots cowboys40hz-as)
(events
(let ((qd
(quantdurs
(randvec 200 40 44)
(loop repeat 100 collect
(ran :type :uniform :below .5))
'(1/4 1/3))))
(splay (first qd) (second qd)))
"out.midi" :play 'nil)
;;;;
;; drums: channel 9
; 35 /usr/share/timidity/instruments/kick1
; 36 /usr/share/timidity/instruments/kick2
; 37 /usr/share/timidity/instruments/stickrim strip=tail
; 38 /usr/share/timidity/instruments/snare1
; 39 /usr/share/timidity/instruments/claps
; 40 /usr/share/timidity/instruments/snare2 note=38
; 41 /usr/share/timidity/instruments/tomlo2
; 42 /usr/share/timidity/instruments/hihatcl
; 43 /usr/share/timidity/instruments/tomlo1
; 44 /usr/share/timidity/instruments/hihatpd
; 45 /usr/share/timidity/instruments/tommid2
; 46 /usr/share/timidity/instruments/hihatop
; 47 /usr/share/timidity/instruments/tommid1
; 48 /usr/share/timidity/instruments/tomhi2
; 49 /usr/share/timidity/instruments/cymcrsh1
; 50 /usr/share/timidity/instruments/tomhi1
; 51 /usr/share/timidity/instruments/cymride1
; 52 /usr/share/timidity/instruments/cymchina
; 53 /usr/share/timidity/instruments/cymbell
;; !!
(events
(let ((bdurs (ferney '(1) '(2 3))))
(list
(ryte 47 (extractdurs '((.5) 1.5) bdurs))
(ryte '(51 51 51 53)
(resultant bdurs
(list (ferney '(2) '(2 3)) 1)))
(ryte (listsub '(35 R 38) '(1 2 3) (strums 4 2 3 2 5))
(erasedurs '(1) bdurs))
))
"out.midi" :play 'nil)
(avoidurs (ferney '(1) '(4)) (ferney '(1) '(2)))
(events
(ryte 47
(resultant (ferney '(1) '(2 3 3))
(ferney '(1/2) '(3 2))))
"out.midi" :play 'nil)
(events
(splay
(make-poly
(play-mode (randvec 100 40 20) stravmode)
(resclassvec 4 5 7))
.125)
"out.midi" :play 'nil)
(make-poly (indices 40) '(2 1 0 3))
;;;; durs->texture
(events
(let* ((bdurs (ferney '(1) '(2 3)))
(res
(resultant
bdurs
(extractdurs '((.5) 1.5) bdurs)
(resultant bdurs
(list (ferney '(2) '(2 3)) 1))
(erasedurs '(1) bdurs))))
(splay (make-poly (heapvec 200 50 30) (randvec 10 3 1))
res))
"out.midi" :play 'nil)
;; some problems here
(defun durs->texture (&rest durlist)
(let* ((res (resultant durlist))
(resatx (melint->line 0 res)))
resatx))
;;; self-stretto
(events
(splay
(transp
(self-stretto (randrests (heapvec 20 10) 26) 5 5 2)
50)
.25)
"out.midi" :play 'nil)
;; more selfsim
(events
(selfsim cyclops2p5x9 '(0 2 3) '(2 5 9) '(68 60 76) .25)
"out.midi" :play 'nil)
(take-poly
(selfsimvec cyclops2p5x9 '(0 2 3) '(2 5 9) '(68 60 76)))
;;
(defun rp-related (seta setb)
(
(intersection '(1 (2 3) 4) '(0 1 (2 3)))
;; scanons
(scanons 4 7 3)
(events
(splay
(stack-can (transp '(0 3 6 5) 50) 7 3)
1.25) "out.midi" :play 'nil)
(events
(splay
(loop for scan in
'((0 4 7 11) (0 3 6 10) (0 3 7 10) (0 4 7 10)
(0 3 6 9) (0 3 7 5) (0 4 7 6)
(0 -1 2 6) (0 3 6 5) (0 4 2 6) (0 -2 2 5)
(0 -1 2 5) (0 3 2 5) (0 -2 2 0)
(0 -1 2 1))
append (stack-can (transp '(0 3 6 5) (+ 50 (random 12))) 7 3))
.75) "out.midi" :play 'nil)
(events
(splay
(make-poly
(flatten
(norests
(remove-rpts
(transp
(expand
(make-poly (randvec 12 12) '(2 3 4 3)) 'flat)
30))))
'(1 1 2))
.125) "out.midi" :play 'nil)
(tievec '(1 2 2 4))
collect (transp 30 x))
(scanons 4 7 3)
(transp-to 1 '(4 5 6))
(loop for
(only-primes scanons-4-7-3)
;; rsm stuff
(defparameter myq (rsm.queue::list->queue (indices 5)))
(defparameter myq2 (rsm.queue::list->queue (heapvec 4 4 10)))
(rsm.queue::get-last myq2)
(defparameter nuq (rsm.queue::append-queue myq myq2))
nuq
myq
(rsm.queue::empty-p myq)
(rsm.queue::empty-p myq)
(rsm.queue::enqueue 10 myq)
(rsm.queue::dequeue myq)
(rsm.queue::queue->list myq)
myq
;;; PACKAGE FUN
;; CL-VARIATES
; (binomial n p) = # heads when coin flipped n times with probability p
(loop repeat 20 collect
(cl-variates::binomial 100 .2))
; (geometric p) = # flips until it comes up heads
(loop repeat 40 collect (cl-variates::geometric .5))
;; BPM
;; pattern matching -- all sublists starting with 1 are preserved; the rest manipulated
(loop for x in
(make-poly (heapvec 200 2 1) (randvec 19 3 2))
collect
(bpm::match x
((1 . _t) -> x)
(_w -> (heapvec 3 20))))
;; CL-STATISTICS
;; median value
(let ((myseq (randvec 50 50)))
(list myseq
(statistics::median myseq)))
(let ((myseq (randvec 50 20)))
(list myseq
(float (statistics::variance myseq))))
;; click trax
(events
(list
(splay (copylist (list 24) 120) 1.0)
(splay (copylist (list 25) 2400) .5)
(splay (copylist (list 26) 480) .25)
(splay (copylist (list 27) 960) .125)
(splay (copylist (list 28) 360) 1/3)
(splay (copylist (list 29) 720) 1/6)
(splay (copylist (list 30) 1440) 1/12)
(splay (copylist (list 32) 1200) 1/10)
(splay (copylist (list 34) 1400) 1/14))
"out.mid" :play 'nil)
;; fixing scores etc.
(events
(let ((invec
(numidi-in "sqtfix/m1sfva.mid")))
(tplay
(list (first invec)
(transp (second invec) 2.0 #'*)
(transp (third invec) 2.0 #'*))))
"sqtfix/m1sfvaz.mid" :play 'nil)
(length
(tightrows (heapvec 12) 'grand 7)
(grandrows (heapvec 12))
;;; spacegrp w/ register?
; (defun spacegrp->motive (a-mxlist pitlist durlist &optional (mxtype 'list))
(load "spacegrp.lisp")
(events
(splay
(spaceregchain
(chooser (heapvec 10 6) mqmat)
'(4 r 5 r 4))
.25)
"out.mid" :play 'nil)
(placereg (indices 12) '(3 4 r (3 4)))
(spacereg mz8 '(r (3 4) 3 r 5))
(let* ((myrow (heapvec 12))
(inv (reverse myrow))
(pos1 (indices 6))
(pos2
(list-complement (indices 12) pos1)))
(mapcar #'safesort
(list
(nths pos1 inv)
(nths pos2 inv)
(nths pos1 myrow)
(nths pos2 myrow))))
(let* ((pos1 '(0 4 5 6 9 11))
(pos2 (list-complement (indices 12) pos1))
(row1 (heapvec 12))
(row2 (invert-order row1 7)))
(list row1 row2
(mapcar #'safesort
(list
(nths pos1 row1)
(nths pos2 row1)
(nths pos1 row2)
(nths pos2 row2)))))
(invert-order (indices 12 32) 7)
; FROM BOB COYNE
(in-package :cl-user)
(defparameter *question-file* "/tmp/numlist")
#|
;; example contents of question file:
questionTemplate: FIND STATEMENTS BY (Evan Bayh) on (American elections)
questionParaphrase: What did Evan Bayh say about American elections?
location: null
time: null
maximumAnswerLength: 598
documentId: ENG_STEXT-2
questionId: 1058
templateId: 29
topic argument: American elections
|#
(defun read-ascii-list (&optional (file *question-file*)))
;; example of reading an ascii file
(defun read-question (&optional (file *question-file*))
(with-open-file (instream file :direction :input)
(let (input vals)
(loop for i = (read-line instream nil :done)
do
(cond ((eq i :done)
(return nil))
(t
(push i input))))
;; Note: input file must have key/value pairs in this order. TODO: fix that.
(loop for i in '("questionTemplate:" "questionParaphrase:" "location:" "time:"
"maximumAnswerLength:" "documentId:" "questionId:" "templateId:"
"topic argument:")
for field-id in '(:question-template :question-paraphrase :location
:time :max-answer-length
:document-id :question-id :template-id :topic-argument)
for string in (reverse input)
for pos = (when field-id (search i string))
do (progn
(when (and field-id (eq pos 0))
(push (list field-id (subseq string (1+ (length i)) (length string)))
vals))))
vals)))
(read-question)
;; example of writing an ascii file
(defun write-question (&optional (file *question-file*))
(with-open-file (stream file :direction :output
:if-exists :supersede
:if-does-not-exist :create)
(loop for i in '("questionTemplate:" "questionParaphrase:" "location:" "time:"
"maximumAnswerLength:" "documentId:" "questionId:" "templateId:"
"topic argument:")
for value = (random 100)
do
(format stream "~a ~a~%" i value))))
;; example of executing a command line program
;; e.g. (test-ls "/tmp/" "/tmp/foo")
(defun test-ls (dir output-file)
(ext:run-program "/bin/ls" (list "-l" dir)
:if-output-exists :supersede
:output output-file))
;
(use-system :metatilities-base)
(use-system :cl-containers)
(use-system :cl-graph)
(in-package :cm)
(cl-graph:get-transitive-closure (indices 10))
(defparameter myvar 5)
(alexandria:if-let (oddp myvar) (* 4 myvar) (* -1 myvar))
(alexandria:whichever 5 10 22)
(alexandria:appendf (indices 10) (indices 3 20))
(alexandria:map-product #'+ '(0 4 5) '(3 6 7) '(8 10 11) '(2 1 9))
;; alexandria:clamp
(mapcar (lambda (x) (alexandria:clamp x 50 88))
(heapvec 100 100))
(use-system :series)
(series:scan '(a )
;; PERLE FUNCTIONS
(defparameter up1s (indices 12))
(defparameter down1s (rotate-list (reverse (indices 12)) 11))
(defparameter up7s (mod12 (transp up1s 7 #'*)))
(defparameter down7s (mod12 (transp down1s 7 #'*)))
(defparameter perlerow '(0 7 5 2 10 9 3 4 8 11 1 6))
(defun row-neighbors (arow)
(let ((arow (heapvec 12)))
(mapcar (lambda (x)
(mapcar (lambda (y) (nth y arow)) ))
(append (list 1)
(transpose-matx
(list
(indices 10)
(indices 10 2)))
(list 10))))
(interlock
(rotate-list up1s 4)
(rotate-list down7s 3)
1 1)
;;; more selfsim work
(autosim-primitive 3 8)
; AUTOSIM-TEST -- takes melody; returns ratio(s)
; -> construct 'autosim' vectors & see if they are autosim
(all-partitions 7)
(all-partitions 7 'notriv)
(list-partitions (heapvec 6))
(list-partitions (heapvec 6) 'notriv)
;; carter-ish
(events
(let* ((bh (pickl besthex))
(stax
(mapcar (lambda (x) (car (stack-by bh x)))
(indices 6 6))))
(splay
(transp
(flatten
(mapcar (lambda (x) (chooser (heapvec 30 6) x)) (shuffle stax)))
45)
1/6))
"out.mid" :play 'nil)
(events
(let* ((sseq (subsequences (randhexrow) 6))
(stax
(mapcar (lambda (x) (car (stack-by x 5))) sseq)))
(splay
(transp
(flatten
(mapcar (lambda (x) (chooser (heapvec 30 6) x)) (shuffle stax)))
45)
1/6))
"out.mid" :play 'nil)
;; nice serial!
(events
(let* ((inrow (flatten (map 'list #'placereg (make-poly (randhexrow) 4) '(4 5 6))))
(staxint
(shuffle (shuffle-all
(loop for x in (indices 6 1) collect (extract-intervals inrow x))))))
(splay
(make-poly
(flatten
(smoothlist
(shuffle-all
(flatter (mapcar (lambda (x) (chooser (heapvec 20 (length x)) x)) staxint)))))
(poissonvec .2 300 1))
(transp (poissonvec .2 300 1) 1/6 #'*)))
"out.mid" :play 'nil)
;; deploying rows in mode-fields
(events
(splay
(append
(place-by-mod12 (flatten (tightrows (randhexrow)))
(range-in-mode 48 84 stravmode))
(place-by-mod12 (flatten (tightrows (randhexrow)))
(range-in-mode 48 84 (transp-mode stravmode 1))))
.125)
"out.mid" :play 'nil)
(events
(play-sd
(make-ties
(flatten
(map 'list
(lambda (mel mods) (place-by-mod12 mel (range-in-mode 48 84 (transp-mode stravmode mods))))
(make-poly
(next (makecyc (richain (randhexrow))) 480)
40)
(m5 (indices 12)))))
.125)
"out.mid" :play 'nil)
(events
(splay
(loop repeat 10 append
(let ((rng (range-in-mode 48 84 (make-ttmode 3))))
(chooser (heapvec 40 (length rng)) rng)))
.125 #'*)
"out.mid" :play 'nil)
(defparameter arows
(rows-by-seglen (allrows (randhexrow))))
(chop-list (next (makecyc (flatten arows)) 200) 3)
(events
(splay
(loop for rngrot in
(mapcar #'flatten
(mapcar (lambda (x) (placereg x '(4 5 6)))
(allrots (make-poly (randhexrow) 4))))
append
(place-by-mod12 (heapvec 120) rngrot))
.125 #'*)
"out.mid" :play 'nil)
(chop-list (indices 22) 4)
(filter (lambda (x) (and (= (sum x) 12) (= 1 (apply #'gcd x))))
(subsets-len (indices 11 1) 3))
(apply #'gcd '(4 8 10))
(subsets-len (repeater (indices 6 1) 3) 3)
;; SETS-LEN -- all subsets including repeats
(sets-len
(defparameter c5-branch
(generic-branch #'tonnetz-func
(mod12 (expand (list (m7 (indices 12)) '(0 4 7))))))
(defparameter smoothpits (shuffle-all (smoothlist
(transp (mapcar #'stack-up (shuffle-all (flatter c5-branch))) 60))))
;; lullaby
(events
(let* ((fpits (flatten smoothpits))
(opits (ornadurs smoothpits .5)))
(splay fpits opits))
"out.mid" :play 'nil)
;;
(defparameter dkrow1 '(5 0 9 7 11 10 3 6 8 1 4 2))
(events
(let ((pits
(gather-pits #'consn-p
(placereg
(norpt
(flatten
(norpt
v (shuffle-all
(flatter
(mapcar (lambda (x) (transpose-matx (list x (hex-combi-partner x))))
(repeater (rows-by-seglen (tightrows dkrow1)) 2))))
#'list-eql)))
(randvec 31 3 4)))))
(splay pits (transp (take-poly pits) 1/6 #'*)))
"out.mid" :play 'nil)
(flatten (mapcar #'reverse (make-poly dkrow1 2)))
;; Andrew Mead in PNM 26:2
(defun row-transp (arow idx)
(mod12 (transp arow idx)))
(defun row-invp (arow idx)
(mod12
(mapcar (lambda (x) (- idx x)) arow)))
(defun rowpits->order
(mapcar (lambda (x) (position x arow)) (indices 12)))
(defun roworder->pits
(defun row-transo
(defun row-invo
; pforms
; dsym
; COMPLEMENTUNION
(defun complementunion (setx sety)
(let* ((setx '(0 1 6))
(sety '(0 4 8)))
(mapcar #'flatten
(filter (lambda (x) (not (intersection (first x) (second x))))
(match2lists (pforms setx) (pforms sety)))))
(not (intersection '(1 2 3) '(4 2 6)))
(events
(splay
(heapvec 100 24 60)
(transp (transp (poissonvec .2 100) 1) 1/6 #'*))
"out.mid" :play 'nil)
(events
(let ((pits
(flatten (transp (self-expand (heapvec 5 12) 3) 60))))
(splay pits
(leapdur pits 1/6)))
"out.mid" :play 'nil)
(transp
(flatter
(generic-branch #'tonnetz-func (shuffle (alltransp '(0 2 5)0 ))))
60)
(events
(splay
(loop for n from 1 to 5 by .3 collect
(round-all (expwarp '(60 64 67) n)))
.5)
"out.mid" :play 'nil)
(events
(let ((hexrow '(1 3 6 8 10))
(regcyc (makecyc '(6 3))))
(splay
(loop for n in (m5 (indices 12)) append
(consmatch
(menses (placereg
(transp (chooser (heapvec 7 5) hexrow) n)
(next regcyc)) 7)
(play-mode (heapvec 30 12 30) (transp-mode ionian n))))
0.125))
"out.mid" :play 'nil)
(events
(let ((pits
(make-poly
(placereg
(loop for n in
(m7 (indices 12))
append
(play-mode (heapvec 50 12 30) (transp-mode ionian n)))
middleweight-5)
(resclassvec 1 4 7))))
(splay pits (transp (take-poly pits) .2 #'*)))
"out.mid" :play 'nil)
(load "tiles.lisp")
(defparameter m5chds
(mod12
(loop for n in (m5 (indices 12)) collect
(transp '(0 3 5 7) n))))
(defparameter rgrthing
(generic-branch #'rgr-alldim1 m5chds))
(events
(mapcar
(lambda (x) (play-sd (make-ties x) 0.25))
(chds->lines
(mapcar (lambda (x) (placereg x (indices 4 3)))
(closest-mod-list (mod12 (flatter rgrthing))))))
"out.mid" :play 'nil)
(defparameter blah (heapvec 12))
(heapvec 12)
(defparameter thisrgr
(generic-branch #'rgr-alldim1 (make-poly (heapvec 12) 3)))
(play-mode
(events (selfsim cyclops2p4x7 (shuffle (transp '(60 62 65) 12)) '(4 9 11 15) '(0 -7 -14 -21) .25)
"out.mid" :play 'nil)
(events (selfsim cyclops3x8 (shuffle '(60 62 63 65 67)) '(3 9 11) '(0 -7 -14) .25)
"out.mid" :play 'nil)
(events (selfsim cyclops4p7x9 (shuffle '(60 62 63 65 67)) '(4 10 13) '(0 -7 -14) .25)
"out.mid" :play 'nil)
(events (selfsim cyclops6x7 (shuffle (transp '(60 62 64 65) 12)) '(6 8 13 15) '(0 -7 -14 -21) .25)
"out.mid" :play 'nil)
(events
(let ((fto
(fromto-stepper (copything 4 7) (heapvec 7 7 1))))
(splay (heapvec 300 36 50)
(transp (flatten (append fto (reverse fto))) .125 #'*)))
"out.mid" :play 'nil)
(events
(let ((pits
(make-poly
(placereg
(norpt
(flatten
(shuffle (allrows (randhexrow)))))
(heapvec 77 4 3))
(transp (rwgen pleasantsrules '(1) 3) 1))))
(splay pits (ferney '(1)
(transp (rwgen mtrules '(1) 5) 3)
(take-poly pits))))
"out.mid" :play 'nil)
(events
(let ((pits
(play-mode
(transp
(flatten (self-expand (randvec 7 5) 5))
30)
stravmode)))
(splay pits (transp (leapdur pits) .125 #'*)))
"out.mid" :play 'nil)
(events
(let ((m6 (make-poly (randhexrow) 6)))
(splay
(make-poly
(placereg
(flatten (fromto-stepper (first m6) (second m6)))
middleweight-5)
(resclassvec 3 5 7))
(transp (chooser (heapvec 204 20) (ranvec-gaussian 20)) 0.25 #'*)))
"out.mid" :play 'nil)
(shade-into 30 10 20)
;; CARTER etc
(defparameter drow (randhexrow))
(defparameter chex3 '(5 6 8 9 10 1))
chex3
;; 99 all-int rows: interval list!
;(defparameter carter1-ints '(2 7 4 3 1 6 11 9 8 5 10))
(events
(splay
(loop for n in (shuffle (indices 5 1)) append
(shuffle (extract-intervals (transp (stack-up row-34) 24) n)))
(ferney '(7) (randvec 50 3 3)))
"out.mid" :play 'nil)
(events
(splay
(chooser (mod12 (drunkvec 5 100))
(transp (stack-up row-34) 24))
0.125)
"out.mid" :play 'nil)
| 52,080 | Common Lisp | .lisp | 1,632 | 26.112132 | 98 | 0.580778 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 0ebbe1ea93d7e2b204b78ecf903e4ea59d28b0f20c7d4ebcf9462d64895c4506 | 15,872 | [
-1
] |
15,873 | diffs.lisp | gogins_csound-extended-nudruz/sources/diffs.lisp | (in-package :cm)
;; DIFFS.LISP -- difference equations
;; ..use it like this..
; (define-diff diff2
; (0 1 1)
; ((lambda (x) (* x x))
; (lambda (x) (mod x 3))
; (lambda (x) (* -1 x)))
; (lambda (x) (mod x 12)))
; (diff-vals 'diff2 0 5)
; first some expansion utilities
;; MAKE-DIFF-INITS -- sets all inits for a diff equation
(defun make-diff-inits (varname initlist)
(loop for r to (- (length initlist) 1) collect
`((= ,varname ,r) ,(nth r initlist))))
;; MAKE-DIFF-FUNC -- sets the 'else' clause for a diff equation
;; vname = variable name
;; fname = function name
;; funclist = lambda functions for n, n-1, n-2 etc.
;; resultfunc = global lambda, applied after sum is computed
(defun make-diff-func (vname fname funclist
&optional (resultfunc '(lambda (x) x)))
(let ((funcsum (append (list '+)
(list (list (first funclist) vname))
(loop for y from 1 to (- (length funclist) 1) collect
(list (nth y funclist) `(,fname (- ,vname ,y)))))))
`(t (,resultfunc ,funcsum))))
;; MAKE-DIFF -- combining inits & functions into a diff equation
(defun make-diff (vname fname inits funclist
&optional (resultfunc '(lambda (x) x)))
(append (list 'cond) (make-diff-inits vname inits)
(list (make-diff-func vname fname funclist resultfunc))))
;; DEFINE-DIFF -- main function
;; kudos (again) to Bob Coyne!
(defmacro define-diff (fname inits funclist
&optional (resultfunc '(lambda (x) x)))
(let ((vname 'n))
`(defun ,fname (,vname)
,(make-diff vname fname inits funclist resultfunc))))
;; DIFF-VALS -- returns diffs from start to end
(defun diff-vals (diffunc start end)
(loop for i from start to end collect (funcall diffunc i)))
| 1,805 | Common Lisp | .lisp | 42 | 37.928571 | 72 | 0.625571 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 7e357a53f0802988cbb261645a3dca40bf10fc04659f0124d9fcfffc55fe8aa0 | 15,873 | [
-1
] |
15,874 | oddities.lisp | gogins_csound-extended-nudruz/sources/oddities.lisp | (in-package :cm)
(load (asdf:system-relative-pathname 'nudruz "data/partition-table.lisp"))
;; ODDITIES - all listed asymmetrical rhythms (including rotations) -- all unique
;; nbr atx: (3 4 5 7 9 11)
;; durations: (8 11 12 16 18 20 22 24)
(defparameter oddities
'((2 3 3) (3 3 2) (3 2 3) (2 3 2 3 2) (3 2 3 2 2) (2 3 2 2 3) (3 2 2 3 2)
(2 2 3 2 3) (2 3 2 2 3 2 2) (3 2 2 3 2 2 2) (2 2 3 2 2 2 3) (2 3 2 2 2 3 2)
(3 2 2 2 3 2 2) (2 2 2 3 2 2 3) (2 2 3 2 2 3 2) (2 3 2 2 2 3 2 2 2)
(3 2 2 2 3 2 2 2 2) (2 2 2 3 2 2 2 2 3) (2 2 3 2 2 2 2 3 2)
(2 3 2 2 2 2 3 2 2) (3 2 2 2 2 3 2 2 2) (2 2 2 2 3 2 2 2 3)
(2 2 2 3 2 2 2 3 2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 3 2)
(2 2 3 2 3 2 3 2 3) (2 3 3 3 3 3 3) (3 3 3 3 3 3 2) (3 3 3 3 3 2 3)
(3 3 3 3 2 3 3) (3 3 3 2 3 3 3) (3 3 2 3 3 3 3) (3 2 3 3 3 3 3)
(2 3 3 3 2 3 3 3 2) (3 3 3 2 3 3 3 2 2) (3 3 2 3 3 3 2 2 3)
(3 2 3 3 3 2 2 3 3) (2 3 3 3 2 2 3 3 3) (3 3 3 2 2 3 3 3 2)
(3 3 2 2 3 3 3 2 3) (3 2 2 3 3 3 2 3 3) (2 2 3 3 3 2 3 3 3)
(2 3 3 3 2 3 3 2 3) (3 3 3 2 3 3 2 3 2) (3 3 2 3 3 2 3 2 3)
(3 2 3 3 2 3 2 3 3) (2 3 3 2 3 2 3 3 3) (3 3 2 3 2 3 3 3 2)
(3 2 3 2 3 3 3 2 3) (2 3 2 3 3 3 2 3 3) (3 2 3 3 3 2 3 3 2)
(2 3 3 3 2 3 2 3 3) (3 3 3 2 3 2 3 3 2) (3 3 2 3 2 3 3 2 3)
(3 2 3 2 3 3 2 3 3) (2 3 2 3 3 2 3 3 3) (3 2 3 3 2 3 3 3 2)
(2 3 3 2 3 3 3 2 3) (3 3 2 3 3 3 2 3 2) (3 2 3 3 3 2 3 2 3)))
;; ASYM-RHYTS.LISP -- asymmetrical rhythms [after Chemillier, Truchet, et. al.]
;; those with 'rhythmic oddity' property
;; ODDITY-IDX -- takes durs; returns number of atx that split totalen evenly
(defun oddity-idx (alist)
(let ((totalen (apply #'+ alist)))
(if (oddp totalen) 0
(let* ((div2 (/ totalen 2))
(atkpts (melint->line 0 alist))
(pairs (subsets-len atkpts 2)))
(-
(count div2
(mapcar (lambda (x) (mod (apply #'- x) totalen)) pairs))
(if (member div2 atkpts) 1 0))))))
;; functions selecting 'oddities'
;; ODDITIES-LEN -- all oddities of total durlen 'len'
(defun oddities-len (len)
(no-nils
(mapcar
(lambda (x) (if (eql (apply #'+ x) len) x))
oddities)))
;; ODDITIES-ATX -- all oddities with same # atx
(defun oddities-atx (atx)
(no-nils
(mapcar
(lambda (x) (if (eql (length x) atx) x))
oddities)))
| 3,447 | Common Lisp | .lisp | 65 | 47.815385 | 81 | 0.494212 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | 5ac7393fe55e97ba31186b32861dbd4359d0a95346e0c7b739d1bb3b7dde878e | 15,874 | [
-1
] |
15,875 | mathieugrp.lisp | gogins_csound-extended-nudruz/sources/mathieugrp.lisp | (in-package :cm)
;; mathieu etc.
;(load "nudruz.lisp")
;(load "beats.lisp")
;(load "inflect.lisp")
;(load "designs.lisp")
;(load "modes.lisp")
;(load "diffs.lisp")
;(load "rewrite.lisp")
;(load "graphs.lisp")
;(load "phrasing.lisp")
;(load "tonnetz.lisp")
;(load "selfsim.lisp")
;(load "reger.lisp")
;(load "scanons.lisp")
;(load "nondet.lisp")
;(load "motive.lisp")
;(load "lewin.lisp")
;(load "slonimsky.lisp")
;(load "mathieu11alt.lisp")
;; moving 'w11alt' to 0..11 domain
(defparameter w11alt0 (mapcar (lambda (x) (transp x -1)) w11alt))
; & shuffled
(defparameter shfw (shuffle w11alt0))
;; shorter 'm11alt' for prototyping
(defparameter shortm11 (subseq m11alt 0 20))
;; NOTE: "chds->lines" will give smoothness, instead of 'smoothlist'
;; smoothlist with ttmode
; MKG: Disabling example.
#|
(events
(splay
(play-mode
(transp
(smoothlist
(loop for x in shortm11 append
(mapcar (lambda (y) (listsub x (indices 12) y)) shfw)))
11)
(make-ttmode 4)
)
.125)
"out.midi" :play 'nil)
|# | 1,027 | Common Lisp | .lisp | 43 | 21.906977 | 68 | 0.684103 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | eb8183cd5d49f726c15af65a56d3842ae8cab762fbebb9e6f6f7a93c5610b012 | 15,875 | [
-1
] |
15,876 | all-in-one-orc.lisp | gogins_csound-extended-nudruz/sources/all-in-one-orc.lisp | ;; An example Csound orchestra for Common Lisp to be used with the
;; csound.lisp or sb-csound.lisp foreign function interfaces for Csound.
(in-package :cm)
(defparameter all-in-one-orc #>qqq>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 32768
iampdbfs init 32768
prints "Default amplitude at 0 dBFS: %9.4f\n", iampdbfs
idbafs init dbamp(iampdbfs)
prints "dbA at 0 dBFS: %9.4f\n", idbafs
iheadroom init 6
prints "Headroom (dB): %9.4f\n", iheadroom
idbaheadroom init idbafs - iheadroom
prints "dbA at headroom: %9.4f\n", idbaheadroom
iampheadroom init ampdb(idbaheadroom)
prints "Amplitude at headroom: %9.4f\n", iampheadroom
prints "Balance so the overall amps at the end of performance is -6 dbfs.\n"
giFlatQ init sqrt(0.5)
giseed init 0.5
gkHarpsichordGain chnexport "gkHarpsichordGain", 1
gkHarpsichordGain init 1
gkHarpsichordPan chnexport "gkHarpsichordPan", 1
gkHarpsichordPan init 0.5
gkChebyshevDroneCoefficient1 chnexport "gkChebyshevDroneCoefficient1", 1
gkChebyshevDroneCoefficient1 init 0.5
gkChebyshevDroneCoefficient2 chnexport "gkChebyshevDroneCoefficient2", 1
gkChebyshevDroneCoefficient3 chnexport "gkChebyshevDroneCoefficient3", 1
gkChebyshevDroneCoefficient4 chnexport "gkChebyshevDroneCoefficient4", 1
gkChebyshevDroneCoefficient5 chnexport "gkChebyshevDroneCoefficient5", 1
gkChebyshevDroneCoefficient6 chnexport "gkChebyshevDroneCoefficient6", 1
gkChebyshevDroneCoefficient7 chnexport "gkChebyshevDroneCoefficient7", 1
gkChebyshevDroneCoefficient8 chnexport "gkChebyshevDroneCoefficient8", 1
gkChebyshevDroneCoefficient9 chnexport "gkChebyshevDroneCoefficient9", 1
gkChebyshevDroneCoefficient10 chnexport "gkChebyshevDroneCoefficient10", 1
gkChebyshevDroneCoefficient10 init 0.05
gkReverberationEnabled chnexport "gkReverberationEnabled", 1
gkReverberationEnabled init 1
gkReverberationDelay chnexport "gkReverberationDelay", 1
gkReverberationDelay init 0.325
gkReverberationWet chnexport "gkReverberationWet", 1
gkReverberationWet init 0.15
gkCompressorEnabled chnexport "gkCompressorEnabled", 1
gkCompressorEnabled init 0
gkCompressorThreshold chnexport "gkCompressorThreshold", 1
gkCompressorLowKnee chnexport "gkCompressorLowKnee", 1
gkCompressorHighKnee chnexport "gkCompressorHighknee", 1
gkCompressorRatio chnexport "gkCompressorRatio", 1
gkCompressorAttack chnexport "gkCompressorAttack", 1
gkCompressorRelease chnexport "gkCompressorRelease", 1
gkMasterLevel chnexport "gkMasterLevel", 1
gkMasterLevel init 1.5
connect "BanchoffKleinBottle", "outleft", "Reverberation", "inleft"
connect "BanchoffKleinBottle", "outright", "Reverberation", "inright"
connect "BandedWG", "outleft", "Reverberation", "inleft"
connect "BandedWG", "outright", "Reverberation", "inright"
connect "BassModel", "outleft", "Reverberation", "inleft"
connect "BassModel", "outright", "Reverberation", "inright"
connect "ChebyshevDrone", "outleft", "Reverberation", "inleft"
connect "ChebyshevDrone", "outright", "Reverberation", "inright"
connect "ChebyshevMelody", "outleft", "Reverberation", "inleft"
connect "ChebyshevMelody", "outright", "Reverberation", "inright"
connect "Compressor", "outleft", "MasterOutput", "inleft"
connect "Compressor", "outright", "MasterOutput", "inright"
connect "DelayedPluckedString", "outleft", "Reverberation", "inleft"
connect "DelayedPluckedString", "outright", "Reverberation", "inright"
connect "EnhancedFMBell", "outleft", "Reverberation", "inleft"
connect "EnhancedFMBell", "outright", "Reverberation", "inright"
connect "FenderRhodesModel", "outleft", "Reverberation", "inleft"
connect "FenderRhodesModel", "outright", "Reverberation", "inright"
connect "FilteredSines", "outleft", "Reverberation", "inleft"
connect "FilteredSines", "outright", "Reverberation", "inright"
connect "Flute", "outleft", "Reverberation", "inleft"
connect "Flute", "outright", "Reverberation", "inright"
connect "FMModulatedChorusing", "outleft", "Reverberation", "inleft"
connect "FMModulatedChorusing", "outright", "Reverberation", "inright"
connect "FMModerateIndex", "outleft", "Reverberation", "inleft"
connect "FMModerateIndex", "outright", "Reverberation", "inright"
connect "FMModerateIndex2", "outleft", "Reverberation", "inleft"
connect "FMModerateIndex2", "outright", "Reverberation", "inright"
connect "FMWaterBell", "outleft", "Reverberation", "inleft"
connect "FMWaterBell", "outright", "Reverberation", "inright"
connect "Granular", "outleft", "Reverberation", "inleft"
connect "Granular", "outright", "Reverberation", "inright"
connect "Guitar", "outleft", "Reverberation", "inleft"
connect "Guitar", "outright", "Reverberation", "inright"
connect "Guitar2", "outleft", "Reverberation", "inleft"
connect "Guitar2", "outright", "Reverberation", "inright"
connect "Harpsichord", "outleft", "Reverberation", "inleft"
connect "Harpsichord", "outright", "Reverberation", "inright"
connect "HeavyMetalModel", "outleft", "Reverberation", "inleft"
connect "HeavyMetalModel", "outright", "Reverberation", "inright"
connect "Hypocycloid", "outleft", "Reverberation", "inleft"
connect "Hypocycloid", "outright", "Reverberation", "inright"
connect "KungModulatedFM", "outleft", "Reverberation", "inleft"
connect "KungModulatedFM", "outright", "Reverberation", "inright"
connect "ModerateFM", "outleft", "Reverberation", "inleft"
connect "ModerateFM", "outright", "Reverberation", "inright"
connect "ModulatedFM", "outleft", "Reverberation", "inleft"
connect "ModulatedFM", "outright", "Reverberation", "inright"
connect "Melody", "outleft", "Reverberation", "inleft"
connect "Melody", "outright", "Reverberation", "inright"
connect "ParametricEq1", "outleft", "ParametricEq2", "inleft"
connect "ParametricEq1", "outright", "ParametricEq2", "inright"
connect "ParametricEq2", "outleft", "MasterOutput", "inleft"
connect "ParametricEq2", "outright", "MasterOutput", "inright"
connect "PianoOut", "outleft", "Reverberation", "inleft"
connect "PianoOut", "outright", "Reverberation", "inright"
connect "PlainPluckedString", "outleft", "Reverberation", "inleft"
connect "PlainPluckedString", "outright", "Reverberation", "inright"
connect "PRCBeeThree", "outleft", "Reverberation", "inleft"
connect "PRCBeeThree", "outright", "Reverberation", "inright"
connect "PRCBeeThreeDelayed", "outleft", "Reverberation", "inleft"
connect "PRCBeeThreeDelayed", "outright", "Reverberation", "inright"
connect "PRCBowed", "outleft", "Reverberation", "inleft"
connect "PRCBowed", "outright", "Reverberation", "inright"
connect "Reverberation", "outleft", "Compressor", "inleft"
connect "Reverberation", "outright", "Compressor", "inright"
connect "STKBandedWG", "outleft", "Reverberation", "inleft"
connect "STKBandedWG", "outright", "Reverberation", "inright"
connect "STKBeeThree", "outleft", "Reverberation", "inleft"
connect "STKBeeThree", "outright", "Reverberation", "inright"
connect "STKBlowBotl", "outleft", "Reverberation", "inleft"
connect "STKBlowBotl", "outright", "Reverberation", "inright"
connect "STKBlowHole", "outleft", "Reverberation", "inleft"
connect "STKBlowHole", "outright", "Reverberation", "inright"
connect "STKBowed", "outleft", "Reverberation", "inleft"
connect "STKBowed", "outright", "Reverberation", "inright"
connect "STKClarinet", "outleft", "Reverberation", "inleft"
connect "STKClarinet", "outright", "Reverberation", "inright"
connect "STKDrummer", "outleft", "Reverberation", "inleft"
connect "STKDrummer", "outright", "Reverberation", "inright"
connect "STKFlute", "outleft", "Reverberation", "inleft"
connect "STKFlute", "outright", "Reverberation", "inright"
connect "STKFMVoices", "outleft", "Reverberation", "inleft"
connect "STKFMVoices", "outright", "Reverberation", "inright"
connect "STKHvyMetl", "outleft", "Reverberation", "inleft"
connect "STKHvyMetl", "outright", "Reverberation", "inright"
connect "STKMandolin", "outleft", "Reverberation", "inleft"
connect "STKMandolin", "outright", "Reverberation", "inright"
connect "STKModalBar", "outleft", "Reverberation", "inleft"
connect "STKModalBar", "outright", "Reverberation", "inright"
connect "STKMoog", "outleft", "Reverberation", "inleft"
connect "STKMoog", "outright", "Reverberation", "inright"
connect "STKPercFlut", "outleft", "Reverberation", "inleft"
connect "STKPercFlut", "outright", "Reverberation", "inright"
connect "STKPlucked", "outleft", "Reverberation", "inleft"
connect "STKPlucked", "outright", "Reverberation", "inright"
connect "STKResonate", "outleft", "Reverberation", "inleft"
connect "STKResonate", "outright", "Reverberation", "inright"
connect "STKRhodey", "outleft", "Reverberation", "inleft"
connect "STKRhodey", "outright", "Reverberation", "inright"
connect "STKSaxofony", "outleft", "Reverberation", "inleft"
connect "STKSaxofony", "outright", "Reverberation", "inright"
connect "STKShakers", "outleft", "Reverberation", "inleft"
connect "STKShakers", "outright", "Reverberation", "inright"
connect "STKSimple", "outleft", "Reverberation", "inleft"
connect "STKSimple", "outright", "Reverberation", "inright"
connect "STKSitar", "outleft", "Reverberation", "inleft"
connect "STKSitar", "outright", "Reverberation", "inright"
connect "STKTubeBell", "outleft", "Reverberation", "inleft"
connect "STKTubeBell", "outright", "Reverberation", "inright"
connect "STKVoicForm", "outleft", "Reverberation", "inleft"
connect "STKVoicForm", "outright", "Reverberation", "inright"
connect "STKWhistle", "outleft", "Reverberation", "inleft"
connect "STKWhistle", "outright", "Reverberation", "inright"
connect "STKWurley", "outleft", "Reverberation", "inleft"
connect "STKWurley", "outright", "Reverberation", "inright"
connect "StringPad", "outleft", "Reverberation", "inleft"
connect "StringPad", "outright", "Reverberation", "inright"
connect "ToneWheelOrgan", "outleft", "Reverberation", "inleft"
connect "ToneWheelOrgan", "outright", "Reverberation", "inright"
connect "TubularBellModel", "outleft", "Reverberation", "inleft"
connect "TubularBellModel", "outright", "Reverberation", "inright"
connect "WaveguideGuitar", "outleft", "Reverberation", "inleft"
connect "WaveguideGuitar", "outright", "Reverberation", "inright"
connect "Xing", "outleft", "Reverberation", "inleft"
connect "Xing", "outright", "Reverberation", "inright"
connect "ZakianFlute", "outleft", "Reverberation", "inleft"
connect "ZakianFlute", "outright", "Reverberation", "inright"
alwayson "Reverberation"
alwayson "Compressor"
alwayson "MasterOutput"
instr BanchoffKleinBottle
//////////////////////////////////////////////
// Original by Hans Mikelson.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; p1 p2 p3 p4 p5 p6 p7
; Start Dur Amp Frqc U V
; i 4 32 6 6000 6.00 3 2
; i 4 36 4 . 5.11 5.6 0.4
; i 4 + 4 . 6.05 2 8.5
; i 4 . 2 . 6.02 4 5
; i 4 . 2 . 6.02 5 0.5
iHz = ifrequency
ifqc init iHz
ip4 init iamplitude
iu init 5 ; p6
iv init 0.5 ; p7
irt2 init sqrt(2)
aampenv linseg 0, 0.02, ip4, p3 - 0.04, ip4, 0.02, 0
isine ftgenonce 0, 0, 65536, 10, 1
icosine ftgenonce 0, 0, 65536, 11, 1
; Cosines
acosu oscili 1, iu * ifqc, icosine
acosu2 oscili 1, iu * ifqc / 2, icosine
acosv oscili 1, iv * ifqc, icosine
; Sines
asinu oscili 1, iu * ifqc, isine
asinu2 oscili 1, iu * ifqc / 2, isine
asinv oscili 1, iv * ifqc, isine
; Compute X and Y
ax = acosu * (acosu2 * (irt2 + acosv) + asinu2 * asinv * acosv)
ay = asinu * (acosu2 * (irt2 + acosv) + asinu2 * asinv * acosv)
; Low frequency rotation in spherical coordinates z, phi, theta.
klfsinth oscili 1, 4, isine
klfsinph oscili 1, 1, isine
klfcosth oscili 1, 4, icosine
klfcosph oscili 1, 1, icosine
aox = -ax * klfsinth + ay * klfcosth
aoy = -ax * klfsinth * klfcosph - ay * klfsinth * klfcosph + klfsinph
aoutleft = aampenv * aox
aoutright = aampenv * aoy
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "BanchoffKlein i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr BandedWG
//////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 512
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
asignal STKBandedWG ifrequency,1
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "BandedWG i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr BassModel
//////////////////////////////////////////////
// Original by Hans Mikelson.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) / 35
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; p1 p2 p3 p4 p5 p6
; Start Dur Amp Pitch PluckDur
; i2 128 4 1400 6.00 0.25
; i2 + 2 1200 6.01 0.25
; i2 . 4 1000 6.05 0.5
; i2 . 2 500 6.04 1
; i2 . 4 1000 6.03 0.5
; i2 . 16 1000 6.00 0.5
iHz = ifrequency
ifqc = iHz
ip4 = iamplitude
ip6 = 0.5
ipluck = 1 / ifqc * ip6
kcount init 0
adline init 0
ablock2 init 0
ablock3 init 0
afiltr init 0
afeedbk init 0
koutenv linseg 0, .01, 1, p3 - .11 , 1, .1 , 0 ; Output envelope
kfltenv linseg 0, 1.5, 1, 1.5, 0
; This envelope loads the string with a triangle wave.
kenvstr linseg 0, ipluck / 4, -ip4 / 2, ipluck / 2, ip4 / 2, ipluck / 4, 0, p3 - ipluck, 0
aenvstr = kenvstr
ainput tone aenvstr, 200
; DC Blocker
ablock2 = afeedbk - ablock3 + .99 * ablock2
ablock3 = afeedbk
ablock = ablock2
; Delay line with filtered feedback
adline delay ablock + ainput, 1 / ifqc - 15 / sr
afiltr tone adline, 400
; Resonance of the body
abody1 reson afiltr, 110, 40
abody1 = abody1 / 5000
abody2 reson afiltr, 70, 20
abody2 = abody2 / 50000
afeedbk = afiltr
aout = afeedbk
asignal = 50 * koutenv * (aout + kfltenv * (abody1 + abody2))
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "BassModel i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr ChebyshevDrone
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; By Michael Gogins.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ihertz = cpsmidinn(i_midikey)
iamp = ampdb(i_midivelocity) * 6
idampingattack = .01
idampingrelease = .02
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
iattack init p3 / 4.0
idecay init p3 / 4.0
isustain init p3 / 2.0
aenvelope transeg 0.0, iattack / 2.0, 2.5, iamp / 2.0, iattack / 2.0, -2.5, iamp, isustain, 0.0, iamp, idecay / 2.0, 2.5, iamp / 2.0, idecay / 2.0, -2.5, 0.
isinetable ftgenonce 0, 0, 65536, 10, 1, 0, .02
asignal poscil3 1, ihertz, isinetable
asignal chebyshevpoly asignal, 0, gkChebyshevDroneCoefficient1, gkChebyshevDroneCoefficient2, gkChebyshevDroneCoefficient3, gkChebyshevDroneCoefficient4, gkChebyshevDroneCoefficient5, gkChebyshevDroneCoefficient6, gkChebyshevDroneCoefficient7, gkChebyshevDroneCoefficient8, gkChebyshevDroneCoefficient9, gkChebyshevDroneCoefficient10
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
asignal = asignal * aenvelope
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "ChebyshevDrone i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr ChebyshevMelody
///////////////////////////////////////////////////////
// Original by Jon Nelson.
// Adapted by Michael Gogins.
///////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iHz = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 7.
iattack = .01
isustain = p3
irelease = .01
p3 = iattack + isustain + irelease
adeclick linsegr 0, iattack, 1, isustain, 1, irelease, 0
kHz = k(iHz)
idB = i_midivelocity
i1 = iHz
k100 randi 1,0.05
isine ftgenonce 0, 0, 65536, 10, 1
k101 poscil 1, 5 + k100, isine
k102 linseg 0, .5, 1, p3, 1
k100 = i1 + (k101 * k102)
; Envelope for driving oscillator.
ip3 init 3.0
; k1 linenr 0.5, ip3 * .3, ip3 * 2, 0.01
k1 linseg 0, ip3 * .3, .5, ip3 * 2, 0.01, isustain, 0.01, irelease, 0
; k2 line 1, p3, .5
k2 linseg 1.0, ip3, .5, isustain, .5, irelease, 0
k1 = k2 * k1
; Amplitude envelope.
k10 expseg 0.0001, iattack, 1.0, isustain, 0.8, irelease, .0001
k10 = (k10 - .0001)
; Power to partials.
k20 linseg 1.485, iattack, 1.5, (isustain + irelease), 1.485
; a1-3 are for cheby with p6=1-4
icook3 ftgenonce 0, 0, 65536, 10, 1, .4, 0.2, 0.1, 0.1, .05
a1 poscil k1, k100 - .25, icook3
; Tables a1 to fn13, others normalize,
ip6 ftgenonce 0, 0, 65536, -7, -1, 150, 0.1, 110, 0, 252, 0
a2 tablei a1, ip6, 1, .5
a3 balance a2, a1
; Try other waveforms as well.
a4 foscili 1, k100 + .04, 1, 2.000, k20, isine
a5 poscil 1, k100, isine
a6 = ((a3 * .1) + (a4 * .1) + (a5 * .8)) * k10
a7 comb a6, .5, 1 / i1
a8 = (a6 * .9) + (a7 * .1)
asignal balance a8, a1
asignal = asignal * iamplitude
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "ChebyshevMel i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr DelayedPluckedString
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.02
isustain = p3
irelease = 0.15
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ikeyin = i_midikey
ihertz = cpsmidinn(ikeyin)
; Detuning of strings by 4 cents each way.
idetune = 4.0 / 1200.0
ihertzleft = cpsmidinn(ikeyin + idetune)
ihertzright = cpsmidinn(ikeyin - idetune)
iamplitude = ampdb(i_midivelocity)
isine ftgenonce 0, 0, 65536, 10, 1
icosine ftgenonce 0, 0, 65536, 11, 1
igenleft = isine
igenright = icosine
kvibrato oscili 1.0 / 120.0, 7.0, icosine
kexponential expseg 1.0, p3 + iattack, 0.0001, irelease, 0.0001
aenvelope = (kexponential - 0.0001) * adeclick
ag pluck iamplitude, cpsmidinn(ikeyin + kvibrato), 200, igenleft, 1
agleft pluck iamplitude, ihertzleft, 200, igenleft, 1
agright pluck iamplitude, ihertzright, 200, igenright, 1
imsleft = 0.2 * 1000
imsright = 0.21 * 1000
adelayleft vdelay ag * aenvelope, imsleft, imsleft + 100
adelayright vdelay ag * aenvelope, imsright, imsright + 100
asignal = adeclick * (agleft + adelayleft + agright + adelayright)
; Highpass filter to exclude speaker cone excursions.
asignal1 butterhp asignal, 32.0
asignal2 balance asignal1, asignal
aoutleft, aoutright pan2 asignal2 * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "DelayedPlucked i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr EnhancedFMBell
//////////////////////////////////////////////////////
// Original by John ffitch.
// Adapted by Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.005
isustain = p3
irelease = 0.25
i_duraton = 15; isustain + iattack + irelease
p3 = i_duration
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency = cpsmidinn(i_midikey)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude = ampdb(i_midivelocity)
idur = 50
iamp = iamplitude
iffitch1 ftgenonce 0, 0, 65536, 10, 1
iffitch2 ftgenonce 0, 0, 8193, 5, 1, 1024, 0.01
iffitch3 ftgenonce 0, 0, 8193, 5, 1, 1024, 0.001
ifenv = iffitch2 ; BELL SETTINGS:
ifdyn = iffitch3 ; AMP AND INDEX ENV ARE EXPONENTIAL
ifq1 = cpsmidinn(i_midikey) ;* 5 ; DECREASING, N1:N2 IS 5:7, imax=10
if1 = iffitch1 ; DURATION = 15 sec
ifq2 = cpsmidinn(i_midikey) * 5/7
if2 = iffitch1
imax = 10
aenv oscili iamp, 1 / idur, ifenv ; ENVELOPE
adyn oscili ifq2 * imax, 1 / idur, ifdyn ; DYNAMIC
anoise rand 50
amod oscili adyn + anoise, ifq2, if2 ; MODULATOR
acar oscili aenv, ifq1 + amod, if1 ; CARRIER
timout 0.5, idur, noisend
knenv linsegr iamp, 0.2, iamp, 0.3, 0
anoise3 rand knenv
anoise4 butterbp anoise3, iamp, 100
anoise5 balance anoise4, anoise3
noisend:
arvb nreverb acar, 2, 0.1
aenvelope transeg 1, idur, -3, 0
asignal = aenvelope * (acar + arvb) ;+ anoise5
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "EnhancedFMBell i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr FenderRhodesModel
//////////////////////////////////////////////////////
// Original by Perry Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.01
isustain = p3
irelease = 0.125
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iindex = 4
icrossfade = 3
ivibedepth = 0.2
iviberate = 6
isine ftgenonce 0, 0, 65536, 10, 1
icosine ftgenonce 0, 0, 65536, 11, 1
icookblank ftgenonce 0, 0, 65536, 10, 0 ; Blank wavetable for some Cook FM opcodes.
ifn1 = isine
ifn2 = icosine
ifn3 = isine
ifn4 = icookblank
ivibefn = isine
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 6
asignal fmrhode iamplitude, ifrequency, iindex, icrossfade, ivibedepth, iviberate, ifn1, ifn2, ifn3, ifn4, ivibefn
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "FenderRhodes i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr FilteredSines
//////////////////////////////////////////////////////
// Original by Michael Bergeman.
// Adapted by Michael Gogins.
//////////////////////////////////////////////////////
; Original pfields
; p1 p2 p3 p4 p5 p6 p7 p8 p9
; ins st dur db func at dec freq1 freq2
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.03
isustain = p3
irelease = 0.52
p3 = p3 + iattack + irelease
i_duration = p3
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ip4 = i_midivelocity
idb = ampdb(i_midivelocity) * 4
ibergeman ftgenonce 0, 0, 65536, 10, 0.28, 1, 0.74, 0.66, 0.78, 0.48, 0.05, 0.33, 0.12, 0.08, 0.01, 0.54, 0.19, 0.08, 0.05, 0.16, 0.01, 0.11, 0.3, 0.02, 0.2 ; Bergeman f1
ip5 = ibergeman
ip3 = i_duration
ip6 = i_duration * 0.25
ip7 = i_duration * 0.75
ip8 = cpsmidinn(i_midikey - 0.01)
ip9 = cpsmidinn(i_midikey + 0.01)
isc = idb * 0.333
k1 line 40, p3, 800
k2 line 440, p3, 220
k3 linen isc, ip6, p3, ip7
k4 line 800, ip3, 40
k5 line 220, ip3, 440
k6 linen isc, ip6, ip3, ip7
k7 linen 1, ip6, ip3, ip7
a5 oscili k3, ip8, ip5
a6 oscili k3, ip8 * 0.999, ip5
a7 oscili k3, ip8 * 1.001, ip5
a1 = a5 + a6 + a7
a8 oscili k6, ip9, ip5
a9 oscili k6, ip9 * 0.999, ip5
a10 oscili k6, ip9 * 1.001, ip5
a11 = a8 + a9 + a10
a2 butterbp a1, k1, 40
a3 butterbp a2, k5, k2 * 0.8
a4 balance a3, a1
a12 butterbp a11, k4, 40
a13 butterbp a12, k2, k5 * 0.8
a14 balance a13, a11
a15 reverb2 a4, 5, 0.3
a16 reverb2 a4, 4, 0.2
; Constant-power pan.
ipi = 4.0 * taninv(1.0)
iradians = i_pan * ipi / 2.0
itheta = iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain = sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain = sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
a17 = (a15 + a4) * ileftgain * k7
a18 = (a16 + a4) * irightgain * k7
aoutleft = a17 * adeclick
aoutright = a18 * adeclick
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "FilteredSines i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Flute
//////////////////////////////////////////////////////
// Original by James Kelley.
// Adapted by Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ikellyflute ftgenonce 0, 0, 65536, 10, 1, 0.25, 0.1 ; Kelley flute.
; Do some phasing.
icpsp1 = cpsmidinn(i_midikey - 0.0002)
icpsp2 = cpsmidinn(i_midikey + 0.0002)
ip6 = ampdb(i_midivelocity)
iattack = 0.04
isustain = p3
irelease = 0.15
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ip4 = 0
if (ip4 == int(ip4 / 2) * 2) goto initslurs
ihold
initslurs:
iatttm = 0.09
idectm = 0.1
isustm = p3 - iatttm - idectm
idec = ip6
ireinit = -1
if (ip4 > 1) goto checkafterslur
ilast = 0
checkafterslur:
if (ip4 == 1 || ip4 == 3) goto doneslurs
idec = 0
ireinit = 0
; KONTROL
doneslurs:
if (isustm <= 0) goto simpleenv
kamp linsegr ilast, iatttm, ip6, isustm, ip6, idectm, idec, 0, idec
goto doneenv
simpleenv:
kamp linsegr ilast, p3 / 2,ip6, p3 / 2, idec, 0, idec
doneenv:
ilast = ip6
; Some vibrato.
kvrandamp rand 0.1
kvamp = (8 + p4) *.06 + kvrandamp
kvrandfreq rand 1
kvfreq = 5.5 + kvrandfreq
isine ftgenonce 0, 0, 65536, 10, 1
kvbra oscili kvamp, kvfreq, isine, ireinit
kfreq1 = icpsp1 + kvbra
kfreq2 = icpsp2 + kvbra
; Noise for burst at beginning of note.
knseenv expon ip6 / 4, 0.2, 1
; AUDIO
anoise1 rand knseenv
anoise tone anoise1, 200
a1 oscili kamp, kfreq1, ikellyflute, ireinit
a2 oscili kamp, kfreq2, ikellyflute, ireinit
a3 = a1 + a2 + anoise
aoutleft, aoutright pan2 a3 * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Flute i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr FMModerateIndex
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 3
icarrier = 1
iratio = 1.25
ifmamplitude = 8
index = 5.4
iattack = 0.01
isustain = p3
irelease = 0.05
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequencyb = ifrequency * 1.003
icarrierb = icarrier * 1.004
kindenv transeg 0, iattack, -4, 1, isustain, -2, 0.125, irelease, -4, 0
kindex = kindenv * index * ifmamplitude
isine ftgenonce 0, 0, 65536, 10, 1
aouta foscili 1, ifrequency, icarrier, iratio, index, isine
aoutb foscili 1, ifrequencyb, icarrierb, iratio, index, isine
asignal = (aouta + aoutb) * kindenv
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "FMModerateInd i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr FMModerateIndex2
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 3
icarrier = 1
iratio = 1
ifmamplitude = 6
index = 2.5
iattack = 0.02
isustain = p3
irelease = 0.05
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequencyb = ifrequency * 1.003
icarrierb = icarrier * 1.004
kindenv expseg 0.000001, iattack, 1.0, isustain, 0.0125, irelease, 0.000001
kindex = kindenv * index * ifmamplitude - 0.000001
isine ftgenonce 0, 0, 65536, 10, 1
aouta foscili 1, ifrequency, icarrier, iratio, index, isine
aoutb foscili 1, ifrequencyb, icarrierb, iratio, index, isine
asignal = (aouta + aoutb) * kindenv
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "FMModerateInd2 i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr FMModulatedChorusing
//////////////////////////////////////////////
// Original by Thomas Kung.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.333333
irelease = 0.1
isustain = p3
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iamplitude = ampdb(i_midikey) / 1200
ip6 = 0.3
ip7 = 2.2
; shift it.
ishift = 4.0 / 12000
; convert parameter 5 to cps.
ipch = cpsmidinn(i_midikey)
; convert parameter 5 to oct.
ioct = i_midikey
kadsr linen 1.0, iattack, irelease, 0.01
kmodi linseg 0, iattack, 5, isustain, 2, irelease, 0
; r moves from ip6 to ip7 in p3 secs.
kmodr linseg ip6, p3, ip7
a1 = kmodi * (kmodr - 1 / kmodr) / 2
; a1*2 is argument normalized from 0-1.
a1ndx = abs(a1 * 2 / 20)
a2 = kmodi * (kmodr + 1 / kmodr) / 2
; Look up table is in f43, normalized index.
iln ftgenonce 0, 0, 65536, -12, 20.0 ; Unscaled ln(I(x)) from 0 to 20.0.
a3 tablei a1ndx, iln, 1
icosine ftgenonce 0, 0, 65536, 11, 1 ; Cosine wave. Get that noise down on the most widely used table!
ao1 oscili a1, ipch, icosine
a4 = exp(-0.5 * a3 + ao1)
; Cosine
ao2 oscili a2 * ipch, ipch, icosine
isine ftgenonce 2, 0, 65536, 10, 1
; Final output left
aoutl oscili 1 * kadsr * a4, ao2 + cpsmidinn(ioct + ishift), isine
; Final output right
aoutr oscili 1 * kadsr * a4, ao2 + cpsmidinn(ioct - ishift), isine
asignal = aoutl + aoutr
asignal = asignal * iamplitude
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "FMModulatedCho i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr FMWaterBell
//////////////////////////////////////////////
// Original by Steven Yi.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ipch = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 2.0
ipch2 = ipch
kpchline line ipch, i_duration, ipch2
iamp = 2
ienvType = 2
kenv init 0
if ienvType == 0 kgoto env0 ; adsr
if ienvType == 1 kgoto env1 ; pyramid
if ienvType == 2 kgoto env2 ; ramp
env0:
kenv adsr .3, .2, .9, .5
kgoto endEnvelope
env1:
kenv linseg 0, i_duration * .5, 1, i_duration * .5, 0
kgoto endEnvelope
env2:
kenv linseg 0, i_duration - .1, 1, .1, 0
kgoto endEnvelope
endEnvelope:
kc1 = 5
kc2 = 5
kvdepth = 0.005
kvrate = 6
icosine ftgenonce 0, 0, 65536, 11, 1
ifn1 = icosine
ifn2 = icosine
ifn3 = icosine
ifn4 = icosine
ivfn = icosine
asignal fmbell iamp, kpchline, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, ifn4, ivfn
iattack = 0.003
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 iamplitude * asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "FMWaterBell i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Granular
//////////////////////////////////////////////
// Original by Hans Mikelson.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) / 175
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; f1 0 65536 1 "hahaha.aif" 0 4 0
; f2 0 1024 7 0 224 1 800 0
; f3 0 8192 7 1 8192 -1
; f4 0 1024 7 0 512 1 512 0
; f5 0 1024 10 1 .3 .1 0 .2 .02 0 .1 .04
; f6 0 1024 10 1 0 .5 0 .33 0 .25 0 .2 0 .167
; a0 14 50
; p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
; Start Dur Amp Freq GrTab WinTab FqcRng Dens Fade
; i1 0.0 6.5 700 9.00 5 4 .210 200 1.8
; i1 3.2 3.5 800 7.08 . 4 .042 100 0.8
; i1 5.1 5.2 600 7.10 . 4 .032 100 0.9
; i1 7.2 6.6 900 8.03 . 4 .021 150 1.6
; i1 21.3 4.5 1000 9.00 . 4 .031 150 1.2
; i1 26.5 13.5 1100 6.09 . 4 .121 150 1.5
; i1 30.7 9.3 900 8.05 . 4 .014 150 2.5
; i1 34.2 8.8 700 10.02 . 4 .14 150 1.6
igrtab ftgenonce 0, 0, 65536, 10, 1, .3, .1, 0, .2, .02, 0, .1, .04
iwintab ftgenonce 0, 0, 65536, 10, 1, 0, .5, 0, .33, 0, .25, 0, .2, 0, .167
iHz = ifrequency
ip4 = iamplitude
ip5 = iHz
ip6 = igrtab
ip7 = iwintab
ip8 = 0.033
ip9 = 150
ip10 = 1.6
idur = p3
iamp = iamplitude ; p4
ifqc = iHz ; cpspch(p5)
igrtab = ip6
iwintab = ip7
ifrng = ip8
idens = ip9
ifade = ip10
igdur = 0.2
kamp linseg 0, ifade, 1, idur - 2 * ifade, 1, ifade, 0
; Amp Fqc Dense AmpOff PitchOff GrDur GrTable WinTable MaxGrDur
aoutl grain ip4, ifqc, idens, 100, ifqc * ifrng, igdur, igrtab, iwintab, 5
aoutr grain ip4, ifqc, idens, 100, ifqc * ifrng, igdur, igrtab, iwintab, 5
aoutleft = aoutl * kamp * iamplitude
aoutright = aoutr * kamp * iamplitude
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Granular i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Guitar
//////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) / 8.0
iattack = 0.01
isustain = p3
irelease = 0.05
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency = cpsmidinn(p4)
iamplitude = ampdb(p5) * 20
kamp linsegr 0.0, iattack, iamplitude, isustain, iamplitude, irelease, 0.0
asigcomp pluck 1, 440, 440, 0, 1
asig pluck 1, ifrequency, ifrequency, 0, 1
af1 reson asig, 110, 80
af2 reson asig, 220, 100
af3 reson asig, 440, 80
aout balance 0.6 * af1+ af2 + 0.6 * af3 + 0.4 * asig, asigcomp
kexp expseg 1.0, iattack, 2.0, isustain, 1.0, irelease, 1.0
kenv = kexp - 1.0
asignal = aout * kenv * kamp
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Guitar i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Guitar2
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 12
iattack = 0.01
isustain = p3
irelease = 0.05
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
kamp linsegr 0.0, iattack, 1, isustain, 1, irelease, 0.0
asigcomp pluck kamp, 440, 440, 0, 1
asig pluck kamp, ifrequency, ifrequency, 0, 1
af1 reson asig, 110, 80
af2 reson asig, 220, 100
af3 reson asig, 440, 80
aout balance 0.6 * af1+ af2 + 0.6 * af3 + 0.4 * asig, asigcomp
kexp expseg 1.0, iattack, 2.0, isustain, 1.0, irelease, 1.0
kenv = kexp - 1.0
asignal = aout * kenv
asignal dcblock asignal
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Guitar2 i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Harpsichord
//////////////////////////////////////////////
// Original by James Kelley.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
insno = p1
itime = p2
iduration = p3
ikey = p4
ivelocity = p5
iphase = p6
ipan = p7
idepth = p8
iheight = p9
ipcs = p10
ihomogeneity = p11
gkHarpsichordGain = .25
gkHarpsichordPan = .5
iattack = .005
isustain = p3
irelease = .3
p3 = iattack + isustain + irelease
iHz = cpsmidinn(ikey)
kHz = k(iHz)
iamplitude = ampdb(ivelocity) * 36
aenvelope transeg 1.0, 20.0, -10.0, 0.05
apluck pluck 1, kHz, iHz, 0, 1
iharptable ftgenonce 0, 0, 65536, 7, -1, 1024, 1, 1024, -1
aharp poscil 1, kHz, iharptable
aharp2 balance apluck, aharp
asignal = (apluck + aharp2) * iamplitude * aenvelope * gkHarpsichordGain
adeclick linsegr 0, iattack, 1, isustain, 1, irelease, 0
aoutleft, aoutright pan2 asignal * adeclick, ipan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Harpsichord i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr HeavyMetalModel
//////////////////////////////////////////////
// Original by Perry Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.01
idecay = 2.0
isustain = i_duration
irelease = 0.125
p3 = iattack + iattack + idecay + irelease
adeclick linsegr 0.0, iattack, 1.0, idecay + isustain, 1.0, irelease, 0.0
iindex = 1
icrossfade = 3
ivibedepth = 0.02
iviberate = 4.8
isine ftgenonce 0, 0, 65536, 10, 1
icosine ftgenonce 0, 0, 65536, 11, 1 ; Cosine wave. Get that noise down on the most widely used table!
iexponentialrise ftgenonce 0, 0, 65536, 5, 0.001, 513, 1 ; Exponential rise.
ithirteen ftgenonce 0, 0, 65536, 9, 1, 0.3, 0
ifn1 = isine
ifn2 = iexponentialrise
ifn3 = ithirteen
ifn4 = isine
ivibefn = icosine
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 48.0
adecay transeg 0.0, iattack, 4, 1.0, idecay + isustain, -4, 0.1, irelease, -4, 0.0
asignal fmmetal 0.1, ifrequency, iindex, icrossfade, ivibedepth, iviberate, ifn1, ifn2, ifn3, ifn4, ivibefn
asignal = asignal * iamplitude
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "HeavyMetalMod i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Hypocycloid
//////////////////////////////////////////////
// Original by Hans Mikelson.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
; This set of parametric equations defines the path traced by
; a point on a circle of radius B rotating inside a circle of
; radius A.
; p1 p2 p3 p4 p5 p6 p7 p8
; Start Dur Amp Frqc A B Hole
; i 3 16 6 8000 8.00 10 2 1
; i 3 20 4 . 7.11 5.6 0.4 0.8
; i 3 + 4 . 8.05 2 8.5 0.7
; i 3 . 2 . 8.02 4 5 0.6
; i 3 . 2 . 8.02 5 0.5 1.2
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
iHz = ifrequency
ifqc init iHz
ip4 init iamplitude
ifqci init iHz
ia = 0.6 ; p6
ib = 0.4 ; p7
ihole = 0.8 ; p8
iscale = (ia < ib ? 1 / ib : 1 / ia)
kampenv linseg 0, .1, ip4 * iscale, p3 - .2, ip4 * iscale, .1, 0
kptchenv linseg ifqci, .2 * p3, ifqc, .8 * p3, ifqc
kvibenv linseg 0, .5, 0, .2, 1, .2, 1
isine ftgenonce 0, 0, 65536, 10, 1
icosine ftgenonce 0, 0, 65536, 11, 1
kvibr oscili 20, 8, icosine
kfqc = kptchenv+kvibr*kvibenv
; Sine and Cosine
acos1 oscili ia - ib, kfqc, icosine
acos2 oscili ib * ihole, (ia - ib) / ib * kfqc, icosine
ax = acos1 + acos2
asin1 oscili ia-ib, kfqc, isine
asin2 oscili ib, (ia - ib) / ib * kfqc, isine
ay = asin1 - asin2
aoutleft = kampenv * ax
aoutright = kampenv * ay
; Constant-power pan.
ipi = 4.0 * taninv(1.0)
iradians = i_pan * ipi / 2.0
itheta = iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain = sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain = sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
outleta "outleft", aoutleft * ileftgain
outleta "outright", aoutright * irightgain
prints "Hypocycloid i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr ModerateFM
//////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.002
isustain = p3
idecay = 8
irelease = 0.05
iHz = cpsmidinn(i_midikey)
idB = i_midivelocity
iamplitude = ampdb(idB) * 4.0
icarrier = 1
imodulator = 0.5
ifmamplitude = 0.25
index = .5
ifrequencyb = iHz * 1.003
icarrierb = icarrier * 1.004
aindenv transeg 0.0, iattack, -11.0, 1.0, idecay, -7.0, 0.025, isustain, 0.0, 0.025, irelease, -7.0, 0.0
aindex = aindenv * index * ifmamplitude
isinetable ftgenonce 0, 0, 65536, 10, 1, 0, .02
; ares foscili xamp, kcps, xcar, xmod, kndx, ifn [, iphs]
aouta foscili 1.0, iHz, icarrier, imodulator, index / 4., isinetable
aoutb foscili 1.0, ifrequencyb, icarrierb, imodulator, index, isinetable
; Plus amplitude correction.
asignal = (aouta + aoutb) * aindenv
adeclick linsegr 0, iattack, 1, isustain, 1, irelease, 0
asignal = asignal * iamplitude
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "ModerateFM i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr ModulatedFM
//////////////////////////////////////////////
// Original by Thomas Kung.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = .25
isustain = p3
irelease = .33333333
p3 = iattack + isustain + irelease
iHz = cpsmidinn(i_midikey)
kHz = k(iHz)
idB = i_midivelocity
iamplitude = ampdb(i_midivelocity)
adeclick linsegr 0, iattack, 1, isustain, 1, irelease, 0
ip6 = 0.3
ip7 = 2.2
ishift = 4.0 / 12000.0
kpch = kHz
koct = octcps(kHz)
aadsr linen 1.0, iattack, irelease, 0.01
amodi linseg 0, iattack, 5, p3, 2, irelease, 0
; r moves from ip6 to ip7 in p3 secs.
amodr linseg ip6, p3, ip7
a1 = amodi * (amodr - 1 / amodr) / 2
; a1*2 is argument normalized from 0-1.
a1ndx = abs(a1 * 2 / 20)
a2 = amodi * (amodr + 1 / amodr) / 2
; Unscaled ln(I(x)) from 0 to 20.0.
iln ftgenonce 0, 0, 65536, -12, 20.0
a3 tablei a1ndx, iln, 1
icosine ftgenonce 0, 0, 65536, 11, 1
ao1 poscil a1, kpch, icosine
a4 = exp(-0.5 * a3 + ao1)
; Cosine
ao2 poscil a2 * kpch, kpch, icosine
isine ftgenonce 0, 0, 65536, 10, 1
; Final output left
aleft poscil a4, ao2 + cpsoct(koct + ishift), isine
; Final output right
aright poscil a4, ao2 + cpsoct(koct - ishift), isine
asignal = (aleft + aright) * iamplitude
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "ModulatedFM i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
gk_PianoNote_midi_dynamic_range init 127
giPianoteq init 0
instr PianoNote
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
if p3 == -1 goto indefinite
goto non_indefinite
indefinite:
p3 = 1000000
non_indefinite:
i_instrument = p1
i_time = p2
i_duration = p3
i_midi_key = p4
i_midi_dynamic_range = i(gk_PianoNote_midi_dynamic_range)
i_midi_velocity = p5 * i_midi_dynamic_range / 127 + (63.6 - i_midi_dynamic_range / 2)
k_space_front_to_back = p6
k_space_left_to_right = p7
k_space_bottom_to_top = p8
i_phase = p9
i_homogeneity = p11
instances active p1
prints "PianoNotePt i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\\n", p1, p2, p3, p4, p5, p7, instances
i_pitch_correction = 44100 / sr
; prints "Pitch factor: %9.4f\n", i_pitch_correction
vstnote giPianoteq, i_instrument, i_midi_key, i_midi_velocity, i_duration
endin
instr PlainPluckedString
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
iattack = 0.002
isustain = p3
irelease = 0.075
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 6
aenvelope transeg 0, iattack, -4, iamplitude, isustain, -4, iamplitude / 10.0, irelease, -4, 0
asignal1 pluck 1, ifrequency, ifrequency * 1.002, 0, 1
asignal2 pluck 1, ifrequency * 1.003, ifrequency, 0, 1
asignal = (asignal1 + asignal2) * aenvelope
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "PlainPluckedSt i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr PRCBeeThree
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 6
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
asignal STKBeeThree ifrequency, 1
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "PRCBeeThree i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr PRCBeeThreeDelayed
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 6
iattack = 0.2
isustain = p3
irelease = 0.3
p3 = isustain + iattack + irelease
asignal STKBeeThree ifrequency, 1, 2, 3, 1, 0, 11, 0
amodulator oscils 0.00015, 0.2, 0.0
; Read delayed signal, first delayr instance:
adump delayr 4.0
adly1 deltapi 0.03 + amodulator; associated with first delayr instance
; Read delayed signal, second delayr instance:
adump delayr 4.0
adly2 deltapi 0.029 + amodulator ; associated with second delayr instance
; Do some cross-coupled manipulation:
afdbk1 = 0.7 * adly1 + 0.7 * adly2 + asignal
afdbk2 = -0.7 * adly1 + 0.7 * adly2 + asignal
; Feed back signal, associated with first delayr instance:
delayw afdbk1
; Feed back signal, associated with second delayr instance:
delayw afdbk2
asignal2 = adly1 + adly2
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal2 * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "PRCBeeThreeDel i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr PRCBowed
//////////////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 6
; Controllers:
; 1 Vibrato Gain
; 2 Bow Pressure
; 4 Bow Position
; 11 Vibrato Frequency
; 128 Volume
asignal STKBowed ifrequency, 1.0, 1, 1.8, 2, 120.0, 4, 50.0, 11, 20.0
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "PRCBowed i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKBandedWG
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 256
asignal STKBandedWG ifrequency, 1.0
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKBandedWG i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKBeeThree
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 16
asignal STKBeeThree ifrequency, 1.0, 1, 1.5, 2, 4.8, 4, 2.1
aphased phaser1 asignal, 4000, 16, .2, .9
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 aphased * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKBeeThree i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKBlowBotl
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
asignal STKBlowBotl ifrequency, 1.0
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKBlowBotl i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKBlowHole
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
asignal STKBlowHole ifrequency, 1.0
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKBlowHole i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKBowed
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
; Controllers:
; 1 Vibrato Gain
; 2 Bow Pressure
; 4 Bow Position
; 11 Vibrato Frequency
; 128 Volume
asignal STKBowed ifrequency, 1.0, 1, 0.8, 2, 120.0, 4, 20.0, 11, 20.0
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKBowed i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKClarinet
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
asignal STKClarinet ifrequency, 1.0, 1, 1.5
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKClarinet i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKDrummer
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
asignal STKDrummer ifrequency, 1.0
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKDrummer i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKFlute
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
; Control Change Numbers:
; * Jet Delay = 2
; * Noise Gain = 4
; * Vibrato Frequency = 11
; * Vibrato Gain = 1
; * Breath Pressure = 128
asignal STKFlute ifrequency, 1.0, 128, 100, 2, 70, 4, 10
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKFlute i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKFMVoices
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
; Control Change Numbers:
; * Vowel = 2
; * Spectral Tilt = 4
; * LFO Speed = 11
; * LFO Depth = 1
; * ADSR 2 & 4 Target = 128
asignal STKFMVoices ifrequency, 1.0, 2, 1, 4, 3.0, 11, 5, 1, .8
idampingattack = .002
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKFMVoices i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKHvyMetl
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
; Control Change Numbers:
; * Total Modulator Index = 2
; * Modulator Crossfade = 4
; * LFO Speed = 11
; * LFO Depth = 1
; * ADSR 2 & 4 Target = 128
asignal STKHevyMetl ifrequency, 1.0, 2, 17.0, 4, 70, 128, 80
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKHvyMetl i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKMandolin
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 24
asignal STKMandolin ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKMandolin i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKModalBar
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 24
; Control Change Numbers:
; * Stick Hardness = 2
; * Stick Position = 4
; * Vibrato Gain = 1
; * Vibrato Frequency = 11
; * Direct Stick Mix = 8
; * Volume = 128
; * Modal Presets = 16
; o Marimba = 0
; o Vibraphone = 1
; o Agogo = 2
; o Wood1 = 3
; o Reso = 4
; o Wood2 = 5
; o Beats = 6
; o Two Fixed = 7
; o Clump = 8
asignal STKModalBar ifrequency, 1.0, 16, 1
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKModalBar i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKMoog
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
asignal STKMoog ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKMoog i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKPercFlut
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
asignal STKPercFlut ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKPercFlut i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKPlucked
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 16
asignal STKPlucked ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKPlucked i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKResonate
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity)
;Control Change Numbers:
; * Resonance Frequency (0-Nyquist) = 2
; * Pole Radii = 4
; * Notch Frequency (0-Nyquist) = 11
; * Zero Radii = 1
; * Envelope Gain = 128
asignal STKResonate ifrequency, 1.;, 2, 40, 4, .7, 11, 120, 1, .5
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKResonate i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKRhodey
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
asignal STKRhodey ifrequency, 1
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKRhodey i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKSaxofony
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
; Control Change Numbers:
; * Reed Stiffness = 2
; * Reed Aperture = 26
; * Noise Gain = 4
; * Blow Position = 11
; * Vibrato Frequency = 29
; * Vibrato Gain = 1
; * Breath Pressure = 128
asignal STKSaxofony ifrequency, 1.0, 2, 80, 11, 100;, 29, 5, 1, 12
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKSaxofony i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKShakers
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 256
;Control Change Numbers:
; * Shake Energy = 2
; * System Decay = 4
; * Number Of Objects = 11
; * Resonance Frequency = 1
; * Shake Energy = 128
; * Instrument Selection = 1071
; o Maraca = 0
; o Cabasa = 1
; o Sekere = 2
; o Guiro = 3
; o Water Drops = 4
; o Bamboo Chimes = 5
; o Tambourine = 6
; o Sleigh Bells = 7
; o Sticks = 8
; o Crunch = 9
; o Wrench = 10
; o Sand Paper = 11
; o Coke Can = 12
; o Next Mug = 13
; o Penny + Mug = 14
; o Nickle + Mug = 15
; o Dime + Mug = 16
; o Quarter + Mug = 17
; o Franc + Mug = 18
; o Peso + Mug = 19
; o Big Rocks = 20
; o Little Rocks = 21
; o Tuned Bamboo Chimes = 22
asignal STKShakers ifrequency, 1.0, 1071, 22, 11, 4;, 128, 100, 1, 30
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKShakers i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKSimple
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 64
; Control Change Numbers:
; * Filter Pole Position = 2
; * Noise/Pitched Cross-Fade = 4
; * Envelope Rate = 11
; * Gain = 128
asignal STKSimple ifrequency, 1.0, 2, 98, 4, 50, 11, 3
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKSimple i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKSitar
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
asignal STKSitar ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKSitar i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKTubeBell
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 8
asignal STKTubeBell ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKTubeBell i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKVoicForm
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 16
asignal STKVoicForm ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKVoicForm i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKWhistle
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
asignal STKWhistle ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKWhistle i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr STKWurley
//////////////////////////////////////////////
// Original by Perry R. Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 16
asignal STKWurley ifrequency, 1.0
idampingattack = .0003
idampingrelease = .01
idampingsustain = p3
iduration = idampingattack + idampingsustain + idampingrelease
p3 = iduration
adeclick linsegr 0, idampingattack, 1, idampingsustain, 1, idampingrelease, 0
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "STKWurley i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr StringPad
//////////////////////////////////////////////
// Original by Anthony Kozar.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
; String-pad borrowed from the piece "Dorian Gray",
; http://akozar.spymac.net/music/ Modified to fit my needs
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ihz = cpsmidinn(i_midikey)
iamp = ampdb(i_midivelocity) * 3
idb = i_midivelocity
ipos = i_pan
; Slow attack and release
akctrl linsegr 0, i_duration * 0.5, iamp, i_duration *.5, 0
; Slight chorus effect
iwave ftgenonce 0, 0, 65536, 10, 1, 0.5, 0.33, 0.25, 0.0, 0.1, 0.1, 0.1
afund oscili akctrl, ihz, iwave ; audio oscillator
acel1 oscili akctrl, ihz - 0.1, iwave ; audio oscillator - flat
acel2 oscili akctrl, ihz + 0.1, iwave ; audio oscillator - sharp
asig = afund + acel1 + acel2
; Cut-off high frequencies depending on midi-velocity
; (larger velocity implies more brighter sound)
asignal butterlp asig, (i_midivelocity - 60) * 40 + 900
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "StringPad i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr ToneWheelOrgan
//////////////////////////////////////////////
// Original by Hans Mikelson.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) / 8.0
iattack = 0.02
isustain = i_duration
irelease = 0.1
i_duration = iattack + isustain + irelease
p3 = i_duration
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
; Rotor Tables
itonewheel1 ftgenonce 0, 0, 65536, 10, 1, 0.02, 0.01
itonewheel2 ftgenonce 0, 0, 65536, 10, 1, 0, 0.2, 0, 0.1, 0, 0.05, 0, 0.02
; Rotating Speaker Filter Envelopes
itonewheel3 ftgenonce 0, 0, 65536, 7, 0, 110, 0, 18, 1, 18, 0, 110, 0
itonewheel4 ftgenonce 0, 0, 65536, 7, 0, 80, 0.2, 16, 1, 64, 1, 16, 0.2, 80, 0
; Distortion Tables
itonewheel5 ftgenonce 0, 0, 65536, 8, -.8, 336, -.78, 800, -.7, 5920, 0.7, 800, 0.78, 336, 0.8
itonewheel6 ftgenonce 0, 0, 65536, 8, -.8, 336, -.76, 3000, -.7, 1520, 0.7, 3000, 0.76, 336, 0.8
icosine ftgenonce 0, 0, 65536, 11, 1
iphase = p2
ikey = 12 * int(i_midikey - 6) + 100 * (i_midikey - 6)
ifqc = ifrequency
; The lower tone wheels have increased odd harmonic content.
iwheel1 = ((ikey - 12) > 12 ? itonewheel1 : itonewheel2)
iwheel2 = ((ikey + 7) > 12 ? itonewheel1 : itonewheel2)
iwheel3 = (ikey > 12 ? itonewheel1 : itonewheel2)
iwheel4 = icosine
; insno Start Dur Amp Pitch SubFund Sub3rd Fund 2nd 3rd 4th 5th 6th 8th
; i 1 0 6 200 8.04 8 8 8 8 3 2 1 0 4
asubfund oscili 8, 0.5 * ifqc, iwheel1, iphase / (ikey - 12)
asub3rd oscili 8, 1.4983 * ifqc, iwheel2, iphase / (ikey + 7)
afund oscili 8, ifqc, iwheel3, iphase / ikey
a2nd oscili 8, 2 * ifqc, iwheel4, iphase / (ikey + 12)
a3rd oscili 3, 2.9966 * ifqc, iwheel4, iphase / (ikey + 19)
a4th oscili 2, 4 * ifqc, iwheel4, iphase / (ikey + 24)
a5th oscili 1, 5.0397 * ifqc, iwheel4, iphase / (ikey + 28)
a6th oscili 0, 5.9932 * ifqc, iwheel4, iphase / (ikey + 31)
a8th oscili 4, 8 * ifqc, iwheel4, iphase / (ikey + 36)
asignal = iamplitude * (asubfund + asub3rd + afund + a2nd + a3rd + a4th + a5th + a6th + a8th)
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "ToneWheelOrgan i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr TubularBellModel
//////////////////////////////////////////////////////
// Original by Perry Cook.
// Adapted by Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
iattack = 0.003
isustain = p3
irelease = 0.125
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iindex = 1
icrossfade = 2
ivibedepth = 0.2
iviberate = 6
isine ftgenonce 0, 0, 65536, 10, 1
icosine ftgenonce 0, 0, 65536, 11, 1 ; Cosine wave. Get that noise down on the most widely used table!
icook3 ftgenonce 0, 0, 65536, 10, 1, 0.4, 0.2, 0.1, 0.1, 0.05
ifn1 = isine
ifn2 = icook3
ifn3 = isine
ifn4 = isine
ivibefn = icosine
asignal fmbell 1.0, ifrequency, iindex, icrossfade, ivibedepth, iviberate, ifn1, ifn2, ifn3, ifn4, ivibefn
aoutleft, aoutright pan2 asignal * iamplitude * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "TubularBellMod i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr WaveguideGuitar
//////////////////////////////////////////////////////
// Original by Jeff Livingston.
// Adapted by Michael Gogins.
//////////////////////////////////////////////////////
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) / 16
iHz = ifrequency
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The model takes pluck position, and pickup position (in % of string length), and generates
; a pluck excitation signal, representing the string displacement. The pluck consists
; of a forward and backward traveling displacement wave, which are recirculated thru two
; separate delay lines, to simulate the one dimensional string waveguide, with
; fixed ends.
;
; Losses due to internal friction of the string, and with air, as well as
; losses due to the mechanical impedance of the string terminations are simulated by
; low pass filtering the signal inside the feedback loops.
; Delay line outputs at the bridge termination are summed and fed into an IIR filter
; modeled to simulate the lowest two vibrational modes (resonances) of the guitar body.
; The theory implies that force due to string displacement, which is equivalent to
; displacement velocity times bridge mechanical impedance, is the input to the guitar
; body resonator model. Here we have modified the transfer fuction representing the bridge
; mech impedance, to become the string displacement to bridge input force transfer function.
; The output of the resulting filter represents the displacement of the guitar's top plate,
; and sound hole, since thier respective displacement with be propotional to input force.
; (based on a simplified model, viewing the top plate as a force driven spring).
;
; The effects of pluck hardness, and contact with frets during pluck release,
; have been modeled by injecting noise into the initial pluck, proportional to initial
; string displacement.
;
; Note on pluck shape: Starting with a triangular displacment, I found a decent sounding
; initial pluck shape after some trial and error. This pluck shape, which is a linear
; ramp, with steep fall off, doesn't necessarily agree with the pluck string models I've
; studied. I found that initial pluck shape significantly affects the realism of the
; sound output, but I the treatment of this topic in musical acoustics literature seems
; rather limited as far as I've encountered.
;
; Original pfields
; p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13
; in st dur amp pch plklen fbfac pkupPos pluckPos brightness vibf vibd vibdel
; i01.2 0.5 0.75 5000 7.11 .85 0.9975 .0 .25 1 0 0 0
ip4 init iamplitude
ip6 init 0.85
ip7 init 0.9975
ip8 init 0
ip9 init 0.25
ip10 init 1.0
ip11 init 0.001
ip12 init 0.0
ip13 init 0.0
afwav init 0
abkwav init 0
abkdout init 0
afwdout init 0
iEstr init 1.0 / cpspch(6.04)
ifqc init iHz ; cpspch(p5)
; note:delay time=2x length of string (time to traverse it)
idlt init 1.0 / ifqc
ipluck = 0.5 * idlt * ip6 * ifqc / cpspch(8.02)
ifbfac = ip7 ; feedback factor
; (exponentialy scaled) additive noise to add hi freq content
ibrightness = ip10 * exp(ip6 * log(2)) / 2
ivibRate = ip11
ivibDepth pow 2, ip12 / 12
; vibrato depth, +,- ivibDepth semitones
ivibDepth = idlt - 1.0 / (ivibDepth * ifqc)
; vibrato start delay (secs)
ivibStDly = ip13
; termination impedance model
; cutoff freq of LPF due to mech. impedance at the nut (2kHz-10kHz)
if0 = 10000
; damping parameter of nut impedance
iA0 = ip7
ialpha = cos(2 * 3.14159265 * if0 * 1 / sr)
; FIR LPF model of nut impedance, H(z)=a0+a1z^-1+a0z^-2
ia0 = 0.3 * iA0 / (2 * (1 - ialpha))
ia1 = iA0 - 2 * ia0
; NOTE each filter pass adds a sampling period delay,so subtract 1/sr from tap time to compensate
; determine (in crude fashion) which string is being played
; icurStr = (ifqc > cpspch(6.04) ? 2 : 1)
; icurStr = (ifqc > cpspch(6.09) ? 3 : icurStr)
; icurStr = (ifqc > cpspch(7.02) ? 4 : icurStr)
; icurStr = (ifqc > cpspch(7.07) ? 5 : icurStr)
; icurStr = (ifqc > cpspch(7.11) ? 6 : icurStr)
ipupos = ip8 * idlt / 2 ; pick up position (in % of low E string length)
ippos = ip9 * idlt / 2 ; pluck position (in % of low E string length)
isegF = 1 / sr
isegF2 = ipluck
iplkdelF = (ipluck / 2 > ippos ? 0 : ippos - ipluck / 2)
isegB = 1 / sr
isegB2 = ipluck
iplkdelB = (ipluck / 2 > idlt / 2 - ippos ? 0 : idlt / 2 - ippos - ipluck / 2)
; EXCITATION SIGNAL GENERATION
; the two excitation signals are fed into the fwd delay represent the 1st and 2nd
; reflections off of the left boundary, and two accelerations fed into the bkwd delay
; represent the the 1st and 2nd reflections off of the right boundary.
; Likewise for the backward traveling acceleration waves, only they encouter the
; terminations in the opposite order.
ipw = 1
ipamp = ip4 * ipluck ; 4 / ipluck
aenvstrf linseg 0, isegF, -ipamp / 2, isegF2, 0
adel1 delayr (idlt > 0) ? idlt : 0.01
; initial forward traveling wave (pluck to bridge)
aenvstrf1 deltapi iplkdelF
; first forward traveling reflection (nut to bridge)
aenvstrf2 deltapi iplkdelB + idlt / 2
delayw aenvstrf
; inject noise for attack time string fret contact, and pre pluck vibrations against pick
anoiz rand ibrightness
aenvstrf1 = aenvstrf1 + anoiz*aenvstrf1
aenvstrf2 = aenvstrf2 + anoiz*aenvstrf2
; filter to account for losses along loop path
aenvstrf2 filter2 aenvstrf2, 3, 0, ia0, ia1, ia0
; combine into one signal (flip refl wave's phase)
aenvstrf = aenvstrf1 - aenvstrf2
; initial backward excitation wave
aenvstrb linseg 0, isegB, - ipamp / 2, isegB2, 0
adel2 delayr (idlt > 0) ? idlt : 0.01
; initial bdwd traveling wave (pluck to nut)
aenvstrb1 deltapi iplkdelB
; first forward traveling reflection (nut to bridge)
aenvstrb2 deltapi idlt / 2 + iplkdelF
delayw aenvstrb
; initial bdwd traveling wave (pluck to nut)
; aenvstrb1 delay aenvstrb, iplkdelB
; first bkwd traveling reflection (bridge to nut)
; aenvstrb2 delay aenvstrb, idlt/2+iplkdelF
; inject noise
aenvstrb1 = aenvstrb1 + anoiz*aenvstrb1
aenvstrb2 = aenvstrb2 + anoiz*aenvstrb2
; filter to account for losses along loop path
aenvstrb2 filter2 aenvstrb2, 3, 0, ia0, ia1, ia0
; combine into one signal (flip refl wave's phase)
aenvstrb = aenvstrb1 - aenvstrb2
; low pass to band limit initial accel signals to be < 1/2 the sampling freq
ainputf tone aenvstrf, sr * 0.9 / 2
ainputb tone aenvstrb, sr * 0.9 / 2
; additional lowpass filtering for pluck shaping\
; Note, it would be more efficient to combine stages into a single filter
ainputf tone ainputf, sr * 0.9 / 2
ainputb tone ainputb, sr * 0.9 / 2
; Vibrato generator
icosine ftgenonce 0, 0, 65536, 11, 1.0
avib poscil ivibDepth, ivibRate, icosine
avibdl delayr (((ivibStDly * 1.1)) > 0.0) ? (ivibStDly * 1.1) : 0.01
avibrato deltapi ivibStDly
delayw avib
; Dual Delay line,
; NOTE: delay length longer than needed by a bit so that the output at t=idlt will be interpolated properly
;forward traveling wave delay line
afd delayr (((idlt + ivibDepth) * 1.1) > 0.0) ? ((idlt + ivibDepth) * 1.1) : 0.01
; output tap point for fwd traveling wave
afwav deltapi ipupos
; output at end of fwd delay (left string boundary)
afwdout deltapi idlt - 1 / sr + avibrato
; lpf/attn due to reflection impedance
afwdout filter2 afwdout, 3, 0, ia0, ia1, ia0
delayw ainputf + afwdout * ifbfac * ifbfac
; backward trav wave delay line
abkwd delayr (((idlt + ivibDepth) * 1.1) > 0) ? ((idlt + ivibDepth) * 1.1) : 0.01
; output tap point for bkwd traveling wave
abkwav deltapi idlt / 2 - ipupos
; output at the left boundary
; abkterm deltapi idlt/2
; output at end of bkwd delay (right string boundary)
abkdout deltapi idlt - 1 / sr + avibrato
abkdout filter2 abkdout, 3, 0, ia0, ia1, ia0
delayw ainputb + abkdout * ifbfac * ifbfac
; resonant body filter model, from Cuzzucoli and Lombardo
; IIR filter derived via bilinear transform method
; the theoretical resonances resulting from circuit model should be:
; resonance due to the air volume + soundhole = 110Hz (strongest)
; resonance due to the top plate = 220Hz
; resonance due to the inclusion of the back plate = 400Hz (weakest)
aresbod filter2 (afwdout + abkdout), 5, 4, 0.000000000005398681501844749, .00000000000001421085471520200, -.00000000001076383426834582, -00000000000001110223024625157, .000000000005392353230604385, -3.990098622573566, 5.974971737738533, -3.979630684599723, .9947612723736902
asignal = (1500 * (afwav + abkwav + aresbod * .000000000000000000003)) ; * adeclick
aoutleft, aoutright pan2 asignal * iamplitude, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "WaveguideGuit i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Xing
//////////////////////////////////////////////
// Original by Andrew Horner.
// Adapted by Michael Gogins.
// p4 pitch in octave.pch
// original pitch = A6
// range = C6 - C7
// extended range = F4 - C7
//////////////////////////////////////////////
insno = p1
itime = p2
iduration = p3
ikey = p4
ivelocity = p5
iphase = p6
ipan = p7
idepth = p8
iheight = p9
ipcs = p10
ihomogeneity = p11
kgain = 1.25
iHz = cpsmidinn(ikey)
kHz = k(iHz)
iattack = (440.0 / iHz) * 0.01
print iHz, iattack
isustain = p3
irelease = .3
p3 = iattack + isustain + irelease
iduration = p3
iamplitude = ampdb(ivelocity) * 8.
isine ftgenonce 0, 0, 65536, 10, 1
kfreq = cpsmidinn(ikey)
iamp = 1
inorm = 32310
aamp1 linseg 0,.001,5200,.001,800,.001,3000,.0025,1100,.002,2800,.0015,1500,.001,2100,.011,1600,.03,1400,.95,700,1,320,1,180,1,90,1,40,1,20,1,12,1,6,1,3,1,0,1,0
adevamp1 linseg 0, .05, .3, iduration - .05, 0
adev1 poscil adevamp1, 6.7, isine, .8
amp1 = aamp1 * (1 + adev1)
aamp2 linseg 0,.0009,22000,.0005,7300,.0009,11000,.0004,5500,.0006,15000,.0004,5500,.0008,2200,.055,7300,.02,8500,.38,5000,.5,300,.5,73,.5,5.,5,0,1,1
adevamp2 linseg 0,.12,.5,iduration-.12,0
adev2 poscil adevamp2, 10.5, isine, 0
amp2 = aamp2 * (1 + adev2)
aamp3 linseg 0,.001,3000,.001,1000,.0017,12000,.0013,3700,.001,12500,.0018,3000,.0012,1200,.001,1400,.0017,6000,.0023,200,.001,3000,.001,1200,.0015,8000,.001,1800,.0015,6000,.08,1200,.2,200,.2,40,.2,10,.4,0,1,0
adevamp3 linseg 0, .02, .8, iduration - .02, 0
adev3 poscil adevamp3, 70, isine ,0
amp3 = aamp3 * (1 + adev3)
awt1 poscil amp1, kfreq, isine
awt2 poscil amp2, 2.7 * kfreq, isine
awt3 poscil amp3, 4.95 * kfreq, isine
asig = awt1 + awt2 + awt3
arel linenr 1,0, iduration, .06
; asignal = asig * arel * (iamp / inorm) * iamplitude * kgain
asignal = asig * (iamp / inorm) * iamplitude * kgain
adeclick linsegr 0, iattack, 1, isustain, 1, irelease, 0
asignal = asignal
aoutleft, aoutright pan2 asignal * adeclick, .875;ipan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Xing i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr ZakianFlute
//////////////////////////////////////////////
// Original by Lee Zakian.
// Adapted by Michael Gogins.
//////////////////////////////////////////////
if1 ftgenonce 0, 0, 65536, 10, 1
iwtsin init if1
if2 ftgenonce 0, 0, 16, -2, 40, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 10240
if26 ftgenonce 0, 0, 65536, -10, 2000, 489, 74, 219, 125, 9, 33, 5, 5
if27 ftgenonce 0, 0, 65536, -10, 2729, 1926, 346, 662, 537, 110, 61, 29, 7
if28 ftgenonce 0, 0, 65536, -10, 2558, 2012, 390, 361, 534, 139, 53, 22, 10, 13, 10
if29 ftgenonce 0, 0, 65536, -10, 12318, 8844, 1841, 1636, 256, 150, 60, 46, 11
if30 ftgenonce 0, 0, 65536, -10, 1229, 16, 34, 57, 32
if31 ftgenonce 0, 0, 65536, -10, 163, 31, 1, 50, 31
if32 ftgenonce 0, 0, 65536, -10, 4128, 883, 354, 79, 59, 23
if33 ftgenonce 0, 0, 65536, -10, 1924, 930, 251, 50, 25, 14
if34 ftgenonce 0, 0, 65536, -10, 94, 6, 22, 8
if35 ftgenonce 0, 0, 65536, -10, 2661, 87, 33, 18
if36 ftgenonce 0, 0, 65536, -10, 174, 12
if37 ftgenonce 0, 0, 65536, -10, 314, 13
i_instrument = p1
i_time = p2
i_duration = p3
i_midikey = p4
i_midivelocity = p5
i_phase = p6
i_pan = p7
i_depth = p8
i_height = p9
i_pitchclassset = p10
i_homogeneity = p11
ifrequency = cpsmidinn(i_midikey)
iamplitude = ampdb(i_midivelocity) * 4
iattack = .25
isustain = p3
irelease = .33333333
p3 = iattack + isustain + irelease
iHz = ifrequency
kHz = k(iHz)
idB = i_midivelocity
adeclick77 linsegr 0, iattack, 1, isustain, 1, irelease, 0
ip3 = (p3 < 3.0 ? p3 : 3.0)
; parameters
; p4 overall amplitude scaling factor
ip4 init iamplitude
; p5 pitch in Hertz (normal pitch range: C4-C7)
ip5 init iHz
; p6 percent vibrato depth, recommended values in range [-1., +1.]
ip6 init 1
; 0.0 -> no vibrato
; +1. -> 1% vibrato depth, where vibrato rate increases slightly
; -1. -> 1% vibrato depth, where vibrato rate decreases slightly
; p7 attack time in seconds
; recommended value: .12 for slurred notes, .06 for tongued notes
; (.03 for short notes)
ip7 init .08
; p8 decay time in seconds
; recommended value: .1 (.05 for short notes)
ip8 init .08
; p9 overall brightness / filter cutoff factor
; 1 -> least bright / minimum filter cutoff frequency (40 Hz)
; 9 -> brightest / maximum filter cutoff frequency (10,240Hz)
ip9 init 5
; initial variables
iampscale = ip4 ; overall amplitude scaling factor
ifreq = ip5 ; pitch in Hertz
ivibdepth = abs(ip6*ifreq/100.0) ; vibrato depth relative to fundamental frequency
iattack = ip7 * (1.1 - .2*giseed) ; attack time with up to +-10% random deviation
giseed = frac(giseed*105.947) ; reset giseed
idecay = ip8 * (1.1 - .2*giseed) ; decay time with up to +-10% random deviation
giseed = frac(giseed*105.947)
ifiltcut tablei ip9, if2 ; lowpass filter cutoff frequency
iattack = (iattack < 6/kr ? 6/kr : iattack) ; minimal attack length
idecay = (idecay < 6/kr ? 6/kr : idecay) ; minimal decay length
isustain = p3 - iattack - idecay
p3 = (isustain < 5/kr ? iattack+idecay+5/kr : p3) ; minimal sustain length
isustain = (isustain < 5/kr ? 5/kr : isustain)
iatt = iattack/6
isus = isustain/4
idec = idecay/6
iphase = giseed ; use same phase for all wavetables
giseed = frac(giseed*105.947)
; vibrato block
; kvibdepth linseg .1, .8*p3, 1, .2*p3, .7
kvibdepth linseg .1, .8*ip3, 1, isustain, 1, .2*ip3, .7
kvibdepth = kvibdepth* ivibdepth ; vibrato depth
kvibdepthr randi .1*kvibdepth, 5, giseed ; up to 10% vibrato depth variation
giseed = frac(giseed*105.947)
kvibdepth = kvibdepth + kvibdepthr
ivibr1 = giseed ; vibrato rate
giseed = frac(giseed*105.947)
ivibr2 = giseed
giseed = frac(giseed*105.947)
if ip6 < 0 goto vibrato1
kvibrate linseg 2.5+ivibr1, p3, 4.5+ivibr2 ; if p6 positive vibrato gets faster
goto vibrato2
vibrato1:
ivibr3 = giseed
giseed = frac(giseed*105.947)
kvibrate linseg 3.5+ivibr1, .1, 4.5+ivibr2, p3-.1, 2.5+ivibr3 ; if p6 negative vibrato gets slower
vibrato2:
kvibrater randi .1*kvibrate, 5, giseed ; up to 10% vibrato rate variation
giseed = frac(giseed*105.947)
kvibrate = kvibrate + kvibrater
kvib oscili kvibdepth, kvibrate, iwtsin
ifdev1 = -.03 * giseed ; frequency deviation
giseed = frac(giseed*105.947)
ifdev2 = .003 * giseed
giseed = frac(giseed*105.947)
ifdev3 = -.0015 * giseed
giseed = frac(giseed*105.947)
ifdev4 = .012 * giseed
giseed = frac(giseed*105.947)
kfreqr linseg ifdev1, iattack, ifdev2, isustain, ifdev3, idecay, ifdev4
kfreq = kHz * (1 + kfreqr) + kvib
if ifreq < 427.28 goto range1 ; (cpspch(8.08) + cpspch(8.09))/2
if ifreq < 608.22 goto range2 ; (cpspch(9.02) + cpspch(9.03))/2
if ifreq < 1013.7 goto range3 ; (cpspch(9.11) + cpspch(10.00))/2
goto range4
; wavetable amplitude envelopes
range1: ; for low range tones
kamp1 linseg 0, iatt, 0.002, iatt, 0.045, iatt, 0.146, iatt, \
0.272, iatt, 0.072, iatt, 0.043, isus, 0.230, isus, 0.000, isus, \
0.118, isus, 0.923, idec, 1.191, idec, 0.794, idec, 0.418, idec, \
0.172, idec, 0.053, idec, 0
kamp2 linseg 0, iatt, 0.009, iatt, 0.022, iatt, -0.049, iatt, \
-0.120, iatt, 0.297, iatt, 1.890, isus, 1.543, isus, 0.000, isus, \
0.546, isus, 0.690, idec, -0.318, idec, -0.326, idec, -0.116, idec, \
-0.035, idec, -0.020, idec, 0
kamp3 linseg 0, iatt, 0.005, iatt, -0.026, iatt, 0.023, iatt, \
0.133, iatt, 0.060, iatt, -1.245, isus, -0.760, isus, 1.000, isus, \
0.360, isus, -0.526, idec, 0.165, idec, 0.184, idec, 0.060, idec, \
0.010, idec, 0.013, idec, 0
iwt1 = if26 ; wavetable numbers
iwt2 = if27
iwt3 = if28
inorm = 3949
goto end
range2: ; for low mid-range tones
kamp1 linseg 0, iatt, 0.000, iatt, -0.005, iatt, 0.000, iatt, \
0.030, iatt, 0.198, iatt, 0.664, isus, 1.451, isus, 1.782, isus, \
1.316, isus, 0.817, idec, 0.284, idec, 0.171, idec, 0.082, idec, \
0.037, idec, 0.012, idec, 0
kamp2 linseg 0, iatt, 0.000, iatt, 0.320, iatt, 0.882, iatt, \
1.863, iatt, 4.175, iatt, 4.355, isus, -5.329, isus, -8.303, isus, \
-1.480, isus, -0.472, idec, 1.819, idec, -0.135, idec, -0.082, idec, \
-0.170, idec, -0.065, idec, 0
kamp3 linseg 0, iatt, 1.000, iatt, 0.520, iatt, -0.303, iatt, \
0.059, iatt, -4.103, iatt, -6.784, isus, 7.006, isus, 11, isus, \
12.495, isus, -0.562, idec, -4.946, idec, -0.587, idec, 0.440, idec, \
0.174, idec, -0.027, idec, 0
iwt1 = if29
iwt2 = if30
iwt3 = if31
inorm = 27668.2
goto end
range3: ; for high mid-range tones
kamp1 linseg 0, iatt, 0.005, iatt, 0.000, iatt, -0.082, iatt, \
0.36, iatt, 0.581, iatt, 0.416, isus, 1.073, isus, 0.000, isus, \
0.356, isus, .86, idec, 0.532, idec, 0.162, idec, 0.076, idec, 0.064, \
idec, 0.031, idec, 0
kamp2 linseg 0, iatt, -0.005, iatt, 0.000, iatt, 0.205, iatt, \
-0.284, iatt, -0.208, iatt, 0.326, isus, -0.401, isus, 1.540, isus, \
0.589, isus, -0.486, idec, -0.016, idec, 0.141, idec, 0.105, idec, \
-0.003, idec, -0.023, idec, 0
kamp3 linseg 0, iatt, 0.722, iatt, 1.500, iatt, 3.697, iatt, \
0.080, iatt, -2.327, iatt, -0.684, isus, -2.638, isus, 0.000, isus, \
1.347, isus, 0.485, idec, -0.419, idec, -.700, idec, -0.278, idec, \
0.167, idec, -0.059, idec, 0
iwt1 = if32
iwt2 = if33
iwt3 = if34
inorm = 3775
goto end
range4: ; for high range tones
kamp1 linseg 0, iatt, 0.000, iatt, 0.000, iatt, 0.211, iatt, \
0.526, iatt, 0.989, iatt, 1.216, isus, 1.727, isus, 1.881, isus, \
1.462, isus, 1.28, idec, 0.75, idec, 0.34, idec, 0.154, idec, 0.122, \
idec, 0.028, idec, 0
kamp2 linseg 0, iatt, 0.500, iatt, 0.000, iatt, 0.181, iatt, \
0.859, iatt, -0.205, iatt, -0.430, isus, -0.725, isus, -0.544, isus, \
-0.436, isus, -0.109, idec, -0.03, idec, -0.022, idec, -0.046, idec, \
-0.071, idec, -0.019, idec, 0
kamp3 linseg 0, iatt, 0.000, iatt, 1.000, iatt, 0.426, iatt, \
0.222, iatt, 0.175, iatt, -0.153, isus, 0.355, isus, 0.175, isus, \
0.16, isus, -0.246, idec, -0.045, idec, -0.072, idec, 0.057, idec, \
-0.024, idec, 0.002, idec, 0
iwt1 = if35
iwt2 = if36
iwt3 = if37
inorm = 4909.05
goto end
end:
kampr1 randi .02*kamp1, 10, giseed ; up to 2% wavetable amplitude variation
giseed = frac(giseed*105.947)
kamp1 = kamp1 + kampr1
kampr2 randi .02*kamp2, 10, giseed ; up to 2% wavetable amplitude variation
giseed = frac(giseed*105.947)
kamp2 = kamp2 + kampr2
kampr3 randi .02*kamp3, 10, giseed ; up to 2% wavetable amplitude variation
giseed = frac(giseed*105.947)
kamp3 = kamp3 + kampr3
awt1 poscil kamp1, kfreq, iwt1, iphase ; wavetable lookup
awt2 poscil kamp2, kfreq, iwt2, iphase
awt3 poscil kamp3, kfreq, iwt3, iphase
asig = awt1 + awt2 + awt3
asig = asig*(iampscale/inorm)
kcut linseg 0, iattack, ifiltcut, isustain, ifiltcut, idecay, 0 ; lowpass filter for brightness control
afilt tone asig, kcut
asignal balance afilt, asig
iattack = 0.005
isustain = p3
irelease = 0.06
p3 = isustain + iattack + irelease
adeclick linsegr 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
aoutleft, aoutright pan2 asignal * adeclick, i_pan
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "ZakianFlute i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
//////////////////////////////////////////////
// OUTPUT INSTRUMENTS MUST GO BELOW HERE
//////////////////////////////////////////////
instr Reverberation
//////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////
ainleft inleta "inleft"
ainright inleta "inright"
if (gkReverberationEnabled == 0) goto reverberation_if_label
goto reverberation_else_label
reverberation_if_label:
aoutleft = ainleft
aoutright = ainright
kdry = 1.0 - gkReverberationWet
goto reverberation_endif_label
reverberation_else_label:
awetleft, awetright reverbsc ainleft, ainright, gkReverberationDelay, 18000.0
aoutleft = ainleft * kdry + awetleft * gkReverberationWet
aoutright = ainright * kdry + awetright * gkReverberationWet
reverberation_endif_label:
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Reverberation i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr Compressor
//////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////
ainleft inleta "inleft"
ainright inleta "inright"
if (gkCompressorEnabled == 0) goto compressor_if_label
goto compressor_else_label
compressor_if_label:
aoutleft = ainleft
aoutright = ainright
goto compressor_endif_label
compressor_else_label:
aoutleft compress ainleft, ainleft, gkCompressorThreshold, 100 * gkCompressorLowKnee, 100 * gkCompressorHighKnee, 100 * gkCompressorRatio, gkCompressorAttack, gkCompressorRelease, .05
aoutright compress ainright, ainright, gkCompressorThreshold, 100 * gkCompressorLowKnee, 100 * gkCompressorHighKnee, 100 * gkCompressorRatio, gkCompressorAttack, gkCompressorRelease, .05
compressor_endif_label:
outleta "outleft", aoutleft
outleta "outright", aoutright
prints "Compressor i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
instr MasterOutput
//////////////////////////////////////////////
// By Michael Gogins.
//////////////////////////////////////////////
ainleft inleta "inleft"
ainright inleta "inright"
aoutleft = gkMasterLevel * ainleft
aoutright = gkMasterLevel * ainright
outs aoutleft, aoutright
prints "MasterOutput i %9.4f t %9.4f d %9.4f k %9.4f v %9.4f p %9.4f #%3d\n", p1, p2, p3, p4, p5, p7, active(p1)
endin
qqq)
| 102,728 | Common Lisp | .lisp | 2,989 | 33.328873 | 333 | 0.684193 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | db1abcfd17c6e8e29c7c5550e0881e974657e0162275f716014f953ce81cab0e | 15,876 | [
-1
] |
15,877 | designs.lisp | gogins_csound-extended-nudruz/sources/designs.lisp | (in-package :cm)
;; DESIGNS.LISP -- various routines & block designs (as lists of lists)
;; DESIGNREM -- utility for working with designs
;; takes list & returns remainders of
;; all members of design containing list
;; added June 2005
(defun designrem (alist adesign)
(let ((rawlist
(no-nils
(loop for x in adesign collect
(if (list-eql alist (intersection x alist))
(set-difference x alist))))))
(if (eql (length rawlist) 1) (flatten rawlist) rawlist)))
;; DESIGNLINE -- makes 'countervector' based on list & design
;; selects randomly when multiple choices exist
;; added June 2005
(defun designline (inline adesign)
(let ((melody (loop for x in inline collect
(if (listp x) x (list x)))))
(loop for x in melody collect
(let ((xrem (designrem x adesign)))
(if (tree-equal xrem (flatten xrem)) xrem (pickl xrem))))))
;; projective planes (all vectors share only one element)
; gap> D := PGPointFlatBlockDesign(221);; D.blocks; BlockNumbers(D);
; size 7
; MKG: defparameter for define
(defparameter pplane3
'( ( 1 2 3 ) ( 1 4 5 ) ( 1 6 7 ) ( 2 4 6 ) ( 2 5 7 )
( 3 4 7 ) ( 3 5 6 ) ))
; gap> D := PGPointFlatBlockDesign(231);; D.blocks; BlockNumbers(D);
; size 13
; MKG: defparameter for define
(defparameter pplane4
'( ( 1 2 3 4 ) ( 1 5 6 7 ) ( 1 8 9 10 ) ( 1 11 12 13 )
( 2 5 8 11 ) ( 2 6 9 12 ) ( 2 7 10 13 ) ( 3 5 9 13 )
( 3 6 10 11 ) ( 3 7 8 12 ) ( 4 5 10 12 ) ( 4 6 8 13 )
( 4 7 9 11 ) ))
;; CONTOURS3 -- ternary contours (13 total)
;; added June 2005
;; can use with pplane4 and 'contour-chain' function
; MKG: defparameter for define
(defparameter contours3
'((0 1 2) (0 1 1) (0 1 0) (0 2 1) (1 2 0)
(0 0 1) (0 0 0) (2 1 0) (1 0 0)
(1 0 1) (2 0 1) (1 0 2) (1 1 0)))
;; NOTE: ALL PPLANE4 CONTOURS have length 9, max height 7
;; 312 contours total (including permutations)
;; added June 2005
; MKG: defparameter for define
(defparameter pp4contours
'((0 1 2 3 3 4 3 5 4) (0 1 2 3 3 5 4 5 4) (0 1 2 3 2 3 3 5 4)
(0 1 2 3 2 4 3 4 4) (0 1 2 4 3 4 4 5 4) (0 1 2 4 3 4 3 4 4)
(0 1 1 2 3 4 3 5 4) (0 1 1 2 3 5 4 5 4) (0 1 1 2 1 2 3 5 4)
(0 1 1 2 1 3 2 3 4) (0 1 1 3 2 3 4 5 4) (0 1 1 3 2 3 2 3 4)
(0 1 0 1 2 3 3 5 4) (0 1 0 1 2 4 3 4 4) (0 1 0 1 1 2 3 5 4)
(0 1 0 1 1 3 2 3 4) (0 1 0 2 1 2 3 4 4) (0 1 0 2 1 2 2 3 4)
(0 2 1 2 3 4 4 5 4) (0 2 1 2 3 4 3 4 4) (0 2 1 2 2 3 4 5 4)
(0 2 1 2 2 3 2 3 4) (0 2 1 2 1 2 3 4 4) (0 2 1 2 1 2 2 3 4)
(0 1 2 3 1 1 2 2 2) (0 1 2 3 1 1 1 1 2) (0 1 2 2 3 4 2 2 2)
(0 1 2 2 3 3 3 4 2) (0 1 2 2 2 3 1 1 2) (0 1 2 2 2 2 3 4 2)
(1 2 0 1 2 2 3 3 3) (1 2 0 1 2 2 2 2 3) (1 2 0 0 1 2 3 3 3)
(1 2 0 0 1 1 1 2 3) (1 2 0 0 0 1 2 2 3) (1 2 0 0 0 0 1 2 3)
(0 0 1 2 3 4 2 2 2) (0 0 1 2 3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1 1 3 2 0 1)
(3 2 2 2 2 0 1 3 2) (3 2 2 0 1 3 2 2 2) (3 2 2 0 1 1 1 3 2)
(2 0 1 3 2 2 2 1 1) (2 0 1 3 2 1 1 1 1) (2 0 1 1 1 3 2 1 1)
(2 0 1 1 1 0 0 2 1) (2 0 1 0 0 2 1 1 1) (2 0 1 0 0 0 0 2 1)))
; gap> D := PGPointFlatBlockDesign(241);; D.blocks; BlockNumbers(D);
; size 21
(defparameter pplane5
'( ( 1 2 3 4 5 ) ( 1 6 7 8 9 ) ( 1 10 11 12 13 )
( 1 14 15 16 17 ) ( 1 18 19 20 21 ) ( 2 6 10 14 18 )
( 2 7 11 15 19 ) ( 2 8 12 16 20 ) ( 2 9 13 17 21 )
( 3 6 11 16 21 ) ( 3 7 10 17 20 ) ( 3 8 13 14 19 )
( 3 9 12 15 18 ) ( 4 6 12 17 19 ) ( 4 7 13 16 18 )
( 4 8 10 15 21 ) ( 4 9 11 14 20 ) ( 5 6 13 15 20 )
( 5 7 12 14 21 ) ( 5 8 11 17 18 ) ( 5 9 10 16 19 ) ))
;; MODE7-DYADS unordered dyads mod 7 (21 total)
;; can be used with pplane5
(defparameter mode7-dyads
'((5 6) (4 6) (4 5) (3 6) (3 5) (3 4) (2 6)
(2 5) (2 4) (2 3) (1 6) (1 5) (1 4)
(1 3) (1 2) (0 6) (0 5) (0 4) (0 3) (0 2) (0 1)))
; gap> D := PGPointFlatBlockDesign(251);; D.blocks; BlockNumbers(D);
; size 31
(defparameter pplane6
'( ( 1 2 3 4 5 6 ) ( 1 7 8 9 10 11 ) ( 1 12 13 14 15 16 )
( 1 17 18 19 20 21 ) ( 1 22 23 24 25 26 )
( 1 27 28 29 30 31 ) ( 2 7 12 17 22 27 )
( 2 8 13 18 23 28 ) ( 2 9 14 19 24 29 )
( 2 10 15 20 25 30 ) ( 2 11 16 21 26 31 )
( 3 7 13 19 25 31 ) ( 3 8 14 21 22 30 )
( 3 9 16 20 23 27 ) ( 3 10 12 18 26 29 )
( 3 11 15 17 24 28 ) ( 4 7 14 20 26 28 )
( 4 8 16 17 25 29 ) ( 4 9 15 18 22 31 )
( 4 10 13 21 24 27 ) ( 4 11 12 19 23 30 )
( 5 7 15 21 23 29 ) ( 5 8 12 20 24 31 )
( 5 9 13 17 26 30 ) ( 5 10 16 19 22 28 )
( 5 11 14 18 25 27 ) ( 6 7 16 18 24 30 )
( 6 8 15 19 26 27 ) ( 6 9 12 21 25 28 )
( 6 10 14 17 23 31 ) ( 6 11 13 20 22 29 ) ))
; gap> D := PGPointFlatBlockDesign(271);; D.blocks; BlockNumbers(D);
; size 57
(defparameter pplane8
'( ( 1 2 3 4 5 6 7 8 ) ( 1 9 10 11 12 13 14 15 )
( 1 16 17 18 19 20 21 22 ) ( 1 23 24 25 26 27 28 29 )
( 1 30 31 32 33 34 35 36 ) ( 1 37 38 39 40 41 42 43 )
( 1 44 45 46 47 48 49 50 ) ( 1 51 52 53 54 55 56 57 )
( 2 9 16 23 30 37 44 51 ) ( 2 10 17 24 31 38 45 52 )
( 2 11 18 25 32 39 46 53 ) ( 2 12 19 26 33 40 47 54 )
( 2 13 20 27 34 41 48 55 ) ( 2 14 21 28 35 42 49 56 )
( 2 15 22 29 36 43 50 57 ) ( 3 9 17 25 33 41 49 57 )
( 3 10 19 28 32 37 50 55 ) ( 3 11 21 27 36 40 44 52 )
( 3 12 18 29 35 38 48 51 ) ( 3 13 16 26 31 43 46 56 )
( 3 14 22 23 34 39 45 54 ) ( 3 15 20 24 30 42 47 53 )
( 4 9 18 26 34 42 50 52 ) ( 4 10 21 25 30 43 48 54 )
( 4 11 20 29 33 37 45 56 ) ( 4 12 22 28 31 41 44 53 )
( 4 13 19 24 36 39 49 51 ) ( 4 14 16 27 32 38 47 57 )
( 4 15 17 23 35 40 46 55 ) ( 5 9 19 27 35 43 45 53 )
( 5 10 18 23 36 41 47 56 ) ( 5 11 22 26 30 38 49 55 )
( 5 12 21 24 34 37 46 57 ) ( 5 13 17 29 32 42 44 54 )
( 5 14 20 25 31 40 50 51 ) ( 5 15 16 28 33 39 48 52 )
( 6 9 20 28 36 38 46 54 ) ( 6 10 16 29 34 40 49 53 )
( 6 11 19 23 31 42 48 57 ) ( 6 12 17 27 30 39 50 56 )
( 6 13 22 25 35 37 47 52 ) ( 6 14 18 24 33 43 44 55 )
( 6 15 21 26 32 41 45 51 ) ( 7 9 21 29 31 39 47 55 )
( 7 10 22 27 33 42 46 51 ) ( 7 11 16 24 35 41 50 54 )
( 7 12 20 23 32 43 49 52 ) ( 7 13 18 28 30 40 45 57 )
( 7 14 17 26 36 37 48 53 ) ( 7 15 19 25 34 38 44 56 )
( 8 9 22 24 32 40 48 56 ) ( 8 10 20 26 35 39 44 57 )
( 8 11 17 28 34 43 47 51 ) ( 8 12 16 25 36 42 45 55 )
( 8 13 21 23 33 38 50 53 ) ( 8 14 19 29 30 41 46 52 )
( 8 15 18 27 31 37 49 54 ) ))
; gap> D := PGPointFlatBlockDesign(281);; D.blocks; BlockNumbers(D);
; size 73
(defparameter pplane9
'( ( 1 2 3 4 5 6 7 8 9 ) ( 1 10 11 12 13 14 15 16 17 )
( 1 18 19 20 21 22 23 24 25 ) ( 1 26 27 28 29 30 31 32 33 )
( 1 34 35 36 37 38 39 40 41 )
( 1 42 43 44 45 46 47 48 49 ) ( 1 50 51 52 53 54 55 56 57 )
( 1 58 59 60 61 62 63 64 65 )
( 1 66 67 68 69 70 71 72 73 ) ( 2 10 18 26 34 42 50 58 66 )
( 2 11 19 27 35 43 51 59 67 )
( 2 12 20 28 36 44 52 60 68 ) ( 2 13 21 29 37 45 53 61 69 )
( 2 14 22 30 38 46 54 62 70 )
( 2 15 23 31 39 47 55 63 71 ) ( 2 16 24 32 40 48 56 64 72 )
( 2 17 25 33 41 49 57 65 73 )
( 3 10 19 28 37 46 55 64 73 ) ( 3 11 18 30 41 44 56 63 69 )
( 3 12 22 26 39 43 53 65 72 )
( 3 13 25 31 34 48 52 62 67 ) ( 3 14 20 27 40 42 57 61 71 )
( 3 15 24 29 36 49 50 59 70 )
( 3 16 23 33 38 45 51 58 68 ) ( 3 17 21 32 35 47 54 60 66 )
( 4 10 20 29 38 47 56 65 67 )
( 4 11 22 33 36 48 55 61 66 ) ( 4 12 18 31 35 45 57 64 70 )
( 4 13 23 26 40 44 54 59 73 )
( 4 14 19 32 34 49 53 63 68 ) ( 4 15 21 28 41 42 51 62 72 )
( 4 16 25 30 37 43 50 60 71 )
( 4 17 24 27 39 46 52 58 69 ) ( 5 10 21 30 39 48 57 59 68 )
( 5 11 25 28 40 47 53 58 70 )
( 5 12 23 27 37 49 56 62 66 ) ( 5 13 18 32 36 46 51 65 71 )
( 5 14 24 26 41 45 55 60 67 )
( 5 15 20 33 34 43 54 64 69 ) ( 5 16 22 29 35 42 52 63 73 )
( 5 17 19 31 38 44 50 61 72 )
( 6 10 22 31 40 49 51 60 69 ) ( 6 11 20 32 39 45 50 62 73 )
( 6 12 19 29 41 48 54 58 71 )
( 6 13 24 28 38 43 57 63 66 ) ( 6 14 18 33 37 47 52 59 72 )
( 6 15 25 26 35 46 56 61 68 )
( 6 16 21 27 34 44 55 65 70 ) ( 6 17 23 30 36 42 53 64 67 )
( 7 10 23 32 41 43 52 61 70 )
( 7 11 24 31 37 42 54 65 68 ) ( 7 12 21 33 40 46 50 63 67 )
( 7 13 20 30 35 49 55 58 72 )
( 7 14 25 29 39 44 51 64 66 ) ( 7 15 18 27 38 48 53 60 73 )
( 7 16 19 26 36 47 57 62 69 )
( 7 17 22 28 34 45 56 59 71 ) ( 8 10 24 33 35 44 53 62 71 )
( 8 11 23 29 34 46 57 60 72 )
( 8 12 25 32 38 42 55 59 69 ) ( 8 13 22 27 41 47 50 64 68 )
( 8 14 21 31 36 43 56 58 73 )
( 8 15 19 30 40 45 52 65 66 ) ( 8 16 18 28 39 49 54 61 67 )
( 8 17 20 26 37 48 51 63 70 )
( 9 10 25 27 36 45 54 63 72 ) ( 9 11 21 26 38 49 52 64 71 )
( 9 12 24 30 34 47 51 61 73 )
( 9 13 19 33 39 42 56 60 70 ) ( 9 14 23 28 35 48 50 65 69 )
( 9 15 22 32 37 44 57 58 67 )
( 9 16 20 31 41 46 53 59 66 )
( 9 17 18 29 40 43 55 62 68 ) ))
; gap> D := PGPointFlatBlockDesign(291);; D.blocks; BlockNumbers(D);
; size 91
(defparameter pplane10
'( ( 1 2 3 4 5 6 7 8 9 10 ) ( 1 11 12 13 14 15 16 17 18 19 )
( 1 20 21 22 23 24 25 26 27 28 )
( 1 29 30 31 32 33 34 35 36 37 )
( 1 38 39 40 41 42 43 44 45 46 )
( 1 47 48 49 50 51 52 53 54 55 )
( 1 56 57 58 59 60 61 62 63 64 )
( 1 65 66 67 68 69 70 71 72 73 )
( 1 74 75 76 77 78 79 80 81 82 )
( 1 83 84 85 86 87 88 89 90 91 )
( 2 11 20 29 38 47 56 65 74 83 )
( 2 12 21 30 39 48 57 66 75 84 )
( 2 13 22 31 40 49 58 67 76 85 )
( 2 14 23 32 41 50 59 68 77 86 )
( 2 15 24 33 42 51 60 69 78 87 )
( 2 16 25 34 43 52 61 70 79 88 )
( 2 17 26 35 44 53 62 71 80 89 )
( 2 18 27 36 45 54 63 72 81 90 )
( 2 19 28 37 46 55 64 73 82 91 )
( 3 11 21 31 41 51 61 71 81 91 )
( 3 12 22 29 42 55 63 70 80 86 )
( 3 13 20 30 46 50 62 72 79 87 )
( 3 14 24 37 44 52 57 65 76 90 )
( 3 15 28 32 43 54 58 66 74 89 )
( 3 16 27 35 39 49 64 69 77 83 )
( 3 17 25 36 38 48 60 68 82 85 )
( 3 18 26 34 40 47 59 73 78 84 )
( 3 19 23 33 45 53 56 67 75 88 )
( 4 11 22 30 44 54 64 68 78 88 )
( 4 12 20 31 43 53 59 69 82 90 )
( 4 13 21 29 45 52 60 73 77 89 )
( 4 14 28 33 38 49 63 71 79 84 )
( 4 15 23 37 39 47 62 70 81 85 )
( 4 16 26 36 42 50 56 66 76 91 )
( 4 17 27 34 41 55 58 65 75 87 )
( 4 18 25 35 46 51 57 67 74 86 )
( 4 19 24 32 40 48 61 72 80 83 )
( 5 11 23 35 42 52 58 72 82 84 )
( 5 12 24 34 46 54 56 71 77 85 )
( 5 13 28 36 41 53 57 70 78 83 )
( 5 14 26 29 43 48 64 67 81 87 )
( 5 15 25 30 45 49 59 65 80 91 )
( 5 16 21 33 40 55 62 68 74 90 )
( 5 17 20 32 39 51 63 73 76 88 )
( 5 18 22 37 38 50 61 69 75 89 )
( 5 19 27 31 44 47 60 66 79 86 )
( 6 11 24 36 43 49 62 73 75 86 )
( 6 12 28 35 45 47 61 68 76 87 )
( 6 13 23 34 44 48 63 69 74 91 )
( 6 14 25 31 39 55 56 72 78 89 )
( 6 15 27 29 40 50 57 71 82 88 )
( 6 16 22 32 46 53 60 65 81 84 )
( 6 17 21 37 42 54 59 67 79 83 )
( 6 18 20 33 41 52 64 66 80 85 )
( 6 19 26 30 38 51 58 70 77 90 )
( 7 11 25 37 40 53 63 66 77 87 )
( 7 12 27 32 38 52 62 67 78 91 )
( 7 13 26 33 39 54 61 65 82 86 )
( 7 14 21 36 46 47 58 69 80 88 )
( 7 15 22 35 41 48 56 73 79 90 )
( 7 16 28 29 44 51 59 72 75 85 )
( 7 17 24 31 45 50 64 70 74 84 )
( 7 18 23 30 43 55 60 71 76 83 )
( 7 19 20 34 42 49 57 68 81 89 )
( 8 11 26 32 45 55 57 69 79 85 )
( 8 12 25 33 44 50 58 73 81 83 )
( 8 13 27 37 43 51 56 68 80 84 )
( 8 14 20 35 40 54 60 70 75 91 )
( 8 15 21 34 38 53 64 72 76 86 )
( 8 16 24 30 41 47 63 67 82 89 )
( 8 17 23 29 46 49 61 66 78 90 )
( 8 18 28 31 42 48 62 65 77 88 )
( 8 19 22 36 39 52 59 71 74 87 )
( 9 11 27 33 46 48 59 70 76 89 )
( 9 12 26 37 41 49 60 72 74 88 )
( 9 13 25 32 42 47 64 71 75 90 )
( 9 14 22 34 45 51 62 66 82 83 )
( 9 15 20 36 44 55 61 67 77 84 )
( 9 16 23 31 38 54 57 73 80 87 )
( 9 17 28 30 40 52 56 69 81 86 )
( 9 18 24 29 39 53 58 68 79 91 )
( 9 19 21 35 43 50 63 65 78 85 )
( 10 11 28 34 39 50 60 67 80 90 )
( 10 12 23 36 40 51 64 65 79 89 )
( 10 13 24 35 38 55 59 66 81 88 )
( 10 14 27 30 42 53 61 73 74 85 )
( 10 15 26 31 46 52 63 68 75 83 )
( 10 16 20 37 45 48 58 71 78 86 )
( 10 17 22 33 43 47 57 72 77 91 )
( 10 18 21 32 44 49 56 70 82 87 )
( 10 19 25 29 41 54 62 69 76 84 ) ))
; gap> D := PGPointFlatBlockDesign(2111);; D.blocks; BlockNumbers(D);
; size 133
(defparameter pplane12
'( ( 1 2 3 4 5 6 7 8 9 10 11 12 )
( 1 13 14 15 16 17 18 19 20 21 22 23 )
( 1 24 25 26 27 28 29 30 31 32 33 34 )
( 1 35 36 37 38 39 40 41 42 43 44 45 )
( 1 46 47 48 49 50 51 52 53 54 55 56 )
( 1 57 58 59 60 61 62 63 64 65 66 67 )
( 1 68 69 70 71 72 73 74 75 76 77 78 )
( 1 79 80 81 82 83 84 85 86 87 88 89 )
( 1 90 91 92 93 94 95 96 97 98 99 100 )
( 1 101 102 103 104 105 106 107 108 109 110 111 )
( 1 112 113 114 115 116 117 118 119 120 121 122 )
( 1 123 124 125 126 127 128 129 130 131 132 133 )
( 2 13 24 35 46 57 68 79 90 101 112 123 )
( 2 14 25 36 47 58 69 80 91 102 113 124 )
( 2 15 26 37 48 59 70 81 92 103 114 125 )
( 2 16 27 38 49 60 71 82 93 104 115 126 )
( 2 17 28 39 50 61 72 83 94 105 116 127 )
( 2 18 29 40 51 62 73 84 95 106 117 128 )
( 2 19 30 41 52 63 74 85 96 107 118 129 )
( 2 20 31 42 53 64 75 86 97 108 119 130 )
( 2 21 32 43 54 65 76 87 98 109 120 131 )
( 2 22 33 44 55 66 77 88 99 110 121 132 )
( 2 23 34 45 56 67 78 89 100 111 122 133 )
( 3 13 25 37 49 61 73 85 97 109 121 133 )
( 3 14 26 44 51 64 78 79 96 105 115 131 )
( 3 15 33 38 56 63 76 80 90 108 117 127 )
( 3 16 29 45 50 58 75 88 92 101 120 129 )
( 3 17 31 41 47 62 70 87 100 104 112 132 )
( 3 18 34 43 53 59 74 82 99 102 116 123 )
( 3 19 24 36 55 65 71 86 94 111 114 128 )
( 3 20 30 35 48 67 77 83 98 106 113 126 )
( 3 21 28 42 46 60 69 89 95 110 118 125 )
( 3 22 27 40 54 57 72 81 91 107 122 130 )
( 3 23 32 39 52 66 68 84 93 103 119 124 )
( 4 13 26 38 50 62 74 86 98 110 122 124 )
( 4 14 33 40 53 67 68 85 94 104 120 125 )
( 4 15 27 45 52 65 69 79 97 106 116 132 )
( 4 16 34 39 47 64 77 81 90 109 118 128 )
( 4 17 30 36 51 59 76 89 93 101 121 130 )
( 4 18 32 42 48 63 71 88 91 105 112 133 )
( 4 19 25 44 54 60 75 83 100 103 117 123 )
( 4 20 24 37 56 66 72 87 95 102 115 129 )
( 4 21 31 35 49 58 78 84 99 107 114 127 )
( 4 22 29 43 46 61 70 80 96 111 119 126 )
( 4 23 28 41 55 57 73 82 92 108 113 131 )
( 5 13 27 39 51 63 75 87 99 111 113 125 )
( 5 14 29 42 56 57 74 83 93 109 114 132 )
( 5 15 34 41 54 58 68 86 95 105 121 126 )
( 5 16 28 36 53 66 70 79 98 107 117 133 )
( 5 17 25 40 48 65 78 82 90 110 119 129 )
( 5 18 31 37 52 60 77 80 94 101 122 131 )
( 5 19 33 43 49 64 72 89 92 106 112 124 )
( 5 20 26 45 55 61 76 84 91 104 118 123 )
( 5 21 24 38 47 67 73 88 96 103 116 130 )
( 5 22 32 35 50 59 69 85 100 108 115 128 )
( 5 23 30 44 46 62 71 81 97 102 120 127 )
( 6 13 28 40 52 64 76 88 100 102 114 126 )
( 6 14 31 45 46 63 72 82 98 103 121 128 )
( 6 15 30 43 47 57 75 84 94 110 115 133 )
( 6 16 25 42 55 59 68 87 96 106 122 127 )
( 6 17 29 37 54 67 71 79 99 108 118 124 )
( 6 18 26 41 49 66 69 83 90 111 120 130 )
( 6 19 32 38 53 61 78 81 95 101 113 132 )
( 6 20 34 44 50 65 73 80 93 107 112 125 )
( 6 21 27 36 56 62 77 85 92 105 119 123 )
( 6 22 24 39 48 58 74 89 97 104 117 131 )
( 6 23 33 35 51 60 70 86 91 109 116 129 )
( 7 13 29 41 53 65 77 89 91 103 115 127 )
( 7 14 34 35 52 61 71 87 92 110 117 130 )
( 7 15 32 36 46 64 73 83 99 104 122 129 )
( 7 16 31 44 48 57 76 85 95 111 116 124 )
( 7 17 26 43 56 60 68 88 97 107 113 128 )
( 7 18 30 38 55 58 72 79 100 109 119 125 )
( 7 19 27 42 50 67 70 84 90 102 121 131 )
( 7 20 33 39 54 62 69 82 96 101 114 133 )
( 7 21 25 45 51 66 74 81 94 108 112 126 )
( 7 22 28 37 47 63 78 86 93 106 120 123 )
( 7 23 24 40 49 59 75 80 98 105 118 132 )
( 8 13 30 42 54 66 78 80 92 104 116 128 )
( 8 14 24 41 50 60 76 81 99 106 119 133 )
( 8 15 25 35 53 62 72 88 93 111 118 131 )
( 8 16 33 37 46 65 74 84 100 105 113 130 )
( 8 17 32 45 49 57 77 86 96 102 117 125 )
( 8 18 27 44 47 61 68 89 98 108 114 129 )
( 8 19 31 39 56 59 73 79 91 110 120 126 )
( 8 20 28 43 51 58 71 85 90 103 122 132 )
( 8 21 34 40 55 63 70 83 97 101 115 124 )
( 8 22 26 36 52 67 75 82 95 109 112 127 )
( 8 23 29 38 48 64 69 87 94 107 121 123 )
( 9 13 31 43 55 67 69 81 93 105 117 129 )
( 9 14 30 39 49 65 70 88 95 108 122 123 )
( 9 15 24 42 51 61 77 82 100 107 120 124 )
( 9 16 26 35 54 63 73 89 94 102 119 132 )
( 9 17 34 38 46 66 75 85 91 106 114 131 )
( 9 18 33 36 50 57 78 87 97 103 118 126 )
( 9 19 28 45 48 62 68 80 99 109 115 130 )
( 9 20 32 40 47 60 74 79 92 111 121 127 )
( 9 21 29 44 52 59 72 86 90 104 113 133 )
( 9 22 25 41 56 64 71 84 98 101 116 125 )
( 9 23 27 37 53 58 76 83 96 110 112 128 )
( 10 13 32 44 56 58 70 82 94 106 118 130 )
( 10 14 28 38 54 59 77 84 97 111 112 129 )
( 10 15 31 40 50 66 71 89 96 109 113 123 )
( 10 16 24 43 52 62 78 83 91 108 121 125 )
( 10 17 27 35 55 64 74 80 95 103 120 133 )
( 10 18 25 39 46 67 76 86 92 107 115 132 )
( 10 19 34 37 51 57 69 88 98 104 119 127 )
( 10 20 29 36 49 63 68 81 100 110 116 131 )
( 10 21 33 41 48 61 75 79 93 102 122 128 )
( 10 22 30 45 53 60 73 87 90 105 114 124 )
( 10 23 26 42 47 65 72 85 99 101 117 126 )
( 11 13 33 45 47 59 71 83 95 107 119 131 )
( 11 14 27 43 48 66 73 86 100 101 118 127 )
( 11 15 29 39 55 60 78 85 98 102 112 130 )
( 11 16 32 41 51 67 72 80 97 110 114 123 )
( 11 17 24 44 53 63 69 84 92 109 122 126 )
( 11 18 28 35 56 65 75 81 96 104 121 124 )
( 11 19 26 40 46 58 77 87 93 108 116 133 )
( 11 20 25 38 52 57 70 89 99 105 120 128 )
( 11 21 30 37 50 64 68 82 91 111 117 132 )
( 11 22 34 42 49 62 76 79 94 103 113 129 )
( 11 23 31 36 54 61 74 88 90 106 115 125 )
( 12 13 34 36 48 60 72 84 96 108 120 132 )
( 12 14 32 37 55 62 75 89 90 107 116 126 )
( 12 15 28 44 49 67 74 87 91 101 119 128 )
( 12 16 30 40 56 61 69 86 99 103 112 131 )
( 12 17 33 42 52 58 73 81 98 111 115 123 )
( 12 18 24 45 54 64 70 85 93 110 113 127 )
( 12 19 29 35 47 66 76 82 97 105 122 125 )
( 12 20 27 41 46 59 78 88 94 109 117 124 )
( 12 21 26 39 53 57 71 80 100 106 121 129 )
( 12 22 31 38 51 65 68 83 92 102 118 133 )
( 12 23 25 43 50 63 77 79 95 104 114 130 ) ))
;; AFFINE PLANES
;; any two distinct points are joined by exactly one line
;; any point not in a line is contained in only one other non-intersecting line
; 9 elements
; 12 vectors
(defparameter aplane3
'((1 2 3) (1 4 5) (1 6 7) (1 8 9) (2 4 6) (2 5 8) (2 7 9) (3 4 9)
(3 5 7) (3 6 8) (4 7 8) (5 6 9)))
; 16 elements
; 20 vectors
(defparameter aplane4
'((1 2 3 4) (1 5 6 7) (1 8 9 10) (1 11 12 13) (1 14 15 16) (2 5 11 14)
(2 6 8 12) (2 7 9 15) (2 10 13 16) (3 5 8 16) (3 6 13 15) (3 7 10 11)
(3 9 12 14) (4 5 9 13) (4 6 10 14) (4 7 12 16) (4 8 11 15) (5 10 12 15)
(6 9 11 16) (7 8 13 14)))
;; 25 elements
;; 30 vectors
(defparameter aplane5
'((1 2 3 4 5) (1 6 7 8 9) (1 10 11 12 13) (1 14 15 16 17) (1 18 19 20 21)
(1 22 23 24 25) (2 6 10 14 22) (2 7 15 18 23) (2 8 11 16 19) (2 9 12 20 24)
(2 13 17 21 25) (3 6 16 20 25) (3 7 11 17 24) (3 8 13 18 22) (3 9 10 15 21)
(3 12 14 19 23) (4 6 11 21 23) (4 7 13 14 20) (4 8 12 15 25) (4 9 17 19 22)
(4 10 16 18 24) (5 6 12 17 18) (5 7 10 19 25) (5 8 14 21 24) (5 9 13 16 23)
(5 11 15 20 22) (6 13 15 19 24) (7 12 16 21 22) (8 10 17 20 23)
(9 11 14 18 25)))
;; STEINER TRIPLE SYSTEMS
; 7 elements
; 7 vectors
(defparameter sts7
'( ( 1 2 3 ) ( 1 4 5 ) ( 1 6 7 ) ( 2 4 6 ) ( 2 5 7 )
( 3 4 7 ) ( 3 5 6 ) ))
; 9 elements
; 9 vectors
(defparameter sts9
'( ( 1 2 3 ) ( 1 4 5 ) ( 1 6 7 ) ( 1 8 9 ) ( 2 4 6 )
( 2 5 8 ) ( 2 7 9 ) ( 3 4 9 ) ( 3 5 7 ) ( 3 6 8 )
( 4 7 8 ) ( 5 6 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10 ) ( 2 4 5 6 11 12 )
( 2 4 5 7 8 11 ) ( 2 4 5 9 10 12 ) ( 2 4 6 7 8 12 )
( 2 4 6 9 10 11 ) ( 2 4 7 8 9 10 ) ( 2 4 7 10 11 12 )
( 2 4 8 9 11 12 ) ( 2 5 6 7 10 12 ) ( 2 5 6 8 9 11 )
( 2 5 7 8 9 12 ) ( 2 5 7 9 10 11 ) ( 2 5 8 10 11 12 )
( 2 6 7 8 10 11 ) ( 2 6 7 9 11 12 ) ( 2 6 8 9 10 12 )
( 3 4 5 6 7 8 ) ( 3 4 5 6 9 11 ) ( 3 4 5 6 10 12 )
( 3 4 5 7 9 10 ) ( 3 4 5 8 11 12 ) ( 3 4 6 7 11 12 )
( 3 4 6 8 9 10 ) ( 3 4 7 8 9 12 ) ( 3 4 7 8 10 11 )
( 3 4 9 10 11 12 ) ( 3 5 6 7 9 12 ) ( 3 5 6 8 10 11 )
( 3 5 7 8 9 11 ) ( 3 5 7 10 11 12 ) ( 3 5 8 9 10 12 )
( 3 6 7 8 10 12 ) ( 3 6 7 9 10 11 ) ( 3 6 8 9 11 12 )
( 4 5 6 7 10 11 ) ( 4 5 6 8 9 12 ) ( 4 5 7 8 10 12 )
( 4 5 7 9 11 12 ) ( 4 5 8 9 10 11 ) ( 4 6 7 8 9 11 )
( 4 6 7 9 10 12 ) ( 4 6 8 10 11 12 ) ( 5 6 7 8 9 10 )
( 5 6 7 8 11 12 ) ( 5 6 9 10 11 12 ) ( 7 8 9 10 11 12 ) ))
; S (3 4 8) ; hadamard
; size 14
; gap> Had348 := BlockDesigns(rec(
; > v:=8,blockSizes:=[4],
; > tSubsetStructure:=rec(t:=3,lambdas:=[1])));
(defparameter s-3-4-8
'( ( 1 2 3 4 ) ( 1 2 5 6 ) ( 1 2 7 8 ) ( 1 3 5 7 )
( 1 3 6 8 ) ( 1 4 5 8 ) ( 1 4 6 7 ) ( 2 3 5 8 )
( 2 3 6 7 ) ( 2 4 5 7 ) ( 2 4 6 8 ) ( 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2 4 8 9 11 12 ) ( 2 5 6 7 10 12 ) ( 2 5 6 8 9 11 )
( 2 5 7 8 9 12 ) ( 2 5 7 9 10 11 ) ( 2 5 8 10 11 12 )
( 2 6 7 8 10 11 ) ( 2 6 7 9 11 12 ) ( 2 6 8 9 10 12 )
( 3 4 5 6 7 8 ) ( 3 4 5 6 9 11 ) ( 3 4 5 6 10 12 )
( 3 4 5 7 9 10 ) ( 3 4 5 8 11 12 ) ( 3 4 6 7 11 12 )
( 3 4 6 8 9 10 ) ( 3 4 7 8 9 12 ) ( 3 4 7 8 10 11 )
( 3 4 9 10 11 12 ) ( 3 5 6 7 9 12 ) ( 3 5 6 8 10 11 )
( 3 5 7 8 9 11 ) ( 3 5 7 10 11 12 ) ( 3 5 8 9 10 12 )
( 3 6 7 8 10 12 ) ( 3 6 7 9 10 11 ) ( 3 6 8 9 11 12 )
( 4 5 6 7 10 11 ) ( 4 5 6 8 9 12 ) ( 4 5 7 8 10 12 )
( 4 5 7 9 11 12 ) ( 4 5 8 9 10 11 ) ( 4 6 7 8 9 11 )
( 4 6 7 9 10 12 ) ( 4 6 8 10 11 12 ) ( 5 6 7 8 9 10 )
( 5 6 7 8 11 12 ) ( 5 6 9 10 11 12 ) ( 7 8 9 10 11 12 ) ))
| 33,218 | Common Lisp | .lisp | 693 | 43.528139 | 79 | 0.497215 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | b2ed77fbc1cfe0ac9be0c1d0a4589105c7b615265e00aaf48f9b40e8d22528a7 | 15,877 | [
-1
] |
15,878 | cmn.lisp | gogins_csound-extended-nudruz/sources/cmn.lisp | (in-package :cm)
; METHOD 1: EXPORT
(defparameter up
(process for key from 60 to 72
for beg from 0 by 1
collect (new midi :time beg
:keynum key
:duration 1)))
(events (splay (indices 10 60) .5) "my-score.eps" :title "up")
(events up "my-score.eps" :title "up!")
; ; then ">gs my-score.eps" to see it!
;; METHOD 2: NATIVE
(in-package :cmn)
(cmn (size 24) staff alto (key e-minor) (meter 3 4)
b4 q g4 q e4 q
a4 q f4 q ds4 q
b3 q cs4 e ds4 e e4 e f4 e
g4 h e4 q
e5 q c5 q a4 q
b4 q g4 q e4 q
a4 e f4 e ds4 e b3 e cs4 e d4 e
e4 h.
double-bar)
(cmn (size 24) staff treble (key b-minor) (meter 2 4)
b4 e f4 e d5 e b4 e
as4 e c5 e f4 q
as4 e c5 e f4 e e5 e
d5 q b4 q
g4 e b4 e e4 e g4 e
f4 e b4 e d4 e b4 e
as4 e f4 e c5 e a4 e
e5 e d5 s c5 s b4 q
double-bar) | 932 | Common Lisp | .lisp | 33 | 22.272727 | 62 | 0.54955 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | e445790a7d63b65e6230bc56b2d3320cc042d18cb54446e44c9328b320f7c28e | 15,878 | [
-1
] |
15,879 | tonnetz.lisp | gogins_csound-extended-nudruz/sources/tonnetz.lisp | ;; TONNETZ.LISP
;; building parsimonious tonnetz for use with Common Music
;; see Cohn (JMT 41:1) etc.
;; Drew Krause, 2004
;; [email protected]
;; www.wordecho.org
; (load "nudruz.lisp")
(in-package :cm)
;;(use-package :screamer)
;; SOME BASIC UTILITIES
;; May 2005: "inverse-idx" moved to nudruz.lisp
;; April 2007: "SIS" moved to nudruz.lisp
;; TZWORTHY -- tests whether tz can apply to a chord at all
(defun tzworthy (chd)
(eql 3
(length (remove-duplicates (sis (prime-form chd))))))
;; the six basic transformations
;; PM -- first transformation type
;; [note: pitches are expected & returned in the 'correct order']
;; (pm '(0 3 7)) = (7 4 0)
(defun pm (pform &optional (modlen 12))
(let ((psis (sis pform modlen)))
(if (= (inverse-idx pform) 1)
(mapcar (lambda (x) (mod x modlen))
(list
(third pform)
(+ (second pform)
(- (second psis) (first psis)))
(first pform)))
nil)))
;; IPM -- inverse of first type
;; [note: pitches are expected & returned in the 'correct order']
;; (ipm '(7 4 0)) = (0 3 7)
(defun ipm (iform &optional (modlen 12))
(let ((isis (sis iform modlen)))
(if (= (inverse-idx iform) -1)
(mapcar (lambda (x) (mod x modlen))
(list
(third iform)
(- (second iform)
(- (second isis) (first isis)))
(first iform)))
nil)))
;; LM -- second transformation type
;; [note: pitches are expected & returned in the 'correct order']
;; (lm '(0 3 7)) = (3 0 8)
(defun lm (pform &optional (modlen 12))
(let ((psis (sis pform modlen)))
(if (= (inverse-idx pform) 1)
(mapcar (lambda (x) (mod x modlen))
(list
(second pform)
(first pform)
(+ (third pform)
(- (third psis) (second psis)))))
nil)))
;; ILM -- inverse of second type
;; [note: pitches are expected & returned in the 'correct order']
;; (ilm '(7 4 0)) = (4 7 11)
(defun ilm (iform &optional (modlen 12))
(let ((isis (sis iform modlen)))
(if (= (inverse-idx iform) -1)
(mapcar (lambda (x) (mod x modlen))
(list
(second iform)
(first iform)
(- (third iform)
(- (third isis) (second isis)))))
nil)))
;; RM -- third transformation type
;; [note: pitches are expected & returned in the 'correct order']
;; (rm '(0 3 7)) = (10 7 3)
(defun rm (pform &optional (modlen 12))
(let ((psis (sis pform modlen)))
(if (= (inverse-idx pform) 1)
(mapcar (lambda (x) (mod x modlen))
(list
(- (first pform)
(- (third psis) (first psis)))
(third pform)
(second pform)))
nil)))
;; IRM -- inversion of third type
;; [note: pitches are expected & returned in the 'correct order']
;; (irm '(7 4 0)) = (9 0 4)
(defun irm (iform &optional (modlen 12))
(let ((isis (sis iform modlen)))
(if (= (inverse-idx iform) -1)
(mapcar (lambda (x) (mod x modlen))
(list
(+ (first iform)
(- (third isis) (first isis)))
(third iform)
(second iform)))
nil)))
;; working with transformations
;; CORRECT-ORDER ... must have correct order of pitches
;; for both prime & inverse when plugging into tzrandchain
;; (correct-order '(0 4 7)) = (7 4 0)
(defun correct-order (a-list &optional (modlen 12))
(let ((psis (sis a-list))
(aperms (permutations a-list)))
(if (= 1 (inverse-idx a-list))
(find-if
(lambda (x)
(and (= (first psis) (mod (- (second x) (first x)) modlen))
(= (second psis) (mod (- (third x) (second x)) modlen))))
aperms)
(reverse
(find-if
(lambda (x)
(and (= (second psis) (mod (- (second x) (first x)) modlen))
(= (first psis) (mod (- (third x) (second x)) modlen))))
aperms)))))
;; CHOOSE-CHAIN-START -- utility to select starting transform in a chain
;; (choose-chain-start '(7 4 0)) = 4
(defun choose-chain-start (a-chd)
(if (= (inverse-idx a-chd) 1)
(random 3)
(+ 3 (random 3))))
;; TZRANDLIST -- makes list of transforms from
;; (bipartite) transformation graph;
;; chooses correct starting transformation
;; (tzrandlist '(0 3 7) 5) = (LM IRM PM ILM PM)
(defun tzrandlist (a-chd len)
(let* ((tzgraph
(new graph :of
`((pm :id 1 :to ,(new weighting of '(5 6)))
(lm :id 2 :to ,(new weighting of '(4 6)))
(rm :id 3 :to ,(new weighting of '(4 5)))
(ipm :id 4 :to ,(new weighting of '(2 3)))
(ilm :id 5 :to ,(new weighting of '(1 3)))
(irm :id 6 :to ,(new weighting of '(1 2))))
:starting-node-index (choose-chain-start a-chd))))
(next tzgraph len)))
;; GEN-TZ apply transform to/from any vector
;; (gen-tz 'lm '(10 19 26)) = (10 19 27)
(defun gen-tz (transform a-chd &optional (modlen 12))
(let ((mm (modmult a-chd 1 modlen)))
(matchreg
(closest-mod mm (funcall transform (correct-order mm)) modlen)
a-chd)))
;;; TZCHAIN -- make a list of trichords from starting chord
;;; and a tzlist (generalized)
;; (tzchain '(0 3 7) '(pm ilm)) = ((0 3 7) (0 4 7) (11 4 7))
(defun tzchain (a-chd tzlist &optional (modlen 12))
(cons a-chd
(when tzlist
(tzchain
(gen-tz (first tzlist) a-chd modlen) (cdr tzlist)))))
;; TZRANDCHAIN -- main function
;; applies tzrandlist to a chord
;; takes chord and length (total # trichords) -- returns all trichords
;; (tzrandchain '(0 3 7) 4) = ((0 3 7) (0 4 7) (0 4 9) (0 5 9))
(defun tzrandchain (a-chd len)
(tzchain a-chd (tzrandlist a-chd (- len 1))))
;;;
;;; demonstration follows ...
;;;
(defun tzplay ()
(process for thischord in (tzrandchain '(3 26 48) 120)
for dur = (pick 3 4 5)
output (multievent 'midi :keynum
:keynum (transp thischord 40)
:time (now)
:duration dur)
wait dur))
;; store them in a midi file
; (events tzplay "tzplay.midi")
;; below added June 2006
;; tonnetz metric work -- distances & paths btwn trichords!!
;; Q-STAR -- see Cohn in JMT 41:1 (p. 19)
(defun q-star (num &optional (modlen 12))
(/ modlen (gcd num modlen)))
;; TZDIMS -- takes chord; returns dimensions of its tonnetz
(defun tzdims (chd &optional (modlen 12))
(let* ((tsis (sis chd))
(xdim (/ modlen (first tsis)))
(ydim (/ modlen (second tsis))))
(list xdim ydim)))
;; TZMIN-SUM -- utility for tzpath-vectors
(defun tzmin-sum (setof3)
(+ (abs (first setof3))
(abs (second setof3))
(abs (third setof3))))
;; TZPATH-VECTORS -- returns sorted set of (Nx My P(x+y)) factors
;; for any given transposition 'tlen'
(defun tzpath-vectors (x y tlen &optional (modlen 12))
(sort (tzpathfactors x y tlen modlen)
(lambda (x y)
(< (tzmin-sum x) (tzmin-sum y)))))
;; BEST-TZPATH-VECTOR -- finds best set of (Nx My P(x+y)) factors
;; for any given transposition 'tlen'
;; [picked randomly from equally best factors]
(defun best-tzpath-vector (x y tlen &optional (modlen 12))
(let* ((tzpaths (tzpathfactors x y tlen modlen))
(minsum (loop for tzp in tzpaths minimize (tzmin-sum tzp))))
(pickl (no-nils
(loop for x in tzpaths collect
(if (= (tzmin-sum x) minsum) x))))))
;; TZPATH-VECTOR-LEN -- finds set of (Nx My P(x+y)) factors of specified len
;; for any given transposition 'tlen'
;; [picked randomly from equally best factors]
(defun tzpath-vector-len (x y tlen vlen &optional (modlen 12))
(let* ((tzpaths (tzpathfactors x y tlen modlen)))
(pickl (no-nils
(loop for x in tzpaths collect
(if (= (tzmin-sum x) vlen) x))))))
;; CT-CANDIDATES
;; returns all tz-primes bordering a given inverse
;; OR returns all inverses bordering a given prime
(defun ct-candidates (invec &optional (modlen 12))
(let* ((pf (prime-form invec))
(invidx (inverse-idx invec))
(allvec ;; all possible matches
(remove-duplicates
(loop for x to (- modlen 1) collect
(mod12 (transp
(if (eql 1 invidx) (pm (correct-order invec)) pf)
x)))
:test #'list-eql)))
(mapcar #'correct-order
(no-nils
(loop for p in allvec collect
(if (eql 2 (length (intersection p invec)))
p))))))
;; CLOSEST-TO-INV -- returns best factor-list toward
;; closest tz-prime to inverse in p-to-i moves
;; and closest inverse to tz-prime in i-to-p moves
(defun closest-to-inv (startvec endvec &optional (modlen 12))
(let* ((startsis (sis startvec))
(x (first startsis))
(y (second startsis))
(ctcands (ct-candidates endvec modlen))
(tlevels (mod12
(mapcar (lambda (x) (- (car x)
(car (correct-order startvec))))
ctcands)))
(bests (mapcar (lambda (n) (best-tzpath-vector x y n)) tlevels))
(pathlens (mapcar #'tzmin-sum bests))
(quickest (apply #'min pathlens)))
(pickl
(no-nils
(loop for b in bests collect
(if (eql (tzmin-sum b) quickest) b))))))
;; FIND-TZ-FLIP -- given two adjacent tztriads,
;; find transformation type from first to second
(defun find-tz-flip (startvec endvec)
(let* ((sinvidx (inverse-idx startvec))
(svec (correct-order startvec))
(evec (correct-order endvec)))
(case (position (car (set-difference svec evec)) svec)
(1 (if (eql sinvidx 1) 'pm 'ipm))
(0 (if (eql sinvidx 1) 'rm 'irm))
(2 (if (eql sinvidx 1) 'lm 'ilm)))))
;; TZFACTORS->MOVES -- takes factor 3-list, returns moves (p-to-p or i-to-i)
(defun tzfactors->moves (startvec factlist)
(let* ((sinvidx (inverse-idx startvec))
(n (first factlist))
(m (second factlist))
(p (third factlist))
(n-moves
(loop repeat (abs n) collect
(case sinvidx
(1 (if (plusp n) (list 'rm 'ipm) (list 'pm 'irm)))
(-1 (if (plusp n) (list 'ipm 'rm) (list 'irm 'pm))))))
(m-moves
(loop repeat (abs m) collect
(case sinvidx
(1 (if (plusp m) (list 'pm 'ilm) (list 'lm 'ipm)))
(-1 (if (plusp m) (list 'ilm 'pm) (list 'ipm 'lm))))))
(p-moves
(loop repeat (abs p) collect
(case sinvidx
(1 (if (plusp p) (list 'rm 'ilm) (list 'lm 'irm)))
(-1 (if (plusp p) (list 'ilm 'rm) (list 'irm 'lm)))))))
(flatten
(shuffle
(no-nils
(append n-moves m-moves p-moves))))))
;; BEST-TZ-PATH -- shortest intermediate tz-chords btwn 2 chords
;; includes startvec, but not endvec
(defun best-tz-path (startvec endvec)
(let* ((ssis (sis startvec))
(s12 (correct-order (mod12 startvec)))
(e12 (correct-order (mod12 endvec))))
(if (or (member e12 (ct-candidates s12) :test #'list-eql)
(list-eql startvec endvec))
(list startvec)
(butlast
(tendreg
(append
(if (eql (inverse-idx startvec) (inverse-idx endvec))
(butlast (tzchain startvec
(tzfactors->moves
startvec
(best-tzpath-vector
(first ssis)
(second ssis)
(mod12 (- (car e12) (car s12)))))))
(tzchain startvec
(tzfactors->moves
startvec (closest-to-inv startvec endvec))))
(list endvec))))))) | 12,057 | Common Lisp | .lisp | 304 | 31.207237 | 76 | 0.552901 | gogins/csound-extended-nudruz | 5 | 0 | 0 | LGPL-2.1 | 9/19/2024, 11:27:22 AM (Europe/Amsterdam) | fb95ea7e4a1b535fb304e12580c75c94c24b4f48c4b1754d336d68492adf33d7 | 15,879 | [
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.