Skip to content

Conversation

@rileychou
Copy link
Contributor

@rileychou rileychou commented Oct 24, 2025

🎵 Summary of Changes

This PR implements cmajor code for the Cabasa instrument. It takes a lot of inspiration from #80 , but I made the following changes:

  • Replaced the butterworth highpass/lowpass filters with a single SVF (State Variable Filter), which allows us to control resonance (Q) to make it more "metallic"
  • Adjusted the burstSpacing and releaseIn to more accurately reflect a cabasa.

🏷️ Type of Change

  • 🐛 Bug fix
  • 🥁 New drum sound/instrument
  • 🎚️ Improvement to existing sound/instrument
  • ✨ Feature enhancement
  • 📖 Documentation update
  • 🔧 Code refactoring
  • 🧪 Test improvements
  • 🎨 UI/View improvements

💡 Motivation/Reason

I wanted to create a sound that is not drum-like this time. I also didn't know about the cabasa before, and it was fun to play around with different filters!

🧪 Testing Done

  • 🏗️ Built view successfully (npm run build)
  • 🎧 Tested with Cmajor: Run patch command
  • ✅ No breaking changes to existing functionality
  • 🔊 Audio output sounds correct (for audio changes)
  • 📱 UI works as expected (for view changes)

🔗 Related Issues

Fixes #42

📝 Additional Notes

Any additional context, screenshots, or notes for reviewers

Screen.Recording.2025-10-23.at.9.52.06.PM.mov

📋 Checklist

  • 📖 I have read the contributing guidelines
  • 🌿 My code follows the project conventions
  • 💬 I have written clear commit messages
  • 🎯 This PR focuses on a single change

}

float jitter = (noise.out * 0.0003f);
int silentSamples = int((burstSpacing + jitter) * 44100.0f);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as here: #80 (comment)

I don't think we need this

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wait no sorry, I am reading this wrong, this is to space out bursts of one "hit" of the instrument. We do need it, but we should use float(processor.frequency) instead of hardcoding a 44.1khz sample rate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I added that!

@lilyvanoekel lilyvanoekel merged commit f6d8ee9 into lilyvanoekel:main Oct 26, 2025
1 check passed
@lilyvanoekel
Copy link
Owner

@rileychou thank you for all of your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement DSP/Cmajor code for 'Cabasa' (Midi note 69)

2 participants