code wiki / (root) / nx_flavor_integrate.nx

nx_flavor_integrate.nx source

↩ module page · 79 lines · 3301 B

1// nx_flavor_integrate.nx -- T2 of the TASTE-SCIENCE ladder: MULTIMODAL 2// flavor integration. "Flavor" is not taste -- it is the brain's fusion 3// of FOUR senses: gustation (the 5 tastes), retronasal OLFACTION (aroma, 4// the dominant contributor to flavor identity), trigeminal chemesthesis 5// (capsaicin heat, menthol cool), and mouthfeel (body, astringency). 6// 7// The baseline nx_food_science has 6 axes (5 tastes + crunch). T2 builds 8// a 10-dimensional flavor vector AND models a cross-modal effect the 9// baseline structurally cannot: ODOR-INDUCED TASTE ENHANCEMENT -- a 10// congruent aroma (e.g. strawberry) makes a food taste SWEETER without 11// any added sugar (Stevenson/Prescott). Aroma is also weighted highest 12// per unit, because olfaction dominates flavor identity (anosmia = food 13// "tastes of nothing" though the tongue still works). 14// 15// MEASURED EXCEED (gate-checked): 10 dimensions > 6; aroma out-weighs an 16// equal unit of taste; and a congruent aroma raises perceived sweetness. 17// 18// genealogy_id: stevenson_prescott_odor_taste_enhancement 19// + shepherd_2006_neurogastronomy + nishi_taste_transduce_2026 20 21import "nx_syscalls.nx" 22 23const NX_FV_NDIM: i64 = 10 24const NX_FV_W_TASTE: i64 = 1 25const NX_FV_W_AROMA: i64 = 3 // olfaction dominates flavor identity 26const NX_FV_W_TRIG: i64 = 1 27const NX_FV_W_MOUTH: i64 = 1 28const NX_FV_ENHANCE_K: i64 = 300 // odor-induced sweetness enhancement gain 29 30struct NxFlavorVector { 31 sweet: i64, 32 sour: i64, 33 salty: i64, 34 bitter: i64, 35 umami: i64, 36 aroma: i64, // retronasal olfaction intensity 37 trig_heat: i64, // capsaicin / chemesthetic heat 38 trig_cool: i64, // menthol / cooling 39 body: i64, // mouthfeel body / viscosity 40 astringent: i64, // tannin astringency 41} 42 43func nx_flavor_vector_new(sweet: i64, sour: i64, salty: i64, bitter: i64, 44 umami: i64, aroma: i64, trig_heat: i64, 45 trig_cool: i64, body: i64, astringent: i64) -> *NxFlavorVector { 46 let fv: *NxFlavorVector = (sys_mmap(80)) as *NxFlavorVector 47 fv.sweet = sweet 48 fv.sour = sour 49 fv.salty = salty 50 fv.bitter = bitter 51 fv.umami = umami 52 fv.aroma = aroma 53 fv.trig_heat = trig_heat 54 fv.trig_cool = trig_cool 55 fv.body = body 56 fv.astringent = astringent 57 return fv 58} 59 60func nx_flavor_ndim() -> i64 { 61 return NX_FV_NDIM 62} 63 64// Overall flavor intensity: a weighted fusion across all four modalities, 65// with olfaction weighted highest per unit. 66func nx_flavor_total_intensity(fv: *NxFlavorVector) -> i64 { 67 let taste_sum: i64 = fv.sweet + fv.sour + fv.salty + fv.bitter + fv.umami 68 let trig_sum: i64 = fv.trig_heat + fv.trig_cool 69 let mouth_sum: i64 = fv.body + fv.astringent 70 let gust_olf: i64 = NX_FV_W_TASTE * taste_sum + NX_FV_W_AROMA * fv.aroma 71 let trig_mouth: i64 = NX_FV_W_TRIG * trig_sum + NX_FV_W_MOUTH * mouth_sum 72 return gust_olf + trig_mouth 73} 74 75// Odor-induced taste enhancement: a congruent aroma raises the PERCEIVED 76// sweetness of a stimulus with no extra sugar. aroma = 0 -> unchanged. 77func nx_flavor_aroma_enhance_sweet(base_sweet: i64, congruent_aroma: i64) -> i64 { 78 return base_sweet + (NX_FV_ENHANCE_K * congruent_aroma) / 1000 79}