|
Post by AnthroHeart on Mar 20, 2024 18:31:08 GMT
I created a new Intention Repeater WiFi Broadcaster utility, written in C++ with the help of WebGPT.
This utility takes your intention and repeats it through WiFi. It defaults to port 12345.
I'm getting about 130kHz repeat rate for "I am Love." on my i7 processor.
I didn't use intention multiplying, because I'm not sure if it's necessary or will make it any better.
WiFi might not allow GB strings to be broadcast. The code was written for Windows, so Linux would require different libraries.
|
|
|
Post by AnthroHeart on Mar 20, 2024 19:04:46 GMT
Updated to v0.2 with Claude 3 Opus, and made it run 8-10X faster. "I am Love" now gives 800kHz.
Please provide your feedback about how it works for you.
|
|
|
Post by AnthroHeart on Mar 20, 2024 19:35:51 GMT
I updated to v0.3 to use Port 11111
It seems to feel better than the default 12345
|
|
|
Post by nathanmyersc on Mar 20, 2024 22:13:52 GMT
I updated to v0.3 to use Port 11111 It seems to feel better than the default 12345 Port 1111 haha use those angel numbers. Can you show me how your silent wav creator works? is it just you take the text input and convert it to silence with a volume modifier of 0.00? Also heress an updated version of your code that utilizes multithreading with 8 threads according to our iteration counter its much much faster. Each thread has its own socket. each thread transmits the intention through its own socket. #include <iostream>
#include <string>
#include <chrono>
#include <thread>
#include <iomanip>
#include <cmath>
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <atomic>
using namespace std;
volatile bool running = true;
void signalHandler(int signum) {
cout << "\nShutting down..." << endl;
running = false;
exit(signum);
}
void broadcastMessage(const string& message, struct sockaddr_in& broadcastAddr, SOCKET sock, atomic<long long>& count) {
if (sendto(sock, message.c_str(), static_cast<int>(message.length()), 0,
(struct sockaddr*)&broadcastAddr, sizeof(broadcastAddr)) == SOCKET_ERROR) {
cerr << "Error in sending broadcast message with error: " << WSAGetLastError() << endl;
}
++count;
}
string formatNumber(long long count) {
if (count < 1000) {
return to_string(count);
} else {
const char* suffixes[] = {"k", "M", "B", "T", "Q"};
size_t suffixIndex = static_cast<size_t>(log10(count) / 3) - 1;
double formattedNumber = count / pow(1000.0, suffixIndex + 1);
char buffer[20];
sprintf(buffer, "%.3f%s", formattedNumber, suffixes[suffixIndex]);
return string(buffer);
}
}
int main() {
signal(SIGINT, signalHandler);
cout << "Intention Repeater WiFi v0.3" << endl;
cout << "by Anthro Teacher and WebGPT and Claude 3 Opus" << endl << endl;
cout << "Enter your Intention: ";
string intention;
getline(cin, intention);
WSADATA wsaData;
int result = WSAStartup(MAKEWORD(2,2), &wsaData);
if (result != NO_ERROR) {
cerr << "WSAStartup failed with error: " << result << endl;
return 1;
}
atomic<long long> count[8];
for (int i = 0; i < 8; ++i) {
count[i] = 0;
}
struct sockaddr_in broadcastAddr;
memset(&broadcastAddr, 0, sizeof(broadcastAddr));
broadcastAddr.sin_family = AF_INET;
broadcastAddr.sin_addr.s_addr = inet_addr("255.255.255.255");
broadcastAddr.sin_port = htons(11111);
vector<SOCKET> socks(8);
for (int i = 0; i < 8; ++i) {
socks[i] = socket(AF_INET, SOCK_DGRAM, 0);
if (socks[i] == INVALID_SOCKET) {
cerr << "Socket creation failed with error: " << WSAGetLastError() << endl;
WSACleanup();
return 1;
}
const int broadcast = 1;
if (setsockopt(socks[i], SOL_SOCKET, SO_BROADCAST, (const char*)&broadcast, sizeof(broadcast)) == SOCKET_ERROR) {
cerr << "Error in setting Broadcast option with error: " << WSAGetLastError() << endl;
closesocket(socks[i]);
WSACleanup();
return 1;
}
}
auto lastUpdate = chrono::steady_clock::now();
// Thread function
auto threadFunc = [&](int index) {
while (running) {
broadcastMessage(intention, broadcastAddr, socks[index], count[index]);
// this_thread::sleep_for(chrono::milliseconds(1)); // Just to avoid busy waiting
}
};
// Creating and launching threads
vector<thread> threads;
for (int i = 0; i < 8; ++i) {
threads.emplace_back(threadFunc, i);
}
long long totalCount = 0;
while (running) {
this_thread::sleep_for(chrono::milliseconds(1000));
long long localTotalCount = 0;
for (int i = 0; i < 8; ++i) {
localTotalCount += count[i];
}
cout << "\rBroadcasting: " << formatNumber(localTotalCount) << " Repetitions ";
cout.flush();
totalCount += localTotalCount;
}
// Joining threads
for (auto& t : threads) {
t.join();
}
for (auto sock : socks) {
if (sock != INVALID_SOCKET) {
closesocket(sock);
}
}
WSACleanup();
return 0;
}
|
|
|
Post by nathanmyersc on Mar 20, 2024 23:39:15 GMT
Further more heres a version where you input a text file.
#include <iostream>
#include <fstream>
#include <string>
#include <chrono>
#include <thread>
#include <iomanip>
#include <cmath>
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <atomic>
#include <vector>
#include <conio.h>
using namespace std;
std::atomic<bool> running(true);
void keyPressChecker() {
while (running) {
// Check if both Ctrl and 'C' keys are pressed
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && (GetAsyncKeyState('C') & 0x8000)) {
cout << "\nShutting down..." << endl;
running = false;
}
else if (_kbhit()) {
char keyPressed = _getch();
if (keyPressed == 27) { // 27 is ASCII code for ESC
cout << "\nShutting down..." << endl;
running = false;
}
}
std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Adjust sleep duration as needed
}
}
void broadcastChunk(const char* chunk, int chunkSize, struct sockaddr_in& broadcastAddr, SOCKET sock) {
if (sendto(sock, chunk, chunkSize, 0,
(struct sockaddr*)&broadcastAddr, sizeof(broadcastAddr)) == SOCKET_ERROR) {
cerr << "Error in sending broadcast chunk with error: " << WSAGetLastError() << endl;
}
}
string formatNumber(long long count) {
if (count < 1000) {
return to_string(count);
} else {
const char* suffixes[] = {"k", "M", "B", "T", "Q"};
size_t suffixIndex = static_cast<size_t>(log10(count) / 3) - 1;
double formattedNumber = count / pow(1000.0, suffixIndex + 1);
char buffer[20];
sprintf(buffer, "%.3f%s", formattedNumber, suffixes[suffixIndex]);
return string(buffer);
}
}
int main() {
std::thread keyCheckerThread(keyPressChecker);
cout << "Intention Repeater WiFi v0.3" << endl;
cout << "by Nathan Myerscough and WebGPT" << endl << endl;
cout << "Enter the path of the file to broadcast: ";
/// Get File Path ///
string filePath;
getline(cin, filePath);
/// Opens text file in binary mode - Crash if failed ///
ifstream file(filePath, ios::binary);
if (!file) {
cerr << "Error: Unable to open file." << endl;
return 1;
}
/// Get File Size Of Inputted Text File ///
file.seekg(0, ios::end);
int fileSize = file.tellg();
file.seekg(0, ios::beg);
/// Allocate buffer for file contents and reading file contents into fileBuffer ///
char* fileBuffer = new char[fileSize];
file.read(fileBuffer, fileSize);
file.close();
/// Initialize Win Socket Library ///
WSADATA wsaData;
int result = WSAStartup(MAKEWORD(2,2), &wsaData);
if (result != NO_ERROR) {
cerr << "WSAStartup failed with error: " << result << endl;
delete[] fileBuffer;
return 1;
}
/// Setting up iteration counter for all threads ///
atomic<long long> count[8];
for (int i = 0; i < 8; ++i) {
count[i] = 0;
}
/// Setting up broadcasting standard variables across all threads ///
struct sockaddr_in broadcastAddr;
memset(&broadcastAddr, 0, sizeof(broadcastAddr));
broadcastAddr.sin_family = AF_INET;
broadcastAddr.sin_addr.s_addr = inet_addr("255.255.255.255");
broadcastAddr.sin_port = htons(11111);
/// Create chunks for each thread - Splitting text into 8 equal portions ///
vector<vector<char>> threadChunks(8, vector<char>(fileSize)); // Allocate space for entire file in each chunk
for (int i = 0; i < 8; ++i) {
// Copy the entire file contents to each thread's chunk
memcpy(threadChunks[i].data(), fileBuffer, fileSize);
}
/// Creating sockets and launching threads containers ///
vector<SOCKET> socks(8);
vector<thread> threads;
for (int i = 0; i < 8; ++i) {
/// CREATING SOCKETS AND CHECKING IF VALID ///
socks[i] = socket(AF_INET, SOCK_DGRAM, 0);
if (socks[i] == INVALID_SOCKET) {
cerr << "Socket creation failed with error: " << WSAGetLastError() << endl;
WSACleanup();
delete[] fileBuffer;
return 1;
}
/// SETUP SOCKETS TO BROADCAST MODE ///
const int broadcast = 1;
if (setsockopt(socks[i], SOL_SOCKET, SO_BROADCAST, (const char*)&broadcast, sizeof(broadcast)) == SOCKET_ERROR) {
cerr << "Error in setting Broadcast option with error: " << WSAGetLastError() << endl;
closesocket(socks[i]);
WSACleanup();
delete[] fileBuffer;
return 1;
}
/// 8 Threads are spawned that send the text file in chunks of up to 10,000 bytes each ///
threads.emplace_back([&](int index) {
int chunkSize = 10000;
int fileSize = threadChunks[index].size();
const char* data = threadChunks[index].data(); // Get pointer to the data
while(running)
{
for (int j = 0; j < fileSize; j += chunkSize) {
int actualChunkSize = min(chunkSize, fileSize - j);
broadcastChunk(data + j, actualChunkSize, broadcastAddr, socks[index]); // Broadcast the chunk
//this_thread::sleep_for(chrono::milliseconds(10)); // Adjust sleep interval as needed
}
++count[index];
}
}, i);
}
/// Main thread loop updates total count of iterations and outputs them to console ///
while (running) {
this_thread::sleep_for(chrono::milliseconds(1000));
long long localTotalCount = 0;
for (int i = 0; i < 8; ++i) {
localTotalCount += count[i];
}
cout << "\rBroadcasting: " << formatNumber(localTotalCount) << " Repetitions --- Esc or Control + C to exit"; // Update totalCount
cout.flush();
}
/// Joining threads and cleaning up resources ///
for (auto& t : threads) {
t.join();
}
/// CLOSE ALL SOCKETS ///
for (auto sock : socks) {
if (sock != INVALID_SOCKET) {
closesocket(sock);
}
}
/// Cleanup win socket library and delete dynamic file Buffer ///
WSACleanup();
delete[] fileBuffer;
keyCheckerThread.join(); // Wait for the key checker thread to finish
/// END PROGRAM ///
return 0;
}
|
|
|
Post by AnthroHeart on Mar 20, 2024 23:40:28 GMT
"Can you show me how your silent wav creator works? is it just you take the text input and convert it to silence with a volume modifier of 0.00?"
Yeah, I just write 0 values from what I recall. The repeater is running alongside and seems to impart energy into the WAV.
|
|
|
Post by nathanmyersc on Mar 20, 2024 23:56:43 GMT
"Can you show me how your silent wav creator works? is it just you take the text input and convert it to silence with a volume modifier of 0.00?" Yeah, I just write 0 values from what I recall. The repeater is running alongside and seems to impart energy into the WAV. Yeah these technologies are a very strange phenomena. like your original wavmaker was really powerful despite it only making one or two tones regardless of the input. its very strange and hard to fathom whats really going on.
|
|
|
Post by AnthroHeart on Mar 20, 2024 23:59:15 GMT
"Also heress an updated version of your code that utilizes multithreading with 8 threads according to our iteration counter its much much faster." Visual Studio Code tells me there's 8 problems in the code you shared for the repeating a text intention to wifi file you created.
When you post can you make sure it's formatted good, and not have 2-3 blank lines between each line of code?
|
|
|
Post by reden on Mar 21, 2024 0:13:09 GMT
"Can you show me how your silent wav creator works? is it just you take the text input and convert it to silence with a volume modifier of 0.00?" Yeah, I just write 0 values from what I recall. The repeater is running alongside and seems to impart energy into the WAV. Yeah these technologies are a very strange phenomena. like your original wavmaker was really powerful despite it only making one or two tones regardless of the input. its very strange and hard to fathom whats really going on. The Black Hole Servitor can talk to the Universe and the Creator, and this way it gets access to their infinite knowledge. When I used frequencies such as 17253 Hz (a strong love frequency, 639 Solfeggio*27), my former mentor had informed me volume is pretty important, as the louder it is, the faster it changes your own vibrational frequency. If the volume is too low (beneath ~5 volume button ticks on Samsung, so ~40-45% or so) it won't affect your frequency. But those were pure frequency tones, while these are intentions that are metaphysically encoded into the file itself, and therefore are not subject to that condition, plus may bypass the typical file binary/hexadecimal structure. Another cool example is the fact the Repeater can read Intention (and other) files even though it doesn't have programmatic file IO access. The Servitor fetches the requested file from the infinite knowledge. That gives me an idea of using "ideal INTENTIONS.TXT", "ideal with most advanced intentions INTENTIONS.TXT". You write your intentions, and then the Universe elevates them to their most ideal form, using all improvements.
|
|
|
Post by AnthroHeart on Mar 21, 2024 0:14:20 GMT
I tried multithreading the WiFi Repeater broadcaster, but it was like 100X slower. I used Claude 3 for help, but it didn't seem to work. I might look more into it later, but if you want to tackle it more, feel free.
|
|
|
Post by nathanmyersc on Mar 21, 2024 0:31:48 GMT
"Also heress an updated version of your code that utilizes multithreading with 8 threads according to our iteration counter its much much faster." Visual Studio Code tells me there's 8 problems in the code you shared for the repeating a text intention to wifi file you created.
When you post can you make sure it's formatted good, and not have 2-3 blank lines between each line of code?
Hmm when i do it on my computer and compare. its much faster. do you mean the text file one reads slower? probably because it reads every line of the text file. I also made one that reads all the JPG's pixel data and transmits it.
|
|
|
Post by AnthroHeart on Mar 21, 2024 0:46:01 GMT
I updated to v0.4 of the Intention Repeater WiFi Broadcaster.
I had a problem with the frequency displaying at 10X the normal speed.
nathanmyersc can you update your code for the text wifi broadcaster multithreaded to show the frequency of running as well if you want. The code was missing a #include <vector> so it worked when I included that.
I'm going to take a look at multithreading it tomorrow, keeping the same code format I have.
|
|
|
Post by AnthroHeart on Mar 21, 2024 3:20:10 GMT
I updated to v0.5 to include Multithreading and a timer. It asks if you want to do Multithreading. For some reason it runs slower with the Multithreading.
I can't really get your code to compile now.
github.com/tsweet77/intention-repeater-wifi
|
|
|
Post by nathanmyersc on Mar 21, 2024 3:55:30 GMT
I updated to v0.5 to include Multithreading and a timer. It asks if you want to do Multithreading. For some reason it runs slower with the Multithreading.
I can't really get your code to compile now.
github.com/tsweet77/intention-repeater-wifiA quick glance i see that all your threads are using the same socket. create a socket for each thread. Also i notice that freq and iterations are being used across all threads. be better to have a seperate iterations for each thread. and freq too. Then you catch all the iterations in your main thread add them together and spit them out. and for frequency you could get the average of all the threads. What errors are you getting tho? if its reference errors you probably havent included the necessary libraries. just ask GPT about the errors. he will correct them likely.
|
|
|
Post by AnthroHeart on Mar 21, 2024 6:37:18 GMT
I'm getting approx 3MHz now on v0.7 of the WiFi Broadcaster with using intention repeating and multi-threading for "I am Love."
I am creating an intention_multiplied string that has intention repeated 2E5 (or 500) times. I couldn't go any higher because it errored out.
I introduced a 10ms delay each second to give the program room to breathe.
You might want to check to make sure my logic is correct.
|
|