undquiy maryanne onidah

0 views
Skip to first unread message

Dorian Aldrege

unread,
Aug 2, 2024, 9:36:27 PM8/2/24
to critizoocrec

Who remembers punching in key-combinations found online into their Nokia 3210 to create custom ringtones?I spent more time than I would to admit doing this in my youth.Over the weekend I decided as a bit of an nostalgic exercise to see if I could implement a Nokia Composer clone using JavaScript and the Web Audio API.From here, I expanded on the player to provide the ability to download the generated ringtone as a WAV file.

I decided to leverage in-line React and Babel, so as to keep all the logic on a single webpage.This makes for a more succient demo, and provides the ability to automatically highlight the required code in-line.

Looking at the above code you can see the described sections are broken apart, with the default values and melody notes subsquently being parsed individually.The default values are parsed first, so as to have these available when parsing the melody section.Using the supplied specification I was able to ensure that only valid melody notes were parsed.I found using regular expression named capture groups provided a very elegant means to produce the defined values per note (providing defaults were there were omissions).

With the RTTTL now parsed, my next objective was to translate the defined note/octaves of the melody into frequencies of which I could send to the Oscillator.This lead me to research into the the Twelve-Tone Equal Temperament system of tuning.Using this system and alittle bit of Math, we are able to calculate the frequency of a given note/octave using a known base note frequency.Typically A4 (aka Stuttgart pitch, 440Hz) is used as the base frequency of which all calculations are done, however, I noticed that if I instead use C4 (Middle-C, 261.63Hz) it would save some offset Math calculations being required.

This forumla can again be implemented in JavaScript to calculate the note one lower and one higher than the provided frequency (in this case C4):Notice that using C as the base note allows omission of any offset calculation needing to be applied, thanks to the the array being zero-indexed.

Using the parsed RTTTL and Web Audio API AudioContext/Oscillator, I am able to cycle through the melody ensuring that the given frequency is set for the desired duration within the Oscillator.This completed the implementation required to play the composition within the Browser ?.

The final step to this demostration was adding the ability to generate a WAV file from the supplied RTTTL composition.Thanks to the OfflineAudioContext, I was able to employ the same logic described above to generate an in-memory AudioBuffer representation of the melody.

To conclude, I enjoyed exploring how Nokia ringtones were represented in RTTTL, and how you could use alittle bit of Music Theory/Math to generate the corresponding frequencies.The Web Audio API AudioContext/Oscillator abstracted away alot of intricacies required to produce the desired sounds.This allowed me to play the sound in real-time, as well was produce an in-memory representation that I could generate a WAV file from.I found the most interesting part of the exercise was researching into how a WAV files was constructed, from a raw bits/bytes level.

I've been working on a music improvisation program for a class I'm taking, and I need to be able to show what it can do to a class. Currently, the program outputs notes in scientific format and chords in brackets (I use Python). Here's an example of the output:

Is there any CLI software that I can use to play those notes? I will be presenting this on a Mac, and I develop on Linux, so it would be nice to have a CLI utility that I can just pipe the output of my program into.

There are a whole bunch of resources that might be useful to you here. If it does't need to run in real time, you might be happiest just writing a standard midi file and using some other software to actually render the playback.

I don't know of a program that does that. Though I have written a program that plays Nokia ringtone format through the PC 'beep' speaker. But you can't beep two tones at once so my program can't handle chords.

This guide is thought for the ones who have MIDI files of their favourite songs and want to "translate" them to ringtones, and is made referring to some useful tools I found on the net. The downloadable ZIP containing them (Nokia Ringtone Kit), along with the tones I made myself, can be found in the Downloads/AudioVideo page.

RTTTL (simply referred to as "RTTL") stands for RingTone Text Transfer Language and is the standard text format describing notes on the cellphones, so, at least until the last passage, this guide can be used for every kind of phone supporting this standard, the only difference being that you will need to find yourself the keys to write notes, as the program I included in the package converts notes to keypresses just for Nokia phones.

Then copy them in your working folder, possibly changing the name to easier ones, like "intro.mid" and "ghost.mid" for the example, and finally start MIDI2Tone (tonewin.exe) opening one file and playing it.

Use the selector in the upper-right corner to change the channel, until you see the note frequency in the black window follows the beat and the frequency of the main melody. After that, press the Note View button:

In the package is included also WBeep, a DOS utility. Extract it in the same folder of the TXT, and in Windows Explorer drag and drop the TXT on the EXE file. It will playback the tone with the PC Speaker giving a fast preview.

For a very long time, I've been using a Nokia 6303 classic phone. I was very satisfied with that phone. the built-in camera made good photos, I could use the music player to listen to music through headphones, and the user interface was usable.You may recall that back in 2016, I even wrote a perl script to decode the contact lists after that phone backs it up into a zip file (with .NBF extension) containing indivdual files for each contact. That script exports phonebook entries into a semicolon-separated file with lines like this:BME kzponti;+3614631111[download]That's a simple entry. Some lines list additional data, such as multiple phone numbers and possibly text notes in the same entry separated by a semicolon. I never figured out how to make a backup file that the phone could import though. In fact I once had to restore all the backups by hand.In 2017-11, I bought a Nokia 216 as a spare phone, because I figured that if I lose my phone or it becomes non-functional, I'd like to have a spare phone at hand immediately. That one only has a much worse camera, but that didn't matter anymore, because I had a pretty good compact camera now. I charged the phone and verified that it worked, then put it in a drawer.In (2018-08) 2018-06, I lost the Nokia 6303. I cleaned it with too much water, which in itself wouldn't have been a problem, but I then put the battery back in the phone before it dried properly. The phone turned on, but went off after a few seconds, and I couldn't revive it after drying. I'd like to add that this was the second time the phone got wet, it has survived falling into the toilet once before.So I mourned for the old phone, but was happy that I had the foresight to have bought a replacement earlier. For a few days.I actually also had the foresight to have most of the important phone numbers copied to the SIM card, so I could transfer those phone numbers to the new phone by copying from that, and entered a few more important ones from the dump of the backup, so I had like fifty important phone numbers in the phone. You may ask why I don't just transfer all phone numbers through SIM cards then, since SIM cards are pretty cheap, and I have several old spare ones in my drawer. The problem is that the contact list stored on SIM cards has some big limitations: names can't be longer than about 15 bytes (some characters take more than one byte, I don't know the exact rule), the card can only store 250 contacts (I already had more than that back then), and the card can't store additional information such as notes. Anyway, I at least got a phone that I could use for a temporary basis, and transfering the whole contact list was something that could wait a few days. But since I actually tried to use the phone for other tasks, and it turned out to be a disaster. It only took a few days to find out how terrible the user interface of the Nokia 216 was. How I raged! The way button presses are assigned are bad everywhere, but especially for the main screen and locked state are terrible. Not only do I have to press much more buttons to do the same thing than on the 6303, but it's also close to impossible to use the phone without looking at it all the time. I specifically chose a phone with a keypad that isn't completely flat, so that I can type messages blindly. Finding that I have to constantly look at the display for much more operations than in the 6303 was bad. The phone doesn't know how to assign separate ringtones for different people. It insists that I can only use one ringtone for everyone. On the 6303, I used four different ringtones, with different family members assigned to three different ones, and everyone else on a fourth ringtone by default.The messages menu is terrible. You can accidentally get messages you are writing into a state where they're still in the phone, but all you can do with it is retry sending to an invalid phone number or delete, you can't view or edit the message, you have to retype it.The music player is practically unusuable, because it can't play an album with the tracks in order, even in albums that I have encoded myself where all the music files have proper meta-information like album name and track number in it, and the filenames are consistent and differ only in a track number that I even zero-padded to two digits. Apparently the phone doesn't even make an effort to sort the tracks, it just plays them in the order they appear in the directory entry or something. The volume control of the 6303 was bad if you tried to use it through headphones, in that you could listen to music through the headphones loud or very loud, but quietly, but the volume control of the 216 is even worse. It doesn't matter much for music, which I can't listen to anyway, but this also makes sure that I can't listen to radio and can't even conveniently make a phone call through the headphones in quiet environment without having to listen to a too loud voice.The calendar is limited to 25 entries, and each entry can only have 39 characters of text to it. How am I supposed to write the location of a meeting in 39 characters? Use the notes list then, which in the 6303 I used to store shopping lists and other notes like that? You can, for the location and directions of the next meeting, but not for a shopping list, because each note can only be 100 character long. By the way, the contact list also doesn't take notes, you can only enter a name and one phone number to each entry. The name can be 30 character long in theory, but in practice you can use much less than that, because you can only see one line of the name when browsing the phonebook, and you can't scroll the names without trying to edit them. It's like they don't know how to use dynamic allocation for the flash memory, only they certainly do, because the phone still has a camera and can store photos of various sizes.The phone also doesn't say "Nokia 216" anywhere, not in the sticker under the battery, nor in the interface. I think the phone manufacturers are so ashamed of this phone line that they tried to make sure people don't write bad reviews by releasing a whole line of phones that look confusingly similar to each other, and not writing the type on any of them.There are only three good things I can say about the Nokia 216: it generally reacts quickly enough to keypresses, it accepts two SIM cards, and it's possible to import a contact list prepared on a computer.Here's how I imported the contact list. After finding out the limitations of the phone, First, I edited the semicolon-separated backup file to shorten the names and otherwise clean up the list. While I was there, I fixed all the names to have the correct letters, because some of the entries actually had names inherited from one of the two even older phones, which didn't have a full character set, so they had characters like "" instead of "" and "" instead of "ő" I never bothered to fix that on the 6303, even though that one already supported all letters of Hungarian, and I entered all the new names with the correct characters. Then I used a messy perl script to verify that the list of contacts looks fine, and convert them to the format that the 216 accepts, which I could reverse engineer from an exported contact list in a few tries. Here's the code, with a few details omitted.#!perluse strict; use warnings;use re "/u";open my$I, "", $ARGV[1] or die qq(open out: $!);binmode STDERR, ":encoding(cp852)" or die;my$counter = 0;while(my$l = ) { chomp $l; $l = tr/[\x00-\x1f\x7f-\x90]// and die qq(error: control characte+rs); my($n, @r) = split /;/, $l; 4

c01484d022
Reply all
Reply to author
Forward
0 new messages