Skip to content
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Corona Virus Stats (Covid-19)
  • Work with us
  • FB
  • LinkedIn
  • Twitter
  • Instagram.com
Tekraze

Tekraze

Dive Into Technology

  • Guides
    • Developer Guide
    • PC Guide
    • Web Guide
    • Android Guide
    • Music
    • Tutorials
  • Feed
    • Tech News
    • Shared Tech
    • Gaming Videos
    • Unboxing videos
  • Forums
    • Android Apps
    • Angular Npm Packages
    • Useful Site Links
    • Tech Queries
    • Windows OS Help
    • Web Guide and Help
    • Android Os And Rooting
    • Jhipster Discussion
    • Git & GitHub forum
    • Open Source Forum
  • Work with us
  • Toggle search form
Logo of the programming language ChucK

A Little Chuck Script for a Pluck Sound

Posted on May 22, 2019February 24, 2020 By krizillox_krizi No Comments on A Little Chuck Script for a Pluck Sound

Chuck is a concurrent and strongly timing based audio programming language for real-time synthesis, composition, and performance. Chuck runs on Linux, Mac OS X, Microsoft Windows, and iOS. It is designed to favor readability and flexibility for the program over other considerations such as raw performance. https://en.wikipedia.org/wiki/ChucK

If you are not familiar with Chuck, below is a tutorial for ChucK beginners :

Chuck Beginners Tutorial

It is a lightweight programming language, aiming for audio programming and sound synthesis.

Today, I am going to explain a little ChucK script for generating a pluck sound. The script has been downloaded from https://chuck.cs.princeton.edu/doc/examples/deep/plu.ck

| Also Read | A Guide for Newcomers to Artificial Intelligence

THE ACTUAL ChucK SCRIPT.

// karplus + strong plucked string filter
// Ge Wang (gewang@cs.princeton.edu)

// feedforward
Noise imp => OneZero lowpass => dac;
// feedback
lowpass => Delay delay => lowpass;

// our radius
.99999 => float R;
// our delay order
500 => float L;
// set delay
L::samp => delay.delay;
// set dissipation factor
Math.pow( R, L ) => delay.gain;
// place zero
-1 => lowpass.zero;

// fire excitation
1 => imp.gain;
// for one delay round trip
L::samp => now;
// cease fire
0 => imp.gain;

// advance time
(Math.log(.0001) / Math.log(R))::samp => now;

 

| Also Read | How to Learn FL Studio

EXPLANATION

  • Under “feedforward”, a Noise object is being created. Noise is a standard ChucK Unit Generator Class. A Noise object will be used to produce white noise. OneZero is a protected Filter subclass implementation of one-zero digital filter. “lowpass” is the object which has been created which is then attached to the “dac”. “dac” is the abstraction of the underlying audio output device.
  • “lowpass” is now a Noise object which will produce a white noise with a one-zero filter enveloped on it through the audio output unit of your device.
  • Under “feedback”, a feedback chain is being created on the “lowpass” object implementing a Delay Class object called “delay”. The “delay” object is getting its input from the “lowpass” object and the output of the “delay” object is then being fed back into the “lowpass” object to create a delay effect on the generated audio.
  • Now we are setting some delay parameters. Under “our radius”, we are creating a floating point variable “R” and are assigning it a value of “0.99999” and “our delay order”,  we are creating a floating point variable “L” and are assigning it a value of “500”.
  • Under “set delay”, we are setting the delay order for each sample (L::samp => delay.delay), as the delay length for the “delay” object (delay.delay). Doing this we are setting the delay length for the delay object for each sample of the audio generated.
  • Under “setting dissipation factor”, we are setting the delay gain (delay.gain), the gain parameter for the “delay” object as R to its L’th power. This will decrease the delay gain as time passes and the delay effect will dissipate over time as the value touches zero.
  • Under “place zero”, we are setting the zero position to the “lowpass” object (lowpass.zero).
  • Then we are firing the excitation, by setting the gain of the Noise Class object “imp” to 1.
  • Then we run the noise unit generator by advancing the time by each sample and then we stop the fire by setting the gain value of the noise object “imp” to 0. This will let only one sample of the noise to generate.
  • Then we advance the time by each sample to let the delay work its way down to when it completely diminishes.
  • When we run this script, it generates a pluck noise which we can hear. The Sound slowly fades away and the delay effect which has been put on the generated noise is what actually is making it feel like a tail to the one sample of the noise we generated.
  • If we remove the delay part from this script, we will only be able to listen to a single sample of noise, which we actually would not be able to hear. Chuck is a very interesting programming language for those who have an interest in sound and audio. You should check it out once.
| Also Read | How to start with Competitive Programming Language

Don’t forget to share your views in comments below what you think. Feel free to comment and share. Thanks for reading. Stay connected for more post like this coming.

Content Protection by DMCA.com
Music, Music creation, Tutorials Tags:audio coding, audio from code, audio programming, audio programming language, best audio programming language, ChucK, chuck audio example, chuck audio programming, chuck audio script, chuck examples, chuck programming language, chuck programs, chuck script, chuck tutorials, ge wang, pl.uck explanation

Post navigation

Previous Post: Cloud Security for Business
Next Post: Adaptive Security for Embedded Analytics in 2019

Related Posts

  • How to Keep Your Mac Safe from Hackers 1
    How to Keep Your Mac Safe from Hackers Guest posts
  • Photoshop Basics Tutorials 2
    Photoshop Basics Tutorials Web Guide
  • Setting Up a DJ Practice Area at Home Tekraze
    Setting Up a DJ Practice Area at Home Guest posts
  • GIMP vs PHOTOSHOP
    GIMP vs PHOTOSHOP Which one is the Designers Choice? Tutorials
  • Amazon Echo Plus Tekraze
    Amazon Echo Plus Device Review Guest posts
  • Introduction to Git Version Control
    Introduction to Git Version Control Developer Guide

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Advertisements

Subscribe to updates

Enter your email below to subscribe





Posts by Categories

Advertisements
  • Cloud Gaming Services Banner
    13 cloud gaming services for gamers to play high end games in 2021 Gaming
  • Tekraze Antivirus for Windows 7
    The Best Free Antivirus Software for Windows 7/8/8.1/10 PC Guide
  • BOSS An Indian OS - For Linux Lover 3
    BOSS An Indian OS – For Linux Lover Developer Guide
  • How to grow Your E-commerce Business Using YouTube? Tekraze
    How to grow Your E-commerce Business Using YouTube? Web Guide
  • Tekraze front end design components
    Front End Design components Developer Guide
  • How to start with Competitive Programming ? 4
    How to start with Competitive Programming ? Developer Guide
  • It trends to look for in 2019 tekraze
    6 Game Changing Enterprise IT Trends you must know Developer Guide
  • Linux Terminology basics you need to know
    Linux Terminology basics you need to know Developer Guide

Affliate Links

Sell with Payhip

Earn with Magenet

Sell and Buy with Adsy

GainRock affiliate Program

Automatic Backlinks

Advertise with Anonymous Ads

accessily tekraze verificationIndian Blog Directory

Copyright © 2023 Tekraze.

Powered by PressBook News WordPress theme