binaural_beat_generator_cli/modules/
preset.rs

1//! A module that contains code that allows for presets so that all settings can be easily used and passed around.
2//!
3use std::fmt;
4
5use crate::modules::{
6    duration::duration::Duration,
7    frequency::{beat_frequency::BeatFrequency, carrier_frequency::CarrierFrequency},
8};
9
10/// This structure groups the basic values needed to run the binaural beat program.
11#[derive(Debug, Clone, Copy, PartialEq)]
12pub struct BinauralPresetGroup {
13    pub preset: Preset,
14    pub carrier: CarrierFrequency,
15    pub beat: BeatFrequency,
16    pub duration: Duration,
17}
18
19/// The preset enum allows the user to be able to select a preset to use on the command line.
20#[derive(Debug, Clone, Copy, PartialEq)]
21pub enum Preset {
22    /// **Focus:**
23    /// A preset for heightened concentration and alertness, typically used
24    /// for studying or complex problem-solving. It utilizes Beta brainwaves
25    /// (12-30 Hz) which are associated with active thinking.
26    Focus,
27
28    /// **High Focus:**
29    /// A more intense version of the `Focus` preset, pushing the mind to
30    /// higher levels of cognitive processing. It leverages Gamma brainwaves
31    /// (30-100 Hz), linked to peak concentration and intelligence.
32    HighFocus,
33
34    /// **Relaxation:**
35    /// Promotes a state of calm alertness, ideal for unwinding after a
36    /// stressful day or for light meditation. This preset uses Alpha brainwaves
37    /// (8-12 Hz).
38    Relaxation,
39
40    /// **Deep Relaxation:**
41    /// A deeper state of calm, bridging the gap between wakefulness and
42    /// sleep. It's often used for deep meditation or to prepare for rest.
43    /// This preset uses Theta brainwaves (4-8 Hz).
44    DeepRelaxation,
45
46    /// **Sleep:**
47    /// Designed to induce a state of deep, restorative sleep. It utilizes
48    /// Delta brainwaves (0.5-4 Hz), which are associated with deep, dreamless sleep.
49    Sleep,
50
51    /// **Chanting:**
52    /// A preset that mimics the meditative state achieved during chanting.
53    /// It helps to calm the mind and body using Theta brainwaves (4-8 Hz).
54    Chanting,
55
56    /// **Intuition:**
57    /// This preset is designed to enhance intuition and insight by fostering
58    /// a Theta state, which is linked to creativity and subconscious processing.
59    Intuition,
60
61    /// **Astral:**
62    /// An advanced preset aimed at assisting with out-of-body or astral projection
63    /// experiences. It combines a deep Theta beat with a Delta carrier to induce
64    /// a highly altered state of consciousness.
65    Astral,
66
67    /// **Healing:**
68    /// This preset is thought to promote physical and mental healing by inducing
69    /// a deep Delta state, which is associated with the body's natural restorative
70    /// processes during sleep.
71    Healing,
72
73    /// **Alpha:**
74    /// A preset that specifically targets the Alpha brainwave state (8-12 Hz)
75    /// to encourage a feeling of relaxed awareness and stress reduction.
76    Alpha,
77
78    /// **Intelligence:**
79    /// This preset stimulates the brain for enhanced learning and cognitive function.
80    /// It primarily uses Gamma brainwaves (30-100 Hz), which are linked to
81    /// high-level information processing.
82    Intelligence,
83
84    /// **Euphoria:**
85    /// A preset designed to promote feelings of happiness and well-being.
86    /// It utilizes a Gamma beat, which is often associated with endorphin
87    /// release and positive emotional states.
88    Euphoria,
89
90    // --- Chakra Presets ---
91    /// A group of presets designed to balance the seven main chakras. Each
92    /// preset combines a specific chakra's carrier frequency with a
93    /// binaural beat that induces a meditative or desired state.
94    ///
95    ///
96
97    // --- Crown Chakra Presets ---
98    /// A collection of presets specifically targeting the Crown Chakra.
99    /// They combine the Crown Chakra's carrier frequency with different
100    /// mental states.
101
102    /// **Crown Focus:**
103    /// Combines the Crown Chakra's tuning fork frequency with a Beta beat
104    /// for focused meditation on spiritual connection.
105    CrownFocus,
106
107    /// **Crown Relaxation:**
108    /// Combines the Crown Chakra's tuning fork frequency with an Alpha beat
109    /// to promote a relaxed spiritual state.
110    CrownRelaxation,
111
112    /// **Crown Sleep:**
113    /// Combines the Crown Chakra's tuning fork frequency with a Delta beat
114    /// for deep rest and spiritual renewal.
115    CrownSleep,
116
117    /// **Crown Chanting:**
118    /// Combines the Crown Chakra's tuning fork frequency with a Theta beat
119    /// for a deeply meditative state during spiritual practices.
120    CrownChanting,
121
122    /// **Crown Intuition:**
123    /// Combines the Crown Chakra's tuning fork frequency with a Theta beat
124    /// to enhance intuition and cosmic awareness.
125    CrownIntuition,
126
127    /// **Crown Astral:**
128    /// Combines the Crown Chakra's tuning fork frequency with a Delta beat
129    /// for advanced meditation and astral exploration.
130    CrownAstral,
131
132    // --- Solfeggio Chakra Presets ---
133    /// These presets use the ancient Solfeggio tones as the carrier frequency
134    /// for chakra balancing and meditation.
135
136    /// **Solfeggio Root Chakra:**
137    /// Uses the 396 Hz Solfeggio tone with a Delta beat for grounding and stability.
138    SolfeggioRoot,
139
140    /// **Solfeggio Sacral Chakra:**
141    /// Uses the 417 Hz Solfeggio tone with a Theta beat for creativity and emotional release.
142    SolfeggioSacral,
143
144    /// **Solfeggio Solar Plexus Chakra:**
145    /// Uses the 528 Hz Solfeggio tone with an Alpha beat for transformation and motivation.
146    SolfeggioSolarPlexus,
147
148    /// **Solfeggio Heart Chakra:**
149    /// Uses the 639 Hz Solfeggio tone with an Alpha beat for love and connection.
150    SolfeggioHeart,
151
152    /// **Solfeggio Throat Chakra:**
153    /// Uses the 741 Hz Solfeggio tone with a Beta beat for communication and expression.
154    SolfeggioThroat,
155
156    /// **Solfeggio Third Eye Chakra:**
157    /// Uses the 852 Hz Solfeggio tone with a Beta beat for clarity and intuition.
158    SolfeggioThirdEye,
159
160    /// **Solfeggio Crown Chakra:**
161    /// Uses the 963 Hz Solfeggio tone with a Gamma beat for spiritual connection and unity.
162    SolfeggioCrown,
163
164    // --- Tuning Fork Chakra Presets ---
165    /// These presets use the Planetary/Tuning Fork frequencies as the
166    /// carrier frequency for chakra balancing.
167
168    /// **Tuning Fork Root Chakra:**
169    /// Uses the 194.18 Hz Tuning Fork tone with a Delta beat for grounding.
170    TuningForkRoot,
171
172    /// **Tuning Fork Sacral Chakra:**
173    /// Uses the 210.42 Hz Tuning Fork tone with a Theta beat for emotional flow.
174    TuningForkSacral,
175
176    /// **Tuning Fork Solar Plexus Chakra:**
177    /// Uses the 126.22 Hz Tuning Fork tone with an Alpha beat for confidence.
178    TuningForkSolarPlexus,
179
180    /// **Tuning Fork Heart Chakra:**
181    /// Uses the 136.10 Hz Tuning Fork tone with an Alpha beat for love and compassion.
182    TuningForkHeart,
183
184    /// **Tuning Fork Throat Chakra:**
185    /// Uses the 141.27 Hz Tuning Fork tone with a Beta beat for communication.
186    TuningForkThroat,
187
188    /// **Tuning Fork Third Eye Chakra:**
189    /// Uses the 221.23 Hz Tuning Fork tone with a Beta beat for insight and wisdom.
190    TuningForkThirdEye,
191
192    /// **Tuning Fork Crown Chakra:**
193    /// Uses the 172.06 Hz Tuning Fork tone with a Gamma beat for spiritual transcendence.
194    TuningForkCrown,
195}
196
197/// The this implementation converts a preset to a preset group of values based on predetermined settings.
198impl From<Preset> for BinauralPresetGroup {
199    fn from(preset: Preset) -> Self {
200        match preset {
201            // General Presets
202            Preset::Focus => BinauralPresetGroup {
203                preset: preset,
204                carrier: CarrierFrequency::Beta,
205                beat: BeatFrequency::Beta,
206                duration: Duration::ThirtyMinutes,
207            },
208            Preset::HighFocus => BinauralPresetGroup {
209                preset: preset,
210                carrier: CarrierFrequency::Gamma,
211                beat: BeatFrequency::Gamma,
212                duration: Duration::ThirtyMinutes,
213            },
214            Preset::Relaxation => BinauralPresetGroup {
215                preset: preset,
216                carrier: CarrierFrequency::Alpha,
217                beat: BeatFrequency::Alpha,
218                duration: Duration::FifteenMinutes,
219            },
220            Preset::DeepRelaxation => BinauralPresetGroup {
221                preset: preset,
222                carrier: CarrierFrequency::Theta,
223                beat: BeatFrequency::Theta,
224                duration: Duration::FifteenMinutes,
225            },
226            Preset::Sleep => BinauralPresetGroup {
227                preset: preset,
228                carrier: CarrierFrequency::Delta,
229                beat: BeatFrequency::Delta,
230                duration: Duration::SixtyMinutes,
231            },
232            Preset::Chanting => BinauralPresetGroup {
233                preset: preset,
234                carrier: CarrierFrequency::Theta,
235                beat: BeatFrequency::Theta,
236                duration: Duration::ThirtyMinutes,
237            },
238            Preset::Intuition => BinauralPresetGroup {
239                preset: preset,
240                carrier: CarrierFrequency::Theta,
241                beat: BeatFrequency::Theta,
242                duration: Duration::FifteenMinutes,
243            },
244            Preset::Astral => BinauralPresetGroup {
245                preset: preset,
246                carrier: CarrierFrequency::Custom(140.0),
247                beat: BeatFrequency::Custom(6.3),
248                duration: Duration::SixtyMinutes,
249            },
250            Preset::Healing => BinauralPresetGroup {
251                preset: preset,
252                carrier: CarrierFrequency::Delta,
253                beat: BeatFrequency::Theta,
254                duration: Duration::SixtyMinutes,
255            },
256            Preset::Alpha => BinauralPresetGroup {
257                preset: preset,
258                carrier: CarrierFrequency::Alpha,
259                beat: BeatFrequency::Alpha,
260                duration: Duration::ThirtyMinutes,
261            },
262            Preset::Intelligence => BinauralPresetGroup {
263                preset: preset,
264                carrier: CarrierFrequency::Gamma,
265                beat: BeatFrequency::Gamma,
266                duration: Duration::TenMinutes,
267            },
268            Preset::Euphoria => BinauralPresetGroup {
269                preset: preset,
270                carrier: CarrierFrequency::Custom(210.42),
271                beat: BeatFrequency::Custom(20.0),
272                duration: Duration::TenMinutes,
273            },
274
275            // Crown Chakra Presets
276            Preset::CrownFocus => BinauralPresetGroup {
277                preset: preset,
278                carrier: CarrierFrequency::TuningForkCrown,
279                beat: BeatFrequency::Beta,
280                duration: Duration::ThirtyMinutes,
281            },
282            Preset::CrownRelaxation => BinauralPresetGroup {
283                preset: preset,
284                carrier: CarrierFrequency::TuningForkCrown,
285                beat: BeatFrequency::Alpha,
286                duration: Duration::FifteenMinutes,
287            },
288            Preset::CrownSleep => BinauralPresetGroup {
289                preset: preset,
290                carrier: CarrierFrequency::TuningForkCrown,
291                beat: BeatFrequency::Delta,
292                duration: Duration::SixtyMinutes,
293            },
294            Preset::CrownChanting => BinauralPresetGroup {
295                preset: preset,
296                carrier: CarrierFrequency::TuningForkCrown,
297                beat: BeatFrequency::Theta,
298                duration: Duration::ThirtyMinutes,
299            },
300            Preset::CrownIntuition => BinauralPresetGroup {
301                preset: preset,
302                carrier: CarrierFrequency::TuningForkCrown,
303                beat: BeatFrequency::Theta,
304                duration: Duration::FifteenMinutes,
305            },
306            Preset::CrownAstral => BinauralPresetGroup {
307                preset: preset,
308                carrier: CarrierFrequency::TuningForkCrown,
309                beat: BeatFrequency::Delta,
310                duration: Duration::SixtyMinutes,
311            },
312
313            // Solfeggio Chakra Presets
314            Preset::SolfeggioRoot => BinauralPresetGroup {
315                preset: preset,
316                carrier: CarrierFrequency::SolfeggioRoot,
317                beat: BeatFrequency::Delta,
318                duration: Duration::ThirtyMinutes,
319            },
320            Preset::SolfeggioSacral => BinauralPresetGroup {
321                preset: preset,
322                carrier: CarrierFrequency::SolfeggioSacral,
323                beat: BeatFrequency::Theta,
324                duration: Duration::ThirtyMinutes,
325            },
326            Preset::SolfeggioSolarPlexus => BinauralPresetGroup {
327                preset: preset,
328                carrier: CarrierFrequency::SolfeggioSolarPlexus,
329                beat: BeatFrequency::Alpha,
330                duration: Duration::ThirtyMinutes,
331            },
332            Preset::SolfeggioHeart => BinauralPresetGroup {
333                preset: preset,
334                carrier: CarrierFrequency::SolfeggioHeart,
335                beat: BeatFrequency::Alpha,
336                duration: Duration::FifteenMinutes,
337            },
338            Preset::SolfeggioThroat => BinauralPresetGroup {
339                preset: preset,
340                carrier: CarrierFrequency::SolfeggioThroat,
341                beat: BeatFrequency::Beta,
342                duration: Duration::TenMinutes,
343            },
344            Preset::SolfeggioThirdEye => BinauralPresetGroup {
345                preset: preset,
346                carrier: CarrierFrequency::SolfeggioThirdEye,
347                beat: BeatFrequency::Beta,
348                duration: Duration::TenMinutes,
349            },
350            Preset::SolfeggioCrown => BinauralPresetGroup {
351                preset: preset,
352                carrier: CarrierFrequency::SolfeggioCrown,
353                beat: BeatFrequency::Gamma,
354                duration: Duration::TenMinutes,
355            },
356
357            // Tuning Fork Chakra Presets
358            Preset::TuningForkRoot => BinauralPresetGroup {
359                preset: preset,
360                carrier: CarrierFrequency::TuningForkRoot,
361                beat: BeatFrequency::Delta,
362                duration: Duration::ThirtyMinutes,
363            },
364            Preset::TuningForkSacral => BinauralPresetGroup {
365                preset: preset,
366                carrier: CarrierFrequency::TuningForkSacral,
367                beat: BeatFrequency::Theta,
368                duration: Duration::ThirtyMinutes,
369            },
370            Preset::TuningForkSolarPlexus => BinauralPresetGroup {
371                preset: preset,
372                carrier: CarrierFrequency::TuningForkSolarPlexus,
373                beat: BeatFrequency::Alpha,
374                duration: Duration::ThirtyMinutes,
375            },
376            Preset::TuningForkHeart => BinauralPresetGroup {
377                preset: preset,
378                carrier: CarrierFrequency::TuningForkHeart,
379                beat: BeatFrequency::Alpha,
380                duration: Duration::FifteenMinutes,
381            },
382            Preset::TuningForkThroat => BinauralPresetGroup {
383                preset: preset,
384                carrier: CarrierFrequency::TuningForkThroat,
385                beat: BeatFrequency::Beta,
386                duration: Duration::TenMinutes,
387            },
388            Preset::TuningForkThirdEye => BinauralPresetGroup {
389                preset: preset,
390                carrier: CarrierFrequency::TuningForkThirdEye,
391                beat: BeatFrequency::Beta,
392                duration: Duration::TenMinutes,
393            },
394            Preset::TuningForkCrown => BinauralPresetGroup {
395                preset: preset,
396                carrier: CarrierFrequency::TuningForkCrown,
397                beat: BeatFrequency::Gamma,
398                duration: Duration::TenMinutes,
399            },
400        }
401    }
402}
403
404/// This implementation returns the human readable text name for for the preset enum.
405impl fmt::Display for Preset {
406    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
407        match self {
408            Preset::Focus => write!(f, "Focus"),
409            Preset::HighFocus => write!(f, "High Focus"),
410            Preset::Relaxation => write!(f, "Relaxation"),
411            Preset::DeepRelaxation => write!(f, "Deep Relaxation"),
412            Preset::Sleep => write!(f, "Sleep"),
413            Preset::Chanting => write!(f, "Chanting"),
414            Preset::Intuition => write!(f, "Intuition"),
415            Preset::Astral => write!(f, "Astral"),
416            Preset::Healing => write!(f, "Healing"),
417            Preset::Alpha => write!(f, "Alpha"),
418            Preset::Intelligence => write!(f, "Intelligence"),
419            Preset::Euphoria => write!(f, "Euphoria"),
420            Preset::CrownFocus => write!(f, "Crown Chakra Focus"),
421            Preset::CrownRelaxation => write!(f, "Crown Chakra Relaxation"),
422            Preset::CrownSleep => write!(f, "Crown Chakra Sleep"),
423            Preset::CrownChanting => write!(f, "Crown Chakra Chanting"),
424            Preset::CrownIntuition => write!(f, "Crown Chakra Intuition"),
425            Preset::CrownAstral => write!(f, "Crown Chakra Astral"),
426            Preset::SolfeggioRoot => write!(f, "Solfeggio Root Chakra"),
427            Preset::SolfeggioSacral => write!(f, "Solfeggio Sacral Chakra"),
428            Preset::SolfeggioSolarPlexus => write!(f, "Solfeggio Solar Plexus Chakra"),
429            Preset::SolfeggioHeart => write!(f, "Solfeggio Heart Chakra"),
430            Preset::SolfeggioThroat => write!(f, "Solfeggio Throat Chakra"),
431            Preset::SolfeggioThirdEye => write!(f, "Solfeggio Third Eye Chakra"),
432            Preset::SolfeggioCrown => write!(f, "Solfeggio Crown Chakra"),
433            Preset::TuningForkRoot => write!(f, "Tuning Fork Root Chakra"),
434            Preset::TuningForkSacral => write!(f, "Tuning Fork Sacral Chakra"),
435            Preset::TuningForkSolarPlexus => write!(f, "Tuning Fork Solar Plexus Chakra"),
436            Preset::TuningForkHeart => write!(f, "Tuning Fork Heart Chakra"),
437            Preset::TuningForkThroat => write!(f, "Tuning Fork Throat Chakra"),
438            Preset::TuningForkThirdEye => write!(f, "Tuning Fork Third Eye Chakra"),
439            Preset::TuningForkCrown => write!(f, "Tuning Fork Crown Chakra"),
440        }
441    }
442}
443
444/// This function returns all of the presets used in a vector.
445pub fn preset_list() -> Vec<Preset> {
446    return vec![
447        Preset::Focus,
448        Preset::HighFocus,
449        Preset::Relaxation,
450        Preset::DeepRelaxation,
451        Preset::Sleep,
452        Preset::Chanting,
453        Preset::Intuition,
454        Preset::Astral,
455        Preset::Healing,
456        Preset::Alpha,
457        Preset::Intelligence,
458        Preset::Euphoria,
459        Preset::CrownFocus,
460        Preset::CrownRelaxation,
461        Preset::CrownSleep,
462        Preset::CrownChanting,
463        Preset::CrownIntuition,
464        Preset::CrownAstral,
465        Preset::SolfeggioRoot,
466        Preset::SolfeggioSacral,
467        Preset::SolfeggioSolarPlexus,
468        Preset::SolfeggioHeart,
469        Preset::SolfeggioThroat,
470        Preset::SolfeggioThirdEye,
471        Preset::SolfeggioCrown,
472        Preset::TuningForkRoot,
473        Preset::TuningForkSacral,
474        Preset::TuningForkSolarPlexus,
475        Preset::TuningForkHeart,
476        Preset::TuningForkThroat,
477        Preset::TuningForkThirdEye,
478        Preset::TuningForkCrown,
479    ];
480}
481
482#[cfg(test)]
483mod test {
484    use super::*;
485
486    macro_rules! test_preset_enum_to_binaural_preset_group_cases {
487        ($($name:ident:($a:expr, $expected:expr),)*) => {
488            $(
489                #[test]
490                fn $name() {
491                    assert_eq!(BinauralPresetGroup::from($a),$expected)
492                }
493            )*
494        };
495    }
496
497    macro_rules! test_preset_enum_to_text_description_cases {
498        ($($name:ident:($a:expr, $expected:expr),)*) => {
499            $(
500                #[test]
501                fn $name() {
502                    assert_eq!($a,$expected)
503                }
504            )*
505        };
506    }
507    #[test]
508    fn preset_list_has_exact_items() {
509        let existing_list = preset_list();
510        let expected_list = vec![
511            Preset::Focus,
512            Preset::HighFocus,
513            Preset::Relaxation,
514            Preset::DeepRelaxation,
515            Preset::Sleep,
516            Preset::Chanting,
517            Preset::Intuition,
518            Preset::Astral,
519            Preset::Healing,
520            Preset::Alpha,
521            Preset::Intelligence,
522            Preset::Euphoria,
523            Preset::CrownFocus,
524            Preset::CrownRelaxation,
525            Preset::CrownSleep,
526            Preset::CrownChanting,
527            Preset::CrownIntuition,
528            Preset::CrownAstral,
529            Preset::SolfeggioRoot,
530            Preset::SolfeggioSacral,
531            Preset::SolfeggioSolarPlexus,
532            Preset::SolfeggioHeart,
533            Preset::SolfeggioThroat,
534            Preset::SolfeggioThirdEye,
535            Preset::SolfeggioCrown,
536            Preset::TuningForkRoot,
537            Preset::TuningForkSacral,
538            Preset::TuningForkSolarPlexus,
539            Preset::TuningForkHeart,
540            Preset::TuningForkThroat,
541            Preset::TuningForkThirdEye,
542            Preset::TuningForkCrown,
543        ];
544
545        assert_eq!(existing_list, expected_list);
546    }
547
548    #[test]
549    fn preset_list_has_expected_sequence_for_items() {
550        let existing_list = preset_list();
551        let expected_list = vec![
552            Preset::Focus,
553            Preset::HighFocus,
554            Preset::Relaxation,
555            Preset::DeepRelaxation,
556            Preset::Sleep,
557            Preset::Chanting,
558            Preset::Intuition,
559            Preset::Astral,
560            Preset::Healing,
561            Preset::Alpha,
562            Preset::Intelligence,
563            Preset::Euphoria,
564            Preset::CrownFocus,
565            Preset::CrownRelaxation,
566            Preset::CrownSleep,
567            Preset::CrownChanting,
568            Preset::CrownIntuition,
569            Preset::CrownAstral,
570            Preset::SolfeggioRoot,
571            Preset::SolfeggioSacral,
572            Preset::SolfeggioSolarPlexus,
573            Preset::SolfeggioHeart,
574            Preset::SolfeggioThroat,
575            Preset::SolfeggioThirdEye,
576            Preset::SolfeggioCrown,
577            Preset::TuningForkRoot,
578            Preset::TuningForkSacral,
579            Preset::TuningForkSolarPlexus,
580            Preset::TuningForkHeart,
581            Preset::TuningForkThroat,
582            Preset::TuningForkThirdEye,
583            Preset::TuningForkCrown,
584        ];
585
586        assert_eq!(existing_list.len(), expected_list.len());
587
588        for (index, existing_value) in existing_list.iter().enumerate() {
589            let expected_entry = expected_list.get(index).unwrap();
590            assert_eq!(existing_value, expected_entry);
591        }
592    }
593
594    test_preset_enum_to_text_description_cases! {
595        preset_text_focus: (Preset::Focus.to_string(), "Focus"),
596        preset_text_high_focus: (Preset::HighFocus.to_string(), "High Focus"),
597        preset_text_relaxation: (Preset::Relaxation.to_string(), "Relaxation"),
598        preset_text_deep_relaxation: (Preset::DeepRelaxation.to_string(), "Deep Relaxation"),
599        preset_text_sleep: (Preset::Sleep.to_string(), "Sleep"),
600        preset_text_chanting: (Preset::Chanting.to_string(), "Chanting"),
601        preset_text_intuition: (Preset::Intuition.to_string(), "Intuition"),
602        preset_text_astral: (Preset::Astral.to_string(), "Astral"),
603        preset_text_healing: (Preset::Healing.to_string(), "Healing"),
604        preset_text_alpha: (Preset::Alpha.to_string(), "Alpha"),
605        preset_text_intelligence: (Preset::Intelligence.to_string(), "Intelligence"),
606        preset_text_euphoria: (Preset::Euphoria.to_string(), "Euphoria"),
607        preset_text_crown_chakra_focus: (Preset::CrownFocus.to_string(), "Crown Chakra Focus"),
608        preset_text_crown_relaxation: (Preset::CrownRelaxation.to_string(), "Crown Chakra Relaxation"),
609        preset_text_crown_sleep: (Preset::CrownSleep.to_string(), "Crown Chakra Sleep"),
610        preset_text_crown_chanting: (Preset::CrownChanting.to_string(), "Crown Chakra Chanting"),
611        preset_text_crown_intuition: (Preset::CrownIntuition.to_string(), "Crown Chakra Intuition"),
612        preset_text_crown_astral: (Preset::CrownAstral.to_string(), "Crown Chakra Astral"),
613        preset_text_solfeggio_root: (Preset::SolfeggioRoot.to_string(), "Solfeggio Root Chakra"),
614        preset_text_solfeggio_sacral: (Preset::SolfeggioSacral.to_string(), "Solfeggio Sacral Chakra"),
615        preset_text_solfeggio_solar_plexus: (Preset::SolfeggioSolarPlexus.to_string(), "Solfeggio Solar Plexus Chakra"),
616        preset_text_solfeggio_heart: (Preset::SolfeggioHeart.to_string(), "Solfeggio Heart Chakra"),
617        preset_text_solfeggio_throat: (Preset::SolfeggioThroat.to_string(), "Solfeggio Throat Chakra"),
618        preset_text_solfeggio_third_eye: (Preset::SolfeggioThirdEye.to_string(), "Solfeggio Third Eye Chakra"),
619        preset_text_solfeggio_crown: (Preset::SolfeggioCrown.to_string(), "Solfeggio Crown Chakra"),
620        preset_text_tuning_fork_root: (Preset::TuningForkRoot.to_string(), "Tuning Fork Root Chakra"),
621        preset_text_tuning_fork_sacral: (Preset::TuningForkSacral.to_string(), "Tuning Fork Sacral Chakra"),
622        preset_text_tuning_fork_solar_plexus: (Preset::TuningForkSolarPlexus.to_string(), "Tuning Fork Solar Plexus Chakra"),
623        preset_text_tuning_fork_heart: (Preset::TuningForkHeart.to_string(), "Tuning Fork Heart Chakra"),
624        preset_text_tuning_fork_throat: (Preset::TuningForkThroat.to_string(), "Tuning Fork Throat Chakra"),
625        preset_text_tuning_fork_third_eye: (Preset::TuningForkThirdEye.to_string(), "Tuning Fork Third Eye Chakra"),
626        preset_text_tuning_fork_crown: (Preset::TuningForkCrown.to_string(), "Tuning Fork Crown Chakra"),
627    }
628
629    test_preset_enum_to_binaural_preset_group_cases! {
630        preset_focus_to_preset_group : (Preset::Focus, BinauralPresetGroup {
631                    preset: Preset::Focus,
632                    carrier: CarrierFrequency::Beta,
633                    beat: BeatFrequency::Beta,
634                    duration: Duration::ThirtyMinutes,
635                }),
636        preset_high_focus_to_preset_group : (Preset::HighFocus, BinauralPresetGroup {
637                    preset: Preset::HighFocus,
638                    carrier: CarrierFrequency::Gamma,
639                    beat: BeatFrequency::Gamma,
640                    duration: Duration::ThirtyMinutes,
641                }),
642    preset_relaxation_to_preset_group : (Preset::Relaxation, BinauralPresetGroup {
643        preset: Preset::Relaxation,
644        carrier: CarrierFrequency::Alpha,
645        beat: BeatFrequency::Alpha,
646        duration: Duration::FifteenMinutes,
647    }),
648    preset_deep_relaxation_to_preset_group : (Preset::DeepRelaxation, BinauralPresetGroup {
649        preset: Preset::DeepRelaxation,
650        carrier: CarrierFrequency::Theta,
651        beat: BeatFrequency::Theta,
652        duration: Duration::FifteenMinutes,
653    }),
654    preset_sleep_to_preset_group : (Preset::Sleep, BinauralPresetGroup {
655        preset: Preset::Sleep,
656        carrier: CarrierFrequency::Delta,
657        beat: BeatFrequency::Delta,
658        duration: Duration::SixtyMinutes,
659    }),
660    preset_chanting_to_preset_group : (Preset::Chanting, BinauralPresetGroup {
661        preset: Preset::Chanting,
662        carrier: CarrierFrequency::Theta,
663        beat: BeatFrequency::Theta,
664        duration: Duration::ThirtyMinutes,
665    }),
666    preset_intuition_to_preset_group : (Preset::Intuition, BinauralPresetGroup {
667        preset: Preset::Intuition,
668        carrier: CarrierFrequency::Theta,
669        beat: BeatFrequency::Theta,
670        duration: Duration::FifteenMinutes,
671    }),
672    preset_astral_to_preset_group : (Preset::Astral, BinauralPresetGroup {
673        preset: Preset::Astral,
674        carrier: CarrierFrequency::Custom(140.0),
675        beat: BeatFrequency::Custom(6.3),
676        duration: Duration::SixtyMinutes,
677    }),
678    preset_healing_to_preset_group : (Preset::Healing, BinauralPresetGroup {
679        preset: Preset::Healing,
680        carrier: CarrierFrequency::Delta,
681        beat: BeatFrequency::Theta,
682        duration: Duration::SixtyMinutes,
683    }),
684    preset_alpha_to_preset_group : (Preset::Alpha, BinauralPresetGroup {
685        preset: Preset::Alpha,
686        carrier: CarrierFrequency::Alpha,
687        beat: BeatFrequency::Alpha,
688        duration: Duration::ThirtyMinutes,
689    }),
690    preset_intelligence_to_preset_group : (Preset::Intelligence, BinauralPresetGroup {
691        preset: Preset::Intelligence,
692        carrier: CarrierFrequency::Gamma,
693        beat: BeatFrequency::Gamma,
694        duration: Duration::TenMinutes,
695    }),
696    preset_euphoria_to_preset_group : (Preset::Euphoria, BinauralPresetGroup {
697        preset: Preset::Euphoria,
698        carrier: CarrierFrequency::Custom(210.42),
699        beat: BeatFrequency::Custom(20.0),
700        duration: Duration::TenMinutes,
701    }),
702
703    preset_crown_focus_to_preset_group : (Preset::CrownFocus, BinauralPresetGroup {
704        preset: Preset::CrownFocus,
705        carrier: CarrierFrequency::TuningForkCrown,
706        beat: BeatFrequency::Beta,
707        duration: Duration::ThirtyMinutes,
708    }),
709    preset_crown_relaxation_to_preset_group : (Preset::CrownRelaxation, BinauralPresetGroup {
710        preset: Preset::CrownRelaxation,
711        carrier: CarrierFrequency::TuningForkCrown,
712        beat: BeatFrequency::Alpha,
713        duration: Duration::FifteenMinutes,
714    }),
715    preset_crown_sleep_to_preset_group : (Preset::CrownSleep, BinauralPresetGroup {
716        preset: Preset::CrownSleep,
717        carrier: CarrierFrequency::TuningForkCrown,
718        beat: BeatFrequency::Delta,
719        duration: Duration::SixtyMinutes,
720    }),
721    preset_crown_chanting_to_preset_group : (Preset::CrownChanting, BinauralPresetGroup {
722        preset: Preset::CrownChanting,
723        carrier: CarrierFrequency::TuningForkCrown,
724        beat: BeatFrequency::Theta,
725        duration: Duration::ThirtyMinutes,
726    }),
727    preset_crown_intuition_to_preset_group : (Preset::CrownIntuition, BinauralPresetGroup {
728        preset: Preset::CrownIntuition,
729        carrier: CarrierFrequency::TuningForkCrown,
730        beat: BeatFrequency::Theta,
731        duration: Duration::FifteenMinutes,
732    }),
733    preset_crown_astral_to_preset_group : (Preset::CrownAstral, BinauralPresetGroup {
734        preset: Preset::CrownAstral,
735        carrier: CarrierFrequency::TuningForkCrown,
736        beat: BeatFrequency::Delta,
737        duration: Duration::SixtyMinutes,
738    }),
739
740    preset_solfeggio_root_to_preset_group : (Preset::SolfeggioRoot, BinauralPresetGroup {
741        preset: Preset::SolfeggioRoot,
742        carrier: CarrierFrequency::SolfeggioRoot,
743        beat: BeatFrequency::Delta,
744        duration: Duration::ThirtyMinutes,
745    }),
746    preset_solfeggio_sacral_to_preset_group : (Preset::SolfeggioSacral, BinauralPresetGroup {
747        preset: Preset::SolfeggioSacral,
748        carrier: CarrierFrequency::SolfeggioSacral,
749        beat: BeatFrequency::Theta,
750        duration: Duration::ThirtyMinutes,
751    }),
752    preset_solfeggio_solar_plexus_to_preset_group : (Preset::SolfeggioSolarPlexus, BinauralPresetGroup {
753        preset: Preset::SolfeggioSolarPlexus,
754        carrier: CarrierFrequency::SolfeggioSolarPlexus,
755        beat: BeatFrequency::Alpha,
756        duration: Duration::ThirtyMinutes,
757    }),
758    preset_solfeggio_heart_to_preset_group : (Preset::SolfeggioHeart, BinauralPresetGroup {
759        preset: Preset::SolfeggioHeart,
760        carrier: CarrierFrequency::SolfeggioHeart,
761        beat: BeatFrequency::Alpha,
762        duration: Duration::FifteenMinutes,
763    }),
764    preset_solfeggio_throat_to_preset_group : (Preset::SolfeggioThroat, BinauralPresetGroup {
765        preset: Preset::SolfeggioThroat,
766        carrier: CarrierFrequency::SolfeggioThroat,
767        beat: BeatFrequency::Beta,
768        duration: Duration::TenMinutes,
769    }),
770    preset_solfeggio_third_eye_to_preset_group : (Preset::SolfeggioThirdEye, BinauralPresetGroup {
771        preset: Preset::SolfeggioThirdEye,
772        carrier: CarrierFrequency::SolfeggioThirdEye,
773        beat: BeatFrequency::Beta,
774        duration: Duration::TenMinutes,
775    }),
776    preset_solfeggio_crown_to_preset_group : (Preset::SolfeggioCrown, BinauralPresetGroup {
777        preset: Preset::SolfeggioCrown,
778        carrier: CarrierFrequency::SolfeggioCrown,
779        beat: BeatFrequency::Gamma,
780        duration: Duration::TenMinutes,
781    }),
782
783    preset_tuning_fork_root_to_preset_group : (Preset::TuningForkRoot, BinauralPresetGroup {
784        preset: Preset::TuningForkRoot,
785        carrier: CarrierFrequency::TuningForkRoot,
786        beat: BeatFrequency::Delta,
787        duration: Duration::ThirtyMinutes,
788    }),
789    preset_tuning_fork_sacral_to_preset_group : (Preset::TuningForkSacral, BinauralPresetGroup {
790        preset: Preset::TuningForkSacral,
791        carrier: CarrierFrequency::TuningForkSacral,
792        beat: BeatFrequency::Theta,
793        duration: Duration::ThirtyMinutes,
794    }),
795    preset_tuning_fork_solar_plexus_to_preset_group : (Preset::TuningForkSolarPlexus, BinauralPresetGroup {
796        preset: Preset::TuningForkSolarPlexus,
797        carrier: CarrierFrequency::TuningForkSolarPlexus,
798        beat: BeatFrequency::Alpha,
799        duration: Duration::ThirtyMinutes,
800    }),
801    preset_tuning_fork_heart_to_preset_group : (Preset::TuningForkHeart, BinauralPresetGroup {
802        preset: Preset::TuningForkHeart,
803        carrier: CarrierFrequency::TuningForkHeart,
804        beat: BeatFrequency::Alpha,
805        duration: Duration::FifteenMinutes,
806    }),
807    preset_tuning_fork_throat_to_preset_group : (Preset::TuningForkThroat, BinauralPresetGroup {
808        preset: Preset::TuningForkThroat,
809        carrier: CarrierFrequency::TuningForkThroat,
810        beat: BeatFrequency::Beta,
811        duration: Duration::TenMinutes,
812    }),
813    preset_tuning_fork_third_eye_to_preset_group : (Preset::TuningForkThirdEye, BinauralPresetGroup {
814        preset: Preset::TuningForkThirdEye,
815        carrier: CarrierFrequency::TuningForkThirdEye,
816        beat: BeatFrequency::Beta,
817        duration: Duration::TenMinutes,
818    }),
819    preset_tuning_fork_crown_to_preset_group : (Preset::TuningForkCrown, BinauralPresetGroup {
820        preset: Preset::TuningForkCrown,
821        carrier: CarrierFrequency::TuningForkCrown,
822        beat: BeatFrequency::Gamma,
823        duration: Duration::TenMinutes,
824    }),
825        }
826}