-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from ardura/FM_Update
Fm update
- Loading branch information
Showing
11 changed files
with
2,250 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "Actuate" | ||
version = "1.2.5" | ||
version = "1.2.6" | ||
edition = "2021" | ||
authors = ["Ardura <[email protected]>"] | ||
license = "GPL-3.0-or-later" | ||
|
@@ -33,8 +33,12 @@ lazy_static = "1.4.0" | |
#nih_plug_egui = { git = "https://github.com/ardura/nih-plug.git", rev = "4d28fb251422bdabfc65641beedb490bdf35c297" } | ||
|
||
# My branch - new 2024 | ||
nih_plug = { git = "https://github.com/ardura/nih-plug.git", rev = "96d413756faa145dc063fc9ca609d86bc7d2e3e7", features = ["assert_process_allocs"] } | ||
nih_plug_egui = { git = "https://github.com/ardura/nih-plug.git", rev = "96d413756faa145dc063fc9ca609d86bc7d2e3e7" } | ||
#nih_plug = { git = "https://github.com/ardura/nih-plug.git", rev = "96d413756faa145dc063fc9ca609d86bc7d2e3e7", features = ["assert_process_allocs"] } | ||
#nih_plug_egui = { git = "https://github.com/ardura/nih-plug.git", rev = "96d413756faa145dc063fc9ca609d86bc7d2e3e7" } | ||
|
||
# Nih plug update | ||
nih_plug = { git = "https://github.com/ardura/nih-plug.git", rev = "fed302db1fcfb374f9af90bb872be0edd3ee0568", features = ["assert_process_allocs"] } | ||
nih_plug_egui = { git = "https://github.com/ardura/nih-plug.git", rev = "fed302db1fcfb374f9af90bb872be0edd3ee0568" } | ||
|
||
# Local | ||
#nih_plug = { path = "../../nih-plug", features = ["assert_process_allocs"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::f32::consts::{PI}; | ||
|
||
pub fn frequency_modulation(modulating_sample: f32, carrier_sample: f32, modulation_index: f32) -> f32 { | ||
if modulation_index == 0.0 { | ||
return carrier_sample; | ||
} | ||
let phase_change = modulation_index * modulating_sample; | ||
let modulated_signal = (2.0 * PI * carrier_sample + phase_change).cos(); | ||
|
||
let compensation_factor = 1.0 / (modulation_index*0.5 + 2.0); | ||
let compensated_signal = modulated_signal * compensation_factor; | ||
|
||
compensated_signal | ||
} | ||
|
||
pub fn double_modulation(modulating_sample: f32, carrier_sample: f32, modulation_index: f32) -> f32 { | ||
let first_fm_sample = frequency_modulation(modulating_sample, carrier_sample, modulation_index); | ||
let second_fm_sample = frequency_modulation(first_fm_sample, carrier_sample, modulation_index); | ||
second_fm_sample | ||
} | ||
|
||
pub fn triple_modulation(modulating_sample: f32, carrier_sample: f32, modulation_index: f32) -> f32 { | ||
let first_fm_sample = frequency_modulation(modulating_sample, carrier_sample, modulation_index); | ||
let second_fm_sample = frequency_modulation(first_fm_sample, carrier_sample, modulation_index); | ||
let third_fm_sample = frequency_modulation(second_fm_sample, carrier_sample, modulation_index); | ||
third_fm_sample | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.