# How can I make a very simple FSK(Frequency Shift Key) generator?

**URL:** https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443
**Category:** Coding Questions
**Created:** [September 10, 2018, 6:22pm UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443 "2018-09-10T18:22:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![8bit\_coder](https://avatars.discourse-cdn.com/v4/letter/8/c77e96/32.png) [@8bit\_coder](https://discourse.processing.org/u/8bit_coder)
#### Post date: [September 10, 2018, 6:22pm UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443/1 "2018-09-10T18:22:25Z")

</div>

I’m trying to make a very bare bones replica of a linux program(I use windows so I can’t use it) called minimodem.

What I’m trying to replicate is the part at 18 seconds, the transmitting part: [youtube.com/watch?v=pwuyMJfyNmY](http://youtube.com/watch?v=pwuyMJfyNmY)

How would I go about creating a function that I can enter a string of text into and then it translates it to FSK modulation, at a baud rate that’s changeable, and then play it? Is that even possible in processing? Thanks.

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [September 10, 2018, 6:37pm UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443/2 "2018-09-10T18:37:30Z")

</div>

Hi 8bit\_coder,

I would use the [charAt()](https://processing.org/reference/String_charAt_.html) function.

In your draw loop, you first get the first character and a rectangle next to it.  
Then you draw the first 2 characters and a rectangle next to it.  
And so on and so on…

Try something by yourself and come back if you are stuck somewhere, you’ll get more answers 🙂

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [September 11, 2018, 11:42pm UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443/3 "2018-09-11T23:42:54Z")

</div>

Cool project concept.

Are you planning on using the minim library or the Sound library?

- [http://code.compartmental.net/tools/minim/](http://code.compartmental.net/tools/minim/)
- [https://processing.org/reference/libraries/sound/index.html](https://processing.org/reference/libraries/sound/index.html)

---

<div class="post-metadata">

### Author: ![8bit\_coder](https://avatars.discourse-cdn.com/v4/letter/8/c77e96/32.png) [@8bit\_coder](https://discourse.processing.org/u/8bit_coder)
#### Post date: [September 12, 2018, 2:18am UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443/4 "2018-09-12T02:18:18Z")

</div>

I’m trying to use Minim to make it

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [September 12, 2018, 4:10am UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443/5 "2018-09-12T04:10:40Z")

</div>

Great!

What are the project details for the design – e.g. do you have a lookup table for which character should be what frequency? Do you know what the per-character duration should be?

If you are looking to generate tones, you might want to look at ugens

- [http://code.compartmental.net/minim/index\_ugens.html](http://code.compartmental.net/minim/index_ugens.html)

specifically:

- [http://code.compartmental.net/minim/frequency\_class\_frequency.html](http://code.compartmental.net/minim/frequency_class_frequency.html)
- [http://code.compartmental.net/minim/midi2hz\_class\_midi2hz.html](http://code.compartmental.net/minim/midi2hz_class_midi2hz.html)
- [http://code.compartmental.net/minim/oscil\_class\_oscil.html](http://code.compartmental.net/minim/oscil_class_oscil.html)
