|
Post by slowscape on Jul 26, 2020 21:53:24 GMT
I’m thinking the other way around, modify mozzi to use pin 11! I’ll have to look at it the next time I have a chance
|
|
|
Post by admin on Jul 26, 2020 22:22:50 GMT
I’m thinking the other way around, modify mozzi to use pin 11! I’ll have to look at it the next time I have a chance That would be great, good luck!
|
|
|
Post by admin on Jul 27, 2020 9:59:10 GMT
I’m thinking the other way around, modify mozzi to use pin 11! I’ll have to look at it the next time I have a chance Hi slowscape, I've done some digging and googleing and found one possible reason why Mozzi uses pin 9 instead of pin 11 and that may have to do with the timer interrupts that are responsible for that pin. This website explains it in way too much detail for the uninitiated (that's me): www.robotshop.com/community/forum/t/arduino-101-timers-and-interrupts/13072But I can see that the gist of it is that pin 9 is accessed by timer1 which is a 16bit timer and pin 11 is accessed by timer2 which is only an 8bit timer. I assume that Tim Barrass chose pin 9 to achieve better sound quality due to a higher timer resolution. Here is an excerpt from the webpage above that supports this claim: --- There is fixed relation between the timers and the PWM capable outputs. When you look in the data sheet or the pinout of the processor these PWM capable pins have names like OCRxA, OCRxB or OCRxC (where x means the timer number 0..5). The PWM functionality is often shared with other pin functionality. The Arduino has 3Timers and 6 PWM output pins. The relation between timers and PWM outputs is: Pins 5 and 6: controlled by timer0 (8bit) Pins 9 and 10: controlled by timer1 (16bit) Pins 11 and 3: controlled by timer2 (8bit) Timer0: Timer0 is a 8bit timer. In the Arduino world timer0 is been used for the timer functions, like delay() 645, millis() 1.4k and micros() 651. If you change timer0 registers, this may influence the Arduino timer function. So you should know what you are doing. Timer1: Timer1 is a 16bit timer. In the Arduino world the Servo library 1.0k uses timer1 on Arduino Uno (timer5 on Arduino Mega). Timer2: Timer2 is a 8bit timer like timer0. In the Arduino work the tone() 847 function uses timer2. ---
|
|
|
Post by slowscape on Jul 29, 2020 16:26:03 GMT
Thanks for doing the heavy lifting here admin Our interpretations are the same. Doesn’t look possible. Or if it were it could only be 8bit seems hardware is the best solution! Now... I need to look into hardware hacking my grains 😆
|
|
|
Post by rodney on Aug 6, 2020 5:16:44 GMT
I'm also planning to mod my old Grains to have Mozzi-mode.
I recall conversations with Tim a few years ago about changing the output pin and it was pretty clear he was not keen on doing it (needed to use the LittleBits arduino module with Mozzi) and that such changes would be a huge headache. I assume Carsten's sleuthing results above are probably the reason.
|
|
cpruby
Junior Member
Posts: 73
|
Post by cpruby on Nov 17, 2020 2:37:54 GMT
I wanted to play with the speak and spell firmware and make it say "A E Modular Are." I found two obstacles: (1) there are a lot of words so easily tuning it was tricky and that (2) the chaos/randomness made it even harder. So I took a peek at the code, removed the extraneous words and deleted the chaos variable from being added into the final selection. I am not a coder by any stretch of the imagination. But I want to show that if I can do it, then hopefully anyone else could! This is how I edited it: - Line 62, changed the number of words from 323 to 4.
- Line 420, changed the range that it used to look for the values from 0 to 3. 0 through 3 is selected because that gives us four options (0, 1, 2, and 3) for each of the words. The code then reads as: say_word = map( analogRead(A2), 0, 1023, 0, 3 );
- Repeated the above for lines 422 and 424.
- In lines 422 and 424, I deleted the "+chaos" to delete the influence of chaos. I probably could delete the If on 421 and then delete 423 and 424, but I am not a coder.
- Deleted all of the extra words other than spt_A, spt_ARE, spt_E, and spt_Module (I put this step last as it then doesn't change all of the line numbers)
Here's the final code: /*
"Spell or Speak" an alternative Firmware for the AE Modular GRAINS module by tangible waves
https://www.tangiblewaves.com/store/p86/GRAINS.html
The synthetic words, as used with a famous toy from the late 70th, can be triggered via Gate-impulses and selcted via CV or a pot on the GRAINS
To set up the environment needed to install this firmware,
please refer to the AeManual for GRAINS on the AE Modular Wiki:
http://wiki.aemodular.com/pmwiki.php/AeManual/GRAINS
Demotrack available here: https://soundcloud.com/taitekatto/grains-spell-or-speak
This program relies on the Talkie Library by Peter Knight as modified by Jean-Luc Deladrière with "Talko Counter for Grains",
which is also included in the folder of this firmware.
The orinal "TALKO COUNTER" also including talkie.cpp and talkie.h of this version of the Talkie Library can be found here:
https://www.ginkosynthese.com/grains-codes
The phonems used with this firmware as provided via "Vocab_US_TI99.c" and others can be found with the talkie-library for Arduino here:
https://www.arduinolibraries.info/libraries/talkie
Note: if you want to adjust the way Pitch and Speed of the talking-voice can be modified please have a look at "talkie.cpp"
in the current folder and look for the values mapped via "analogRead(0)" and "analogRead(1)".
Usage of this Firmware with GRAINS:
===================================
IN1 / Pot1: Select word from available phonems (via CV or pot)
IN2 / Pot2: Change the Pitch of the currently selected word (via CV or pot)
IN3: GATE to trigger the currently selected word
Pot3: Change the Speed of the currently selected word (via pot)
A: If analog input is used more or less random values can be applied to modify the current word-selection
OUT: Audio out of spoken words or letters
D: Quantized value (HIGH or LOW) of the input given via analog input, this may be used as GATE/trigger for other AE Modular modules
Caution! Use at your own risk (according to GNU General Public License v2 '12. No Warrenty')
--------------------------------------------------------------------------------------------
This program in combination with the hardware it is applied to can produce harsh and loud frequencies that may be of harm to speakers or your ears!
Permanent hearing loss may result from exposure to sound at high volumes. Use as low a volume as possible.
'Spell or Speak' an experimental Firmware for the AE Modular GRAINS module by tangible waves
Copyright (C) 2020 Mathias Brüssel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 as published by
the Free Software Foundation.
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/>.
*/
#include <Arduino.h>
#include "Talkie.h"
#include "Vocab_US_TI99.h" // Texas Instruments phonems, similar to those used with the famous "Speak&Spell" and other devices
Talkie voice; // Prepare speach - Use PIN 11 only, because this is connected as audio out with tangible waves GRAINS module
static uint8_t* words[4] = // List of words to be select from via GRAINS CV ins and/or pots
{
spt_A,
spt_ARE,
spt_E,
spt_MODULE,
};
void setup()
{
// Serial.begin(115200); // Only needed if you want to use Serial.print() to put out values to the Arduino IDE's Serial Window
}
void loop()
{
static bool last_trigger = true;
bool new_trigger = false;
int say_word = 0;
int last_read = 0;
int chaos = 0;
if(last_trigger) // If word was triggered already look for low gate
{
if( analogRead(A3) < 512 ) // CV-in 3 of GRAINS-module "LOW"?
last_trigger = new_trigger = false; // No new gate, remember condition
}
else // If no word is currently triggered we can look for new trigger
{
if( analogRead(A3) >= 512 ) // CV-in 3 of GRAINS-module "HIGH"?
last_trigger = new_trigger = true; // We have a gate now, remember the condition
}
chaos = analogRead(A4); // Analogue input, can also be used as CV-in with this Firmware of GRAINS
if( chaos > 4 ) // Value should be >= 5 if input is connected
chaos = map( chaos, 0, 1023, 1, 160 ); // This is a more or less random value we get via audio or CV input to be added or substracted to the index of the selected word lateron
// --- Note: IN2/Pot2:Pitch and Pot3:Speed are adjusted in talkie.cpp via "map(analogRead(...))" as modified by Jean-Luc Deladrière for "Talko Counter for Grains" ---
if( new_trigger ) // Speak now!
{
say_word = map( analogRead(A2), 0, 1023, 0, 3 ); // CV IN 1 / Pot 1 - used to select words
if( say_word > 161 )
voice.say(words[constrain(say_word,0,3)]); // Random-factor read from analog input higher than middle of available words, substract
else
voice.say(words[constrain(say_word,0,3)]); // Random-factor read from analog input lowe than middle of available words, add
}
chaos > 80 ? digitalWrite(8, HIGH) : digitalWrite(8, LOW); // Set digital out to low or high, depending on level of analogue input
}
|
|
|
Post by funbun on Jan 18, 2021 16:58:21 GMT
Yeah, a pair of GRAINS modules will help flesh out my oscillator corps. May even get three.
|
|
|
Post by tIB on Feb 6, 2021 9:16:16 GMT
I've gone for one... not sure what's coming out yet, or whether I'll stick at one!
|
|
|
Post by tIB on Feb 22, 2021 21:13:13 GMT
Any way to get more range out of the grains as an oscilator? I like it but it tops out easily.
|
|
|
Post by duddex on Oct 23, 2021 14:40:09 GMT
I’m thinking the other way around, modify mozzi to use pin 11! I’ll have to look at it the next time I have a chance When I saw this question, I thought "that should be easy", because the I noticed that the MOZZI-Grains-modules define the PINs which are used in the code: [...] // --- GRAINS CV ins, outs and Pots, using 'Arduino-PINS' according to: https://wiki.aemodular.com/pmwiki.php/AeManual/GRAINS --- #define CV_POT_IN1 A2 #define CV_POT_IN2 A1 #define CV_POT3 A0 #define CV_IN3 A3 #define CV_AUDIO_IN A4 #define CV_AUDIO_OUT 9 #define CV_GATE_OUT 8 [...] So we just have to change this to 11??? No! Unfortunately, CV_AUDIO_OUT is not used. As admin already described in his earlier post above, PIN 9 is used somewhere deep in the MOZZI library.
|
|
|
Post by duddex on Oct 23, 2021 14:44:36 GMT
My favorite GRAINS firmware so far is Polyramp ("It is a drone machine comprising 8 stacked sawtooth oscillators"). I will post some results of my sessions as soon as I have set up my recording gear
|
|
cpruby
Junior Member
Posts: 73
|
Post by cpruby on Jun 13, 2022 1:14:49 GMT
I wanted my Grains to have an expanded vocabulary. So I perused the other Talkie libraries and condensed it quite a bit. This is what I came up with: docs.google.com/spreadsheets/d/1QF8irVPPMI77OkpnBLwkVkF61zdM1-v3uPz2AAjRXQ4/edit?usp=sharingThe Master sheet is what basically get's copied into the GrainsSpellOrSpeak.ino file. Export it as a tab delineated document and paste the result into the code. The TI99C and TI99H get copied into Vocab_US_TI99.c and Vocab_US_TI99.h respectively. The TI99C needs to be exported as a comma separated value document and the TI99H can be a space or tab delineated document. From there it is easy to paste into the correct source. This vocabulary is too large for the Grains. Regardless, it is near impossible to control with such a large library. So I'm going to use this as a starting point and delete the words/phrases that I do not want to use. I'm not sure how to implement this into the github or even if it is a good idea to do so since it will not compile correctly due to it's size.
|
|
|
Post by dizzeesatchel on Sept 6, 2023 11:39:05 GMT
It's nice to have a nosey around under the covers of AE modules sometimes Anyone know what the six unused connection points here might be for? robertlanger ?
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Sept 6, 2023 11:42:36 GMT
That’ll be the programming header for the processor… The same pins are on a bunch of the wonkystuff modules 😁
|
|
|
Post by dizzeesatchel on Sept 6, 2023 12:19:25 GMT
Ah, of course!
|
|
|
Post by feijai on Nov 9, 2023 21:39:12 GMT
This vocabulary is too large for the Grains. Regardless, it is near impossible to control with such a large library. So I'm going to use this as a starting point and delete the words/phrases that I do not want to use. I'm not sure how to implement this into the github or even if it is a good idea to do so since it will not compile correctly due to it's size. It's easy to just comment out the words you don't need. Or we could build a macro facility to only include ones as required.
What I'd like to see is if someone has gone through these words and snipped out the 44 English phonemes, plus empty space. So we'd have "words" like TH or EH or N and could put them together to THEN, or any word we liked. That's a much better approach than a limited dictionary of words.
|
|
|
Post by feijai on Nov 9, 2023 21:50:14 GMT
I'm on the hunt for Grains and Mozzi projects, to gather them under a single repository.
UGH, Mozzi is using a broken non open source license (CC-NC-SA) which is INCOMPATIBLE with Arduino's own library license. :-( That's a level of stupid I've not seen for a while in a major project. It appears that Bastl is using Mozzi in their products even though Mozzi's license forbids it.
|
|