Skip to content

Commit

Permalink
Bump version to 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
discordier committed Jan 17, 2022
1 parent 23cb604 commit 71aaeb1
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 109 deletions.
25 changes: 11 additions & 14 deletions dist/guessnum.common.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This is SamJs.js v0.1.3
* This is SamJs.js v0.1.4
*
* A Javascript port of "SAM Software Automatic Mouth".
*
* (c) 2017-2021 Christian Schiffler
* (c) 2017-2022 Christian Schiffler
*
* @link(https://github.com/discordier/sam)
*
Expand Down Expand Up @@ -1190,7 +1190,7 @@ var AdjustLengths = ((getPhoneme, setLength, getLength) => {
// prior phoneme is a stop consonant
{
console.log("".concat(position, " RULE: <STOP CONSONANT> <LIQUID> - decrease by 2"));
} // decrease the phoneme length by 2 frames (20 ms)
} // decrease the phoneme length by 2 frames


setLength(position, getLength(position) - 2);
Expand Down Expand Up @@ -1992,7 +1992,8 @@ let FALLING_INFLECTION = 1;
/** CREATE FRAMES
*
* The length parameter in the list corresponds to the number of frames
* to expand the phoneme to. Each frame represents 10 milliseconds of time.
* to expand the phoneme to. At the default speed, each frame represents
* about 10 milliseconds of time.
* So a phoneme with a length of 7 = 7 frames = 70 milliseconds duration.
*
* The parameters are copied from the phoneme to the frame verbatim.
Expand Down Expand Up @@ -2148,12 +2149,11 @@ var Renderer = ((phonemes, pitch, mouth, throat, speed, singmode) => {
mouth = mouth === undefined ? 128 : mouth & 0xFF;
throat = throat === undefined ? 128 : throat & 0xFF;
speed = (speed || 72) & 0xFF;
singmode = singmode || false; // Every frame is 20ms long.
singmode = singmode || false; // Reserve 176.4*speed samples (=8*speed ms) for each frame.

let Output = CreateOutputBuffer(441 // = (22050/50)
* phonemes.reduce((pre, v) => pre + v[1] * 20, 0) / 50 // Combined phoneme length in ms.
* speed | 0 // multiplied by speed.
);
let Output = CreateOutputBuffer(176.4 // = (22050/125)
* phonemes.reduce((pre, v) => pre + v[1], 0) // Combined phoneme length in frames.
* speed | 0);
/**
* PROCESS THE FRAMES
*
Expand Down Expand Up @@ -2224,9 +2224,7 @@ var Renderer = ((phonemes, pitch, mouth, throat, speed, singmode) => {
}; // Removed sine table stored a pre calculated sine wave but in modern CPU, we can calculate inline.


let sinus = x => {
return ((Math.sin(2 * Math.PI * (x / 255)) * 128 | 0) / 16 | 0) * 16;
};
let sinus = x => Math.sin(2 * Math.PI * (x / 256)) * 127 | 0;

let speedcounter = speed;
let phase1 = 0;
Expand Down Expand Up @@ -2359,8 +2357,7 @@ var Renderer = ((phonemes, pitch, mouth, throat, speed, singmode) => {
*
* The phoneme list is converted into sound through the steps:
*
* 1. Copy each phoneme <length> number of times into the frames list,
* where each frame represents 10 milliseconds of sound.
* 1. Copy each phoneme <length> number of times into the frames list.
*
* 2. Determine the transitions lengths between phonemes, and linearly
* interpolate the values across the frames.
Expand Down
6 changes: 3 additions & 3 deletions dist/guessnum.common.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/guessnum.common.min.js.map

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions dist/guessnum.esm.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This is SamJs.js v0.1.3
* This is SamJs.js v0.1.4
*
* A Javascript port of "SAM Software Automatic Mouth".
*
* (c) 2017-2021 Christian Schiffler
* (c) 2017-2022 Christian Schiffler
*
* @link(https://github.com/discordier/sam)
*
Expand Down Expand Up @@ -1188,7 +1188,7 @@ var AdjustLengths = ((getPhoneme, setLength, getLength) => {
// prior phoneme is a stop consonant
{
console.log("".concat(position, " RULE: <STOP CONSONANT> <LIQUID> - decrease by 2"));
} // decrease the phoneme length by 2 frames (20 ms)
} // decrease the phoneme length by 2 frames


setLength(position, getLength(position) - 2);
Expand Down Expand Up @@ -1990,7 +1990,8 @@ let FALLING_INFLECTION = 1;
/** CREATE FRAMES
*
* The length parameter in the list corresponds to the number of frames
* to expand the phoneme to. Each frame represents 10 milliseconds of time.
* to expand the phoneme to. At the default speed, each frame represents
* about 10 milliseconds of time.
* So a phoneme with a length of 7 = 7 frames = 70 milliseconds duration.
*
* The parameters are copied from the phoneme to the frame verbatim.
Expand Down Expand Up @@ -2146,12 +2147,11 @@ var Renderer = ((phonemes, pitch, mouth, throat, speed, singmode) => {
mouth = mouth === undefined ? 128 : mouth & 0xFF;
throat = throat === undefined ? 128 : throat & 0xFF;
speed = (speed || 72) & 0xFF;
singmode = singmode || false; // Every frame is 20ms long.
singmode = singmode || false; // Reserve 176.4*speed samples (=8*speed ms) for each frame.

let Output = CreateOutputBuffer(441 // = (22050/50)
* phonemes.reduce((pre, v) => pre + v[1] * 20, 0) / 50 // Combined phoneme length in ms.
* speed | 0 // multiplied by speed.
);
let Output = CreateOutputBuffer(176.4 // = (22050/125)
* phonemes.reduce((pre, v) => pre + v[1], 0) // Combined phoneme length in frames.
* speed | 0);
/**
* PROCESS THE FRAMES
*
Expand Down Expand Up @@ -2222,9 +2222,7 @@ var Renderer = ((phonemes, pitch, mouth, throat, speed, singmode) => {
}; // Removed sine table stored a pre calculated sine wave but in modern CPU, we can calculate inline.


let sinus = x => {
return ((Math.sin(2 * Math.PI * (x / 255)) * 128 | 0) / 16 | 0) * 16;
};
let sinus = x => Math.sin(2 * Math.PI * (x / 256)) * 127 | 0;

let speedcounter = speed;
let phase1 = 0;
Expand Down Expand Up @@ -2357,8 +2355,7 @@ var Renderer = ((phonemes, pitch, mouth, throat, speed, singmode) => {
*
* The phoneme list is converted into sound through the steps:
*
* 1. Copy each phoneme <length> number of times into the frames list,
* where each frame represents 10 milliseconds of sound.
* 1. Copy each phoneme <length> number of times into the frames list.
*
* 2. Determine the transitions lengths between phonemes, and linearly
* interpolate the values across the frames.
Expand Down
Loading

0 comments on commit 71aaeb1

Please sign in to comment.